<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><div>there is a disconnect between the methods that help(libvirt) shows for class virStorageVol and the method listed in </div><div>/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:<br></div><div><br></div><div><div>    def createXML(self, xmldesc, flags):</div><div>        """Create a storage volume within a pool based</div><div>        on an XML description. Not all pools support</div><div>        creation of volumes """</div><div>        ret = libvirtmod.virStorageVolCreateXML(self._o, xmldesc, flags)</div><div>        if
 ret is None:raise libvirtError('virStorageVolCreateXML() failed', pool=self)</div><div>        __tmp = virStorageVol(self, _obj=ret)</div><div>        return __tmp</div><div><br></div></div>  <div style="font-size: 10pt; font-family: verdana, helvetica, sans-serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Osier Yang <jyang@redhat.com><br> <b><span style="font-weight: bold;">To:</span></b> Syed A. Ali <syed_a_ali@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "libvirt-users@redhat.com" <libvirt-users@redhat.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, May 7, 2012 6:23 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [libvirt-users] list storage pools and volumes using python
 api calls<br> </font> </div> <br>
On 2012年05月07日 13:26, Syed A. Ali wrote:<br>> how do i list storage pools and volumes using the python bindings?<br>> basically the python api calls for virsh pool-list and virsh vol-list<br>> thanks<br>><br>><br><br># python<br> >>> import libvirt<br> >>> help(libvirt)<br><br>You will find "listStoragePools" in class "virConnect",<br>and "listVolumes" in class "virStoragePool".<br><br>Regards,<br>Osier<br><br>_______________________________________________<br>libvirt-users mailing list<br><a ymailto="mailto:libvirt-users@redhat.com" href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br><br> </div> </div>  </div></body></html>