[libvirt-users] list storage pools and volumes using python api calls

Syed A. Ali syed_a_ali at yahoo.com
Mon May 7 19:39:24 UTC 2012

there is a disconnect between the methods that help(libvirt) shows for class virStorageVol and the method listed in 
/usr/lib64/python2.6/site-packages/libvirt.py for the same class. method createXML used for virStorageVolCreateXML is missing when i use help(libvirt) and scroll down to the class virStorageVol, however the method is listed in libvirt.py as:

    def createXML(self, xmldesc, flags):
        """Create a storage volume within a pool based
        on an XML description. Not all pools support
        creation of volumes """
        ret = libvirtmod.virStorageVolCreateXML(self._o, xmldesc, flags)
        if ret is None:raise libvirtError('virStorageVolCreateXML() failed', pool=self)
        __tmp = virStorageVol(self, _obj=ret)
        return __tmp

 From: Osier Yang <jyang at redhat.com>
To: Syed A. Ali <syed_a_ali at yahoo.com> 
Cc: "libvirt-users at redhat.com" <libvirt-users at redhat.com> 
Sent: Monday, May 7, 2012 6:23 AM
Subject: Re: [libvirt-users] list storage pools and volumes using python api calls
On 2012年05月07日 13:26, Syed A. Ali wrote:
> how do i list storage pools and volumes using the python bindings?
> basically the python api calls for virsh pool-list and virsh vol-list
> thanks

# python
>>> import libvirt
>>> help(libvirt)

You will find "listStoragePools" in class "virConnect",
and "listVolumes" in class "virStoragePool".


libvirt-users mailing list
libvirt-users at redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120507/630d01d7/attachment.htm>

More information about the libvirt-users mailing list