1 def listAllSnapshots(self
, flags
=0):
2 """List all snapshots and returns a list of snapshot objects"""
3 ret
= libvirtmod
.virDomainListAllSnapshots(self
._o
, flags
)
5 raise libvirtError("virDomainListAllSnapshots() failed", conn
=self
)
9 retlist
.append(virDomainSnapshot(self
, _obj
=snapptr
))
14 def listAllCheckpoints(self
, flags
=0):
15 """List all checkpoints and returns a list of checkpoint objects"""
16 ret
= libvirtmod
.virDomainListAllCheckpoints(self
._o
, flags
)
18 raise libvirtError("virDomainListAllCheckpoints() failed", conn
=self
)
22 retlist
.append(virDomainCheckpoint(self
, _obj
=chkptr
))
27 def createWithFiles(self
, files
, flags
=0):
28 """Launch a defined domain. If the call succeeds the domain moves from the
29 defined to the running domains pools.
31 @files provides an array of file descriptors which will be
32 made available to the 'init' process of the guest. The file
33 handles exposed to the guest will be renumbered to start
34 from 3 (ie immediately following stderr). This is only
35 supported for guests which use container based virtualization
38 If the VIR_DOMAIN_START_PAUSED flag is set, or if the guest domain
39 has a managed save image that requested paused state (see
40 virDomainManagedSave()) the guest domain will be started, but its
41 CPUs will remain paused. The CPUs can later be manually started
42 using virDomainResume(). In all other cases, the guest domain will
45 If the VIR_DOMAIN_START_AUTODESTROY flag is set, the guest
46 domain will be automatically destroyed when the virConnectPtr
47 object is finally released. This will also happen if the
48 client application crashes / loses its connection to the
49 libvirtd daemon. Any domains marked for auto destroy will
50 block attempts at migration, save-to-file, or snapshots.
52 If the VIR_DOMAIN_START_BYPASS_CACHE flag is set, and there is a
53 managed save file for this domain (created by virDomainManagedSave()),
54 then libvirt will attempt to bypass the file system cache while restoring
55 the file, or fail if it cannot do so for the given system; this can allow
56 less pressure on file system cache, but also risks slowing loads from NFS.
58 If the VIR_DOMAIN_START_FORCE_BOOT flag is set, then any managed save
59 file for this domain is discarded, and the domain boots from scratch. """
60 ret
= libvirtmod
.virDomainCreateWithFiles(self
._o
, files
, flags
)
61 if ret
== -1: raise libvirtError ('virDomainCreateWithFiles() failed', dom
=self
)
64 def fsFreeze(self
, mountpoints
=None, flags
=0):
65 """Freeze specified filesystems within the guest """
66 ret
= libvirtmod
.virDomainFSFreeze(self
._o
, mountpoints
, flags
)
67 if ret
== -1: raise libvirtError ('virDomainFSFreeze() failed', dom
=self
)
70 def fsThaw(self
, mountpoints
=None, flags
=0):
71 """Thaw specified filesystems within the guest """
72 ret
= libvirtmod
.virDomainFSThaw(self
._o
, mountpoints
, flags
)
73 if ret
== -1: raise libvirtError ('virDomainFSThaw() failed', dom
=self
)
76 def getTime(self
, flags
=0):
77 """Extract information about guest time """
78 ret
= libvirtmod
.virDomainGetTime(self
._o
, flags
)
79 if ret
== None: raise libvirtError ('virDomainGetTime() failed', dom
=self
)
82 def setTime(self
, time
=None, flags
=0):
83 """Set guest time to the given value. @time is a dict containing
84 'seconds' field for seconds and 'nseconds' field for nanoseconds """
85 ret
= libvirtmod
.virDomainSetTime(self
._o
, time
, flags
)
86 if ret
== -1: raise libvirtError ('virDomainSetTime() failed', dom
=self
)