[et-mgmt-tools] [PATCH 4/6] Make VirtualDisk libvirt storage aware

Cole Robinson crobinso at redhat.com
Wed Aug 6 16:24:01 UTC 2008


The following patch fixes up VirtualDisk validation and
adds options for specifying libvirt managed storage.

The whole validation mechanism is fixed to allow setting
properties outside of object init time and still having
useful validation. A lot of documentation is added as well.

The main interface changes are as follows (ripped from the
code docs):

===========================

If creating a disk object from an existing local block
device or file, a path is all that should be required. If you want to
create a local file, a size also needs to be specified.

The remote case is a bit more complex. The options are:
    1. A libvirt virStorageVol instance (passed as 'volObject') for an
       existing storage volume.
    2. A virtinst L{StorageVolume} instance for creating a volume (passed
       as 'volInstall').
    3. An active connection ('conn') and a path to a storage volume on
       that connection.
    4. An active connection and a tuple of the form ("poolname",
       "volumename") (passed as 'volName')

For the last two cases, the lookup will be performed, and 'vol_object'
will be set to the returned virStorageVol. All the above cases also
work on a local connection as well, the only difference being that
option 3 won't neccessarily error out if the volume isn't found.

===========================

This is a pretty ugly patch, I was changing several things
at once, sorry. I've tried to test all new and old use cases
and the code seems to be pretty solid.

Thanks,
Cole
-------------- next part --------------
A non-text attachment was scrubbed...
Name: virtinst-remote-04-vdisk-storage-api.patch
Type: text/x-patch
Size: 25216 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/et-mgmt-tools/attachments/20080806/4b588a61/attachment.bin>


More information about the et-mgmt-tools mailing list