summaryrefslogtreecommitdiff
path: root/libvirt-override-virStoragePool.py
Commit message (Collapse)AuthorAgeFilesLines
* override: Convert to list comprehensionPhilipp Hahn2020-08-181-5/+1
| | | | | | :%s/retlist = list()\n\s*\(for \w\+ in ret\):\n\s*retlist.append(\(.*\))\n\n\s*return retlist/return [\2 \1]/ Signed-off-by: Philipp Hahn <hahn@univention.de>
* override: Add manual PEP 484 type annotationsPhilipp Hahn2020-08-181-1/+1
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* Remove legacy libvirtError argumentsPhilipp Hahn2020-08-061-1/+1
| | | | | | | | | | | | The fields have been deprecated in C with git:f60dc0bc09f09c6817d6706a9edb1579a3e2b2b8 They are only passed to the libvirtError constructor, but not stored for later or used anywhere else. sed -ri '/raise libvirtError/s/, \w+=self(\._dom)?//' *.py Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Fix parent typev6.6.0Philipp Hahn2020-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constructors for virDomain, virStoragePool, virDomainCheckpoint, virDomainSnapshot expect virConnect as their first argument. The current code always uses `self`, which is okay when such an instance is created from a method of virConnect itself, but there are several cases where this is not the case: virDomain.migrate() -> virDomain virDomain.migrate2() -> virDomain virDomain.migrate3() -> virDomain virDomainCheckpoint.getParent() -> virDomainCheckpoint virDomainSnapshot.getParent() -> virDomainSnapshot virStorageVol.storagePoolLookupByVolume() -> virStoragePool > libvirt.py:1850: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect" > libvirt.py:1871: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect" > libvirt.py:1888: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect" > libvirt.py:3422: error: Argument 1 to "virStorageVol" has incompatible type "virStoragePool"; expected "virConnect" > libvirt.py:6835: error: Argument 1 to "virDomainCheckpoint" has incompatible type "virDomainCheckpoint"; expected "virDomain" > libvirt.py:6943: error: Argument 1 to "virDomainSnapshot" has incompatible type "virDomainSnapshot"; expected "virDomain" >>> import libvirt >>> con = libvirt.open('test:///default') >>> dom = con.lookupByName("test") >>> first = dom.checkpointCreateXML("""<domaincheckpoint><name>First</name></domaincheckpoint>""") >>> first.domain() <libvirt.virDomain object at 0x7f728c3b6b80> ^^^^^^ >>> second = dom.checkpointCreateXML("""<domaincheckpoint><name>Second</name></domaincheckpoint>""") >>> parent = second.getParent() >>> parent.domain() <libvirt.virDomainCheckpoint object at 0x7f728c424d30> ^^^^^^^^^^^^^^^^ Signed-off-by: Philipp Hahn <hahn@univention.de>
* python: treat flags as default argument with value 0Guannan Ren2013-03-221-1/+1
| | | | | | | | | | | The following four functions have not changed because default arguments have to come after positional arguments. Changing them will break the the binding APIs. migrate(self, dconn, flags, dname, uri, bandwidth): migrate2(self, dconn, dxml, flags, dname, uri, bandwidth): migrateToURI(self, duri, flags, dname, bandwidth): migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):
* list: Expose virStoragePoolListAllVolumes to Python bindingOsier Yang2012-09-101-0/+11
The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virStoragePool.py: * New file, includes implementation of listAllVolumes. python/libvirt-override.c: Implementation for the wrapper.