[et-mgmt-tools] [RFC] virtinst: build libvirt storage xml

Cole Robinson crobinso at redhat.com
Fri Jul 25 16:27:29 UTC 2008


Daniel P. Berrange wrote:
> On Fri, Jul 25, 2008 at 12:01:15PM -0400, Cole Robinson wrote:
>> Daniel P. Berrange wrote:
>>  >> The general workflow is as follows:
>>>> =========================================
>>>> import virtinst.Storage.StoragePool as sp
>>>>
>>>> # This gives the appropriate class for the specified pool type
>>>> pool_class = sp.get_pool_class(sp.TYPE_FOO)
>>>>
>>>> # Only required params are a conn/uri and name. Default formats
>>>> # and target paths have default values, but source paths/
>>>> # devices and hostnames obviously have no sensible default, but
>>>> # they still aren't required for object instantiation
>>>> pool = pool_class(name="foo", uri="xen:///")
>>> Should proably allow a existing connection to be passed in, otherwise
>>> this class has to deal with authentication issues too.
>>>
>> I didn't show it in the example, but passing a connection is allowed.
>>
>> On a side note, we should add support for openAuth in virtinst,
>> everything is just hardcoded to use libvirt.open at the moment.
> 
> No, that's exactly why we shouldn't take a URI. openAuth requires user
> interaction, so that's unavoidably application specific. We just need
> a helper in virtinst/cli.py for the command line tools to use to create
> their connection object, and virt-manager already knows how to do
> authentication. So everything should just pass ina connection object
> instead of URI.
> 
> Daniel

Ahh okay, that makes sense. I'll remove the option to pass a URI then,
since we really shouldn't even encourage passing a URI and expecting
the library to open it.

- Cole




More information about the et-mgmt-tools mailing list