mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
7b35fd718d
https://bugzilla.redhat.com/show_bug.cgi?id=895882 virDomainSnapshot.getDomain() and virDomainSnapshot.getConnect() wrappers around virDomainSnapshotGet{Domain,Connect} were not supposed to be ever implemented. The class should contain proper domain() and connect() accessors that fetch python objects stored internally within the class. While domain() was already provided, connect() was missing. This patch adds connect() method to virDomainSnapshot class and reimplements getDomain() and getConnect() methods as aliases to domain() and connect() for backward compatibility.
20 lines
704 B
Python
20 lines
704 B
Python
def getConnect(self):
|
|
"""Get the connection that owns the domain that a snapshot was created for"""
|
|
return self.connect()
|
|
|
|
def getDomain(self):
|
|
"""Get the domain that a snapshot was created for"""
|
|
return self.domain()
|
|
|
|
def listAllChildren(self, flags):
|
|
"""List all child snapshots and returns a list of snapshot objects"""
|
|
ret = libvirtmod.virDomainSnapshotListAllChildren(self._o, flags)
|
|
if ret is None:
|
|
raise libvirtError("virDomainSnapshotListAllChildren() failed", conn=self)
|
|
|
|
retlist = list()
|
|
for snapptr in ret:
|
|
retlist.append(virDomainSnapshot(self, _obj=snapptr))
|
|
|
|
return retlist
|