Skip to content

Commit 932055e

Browse files
committed
generator: Fix domainCheckpoint.listAllChildren()
virDomainCheckpoint(dom, _obj) expects a reference to the virDomain as its first argument, but virDomainCheckpoint.listAllChildren() passes `self` instead: libvirt.py:7056: error: Argument 1 to "virDomainCheckpoint" has incompatible type "virDomainCheckpoint"; expected "virDomain" >>> import libvirt >>> con = libvirt.open('test:///default') >>> dom = con.lookupByName("test") >>> first = dom.checkpointCreateXML("""<domaincheckpoint><name>First</name></domaincheckpoint>""") >>> second = dom.checkpointCreateXML("""<domaincheckpoint><name>Second</name></domaincheckpoint>""") >>> child, = first.listAllChildren() >>> second.domain() <libvirt.virDomain object at 0x7f828d777b80> ^^^^^^^^^ >>> child.domain() <libvirt.virDomainCheckpoint object at 0x7f828d8160a0> ^^^^^^^^^^^^^^^^^^^ Signed-off-by: Philipp Hahn <[email protected]>
1 parent a65d230 commit 932055e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libvirt-override-virDomainCheckpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ def listAllChildren(self, flags=0):
1414

1515
retlist = list()
1616
for chkptr in ret:
17-
retlist.append(virDomainCheckpoint(self, _obj=chkptr))
17+
retlist.append(virDomainCheckpoint(self.domain(), _obj=chkptr))
1818

1919
return retlist

0 commit comments

Comments
 (0)