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 createWithFiles(self
, files
, flags
=0):
15 """Launch a defined domain. If the call succeeds the domain moves from the
16 defined to the running domains pools.
18 @files provides an array of file descriptors which will be
19 made available to the 'init' process of the guest. The file
20 handles exposed to the guest will be renumbered to start
21 from 3 (ie immediately following stderr). This is only
22 supported for guests which use container based virtualization
25 If the VIR_DOMAIN_START_PAUSED flag is set, or if the guest domain
26 has a managed save image that requested paused state (see
27 virDomainManagedSave()) the guest domain will be started, but its
28 CPUs will remain paused. The CPUs can later be manually started
29 using virDomainResume(). In all other cases, the guest domain will
32 If the VIR_DOMAIN_START_AUTODESTROY flag is set, the guest
33 domain will be automatically destroyed when the virConnectPtr
34 object is finally released. This will also happen if the
35 client application crashes / loses its connection to the
36 libvirtd daemon. Any domains marked for auto destroy will
37 block attempts at migration, save-to-file, or snapshots.
39 If the VIR_DOMAIN_START_BYPASS_CACHE flag is set, and there is a
40 managed save file for this domain (created by virDomainManagedSave()),
41 then libvirt will attempt to bypass the file system cache while restoring
42 the file, or fail if it cannot do so for the given system; this can allow
43 less pressure on file system cache, but also risks slowing loads from NFS.
45 If the VIR_DOMAIN_START_FORCE_BOOT flag is set, then any managed save
46 file for this domain is discarded, and the domain boots from scratch. """
47 ret
= libvirtmod
.virDomainCreateWithFiles(self
._o
, files
, flags
)
48 if ret
== -1: raise libvirtError ('virDomainCreateWithFiles() failed', dom
=self
)
51 def fsFreeze(self
, mountpoints
=None, flags
=0):
52 """Freeze specified filesystems within the guest """
53 ret
= libvirtmod
.virDomainFSFreeze(self
._o
, mountpoints
, flags
)
54 if ret
== -1: raise libvirtError ('virDomainFSFreeze() failed', dom
=self
)
57 def fsThaw(self
, mountpoints
=None, flags
=0):
58 """Thaw specified filesystems within the guest """
59 ret
= libvirtmod
.virDomainFSThaw(self
._o
, mountpoints
, flags
)
60 if ret
== -1: raise libvirtError ('virDomainFSThaw() failed', dom
=self
)
63 def getTime(self
, flags
=0):
64 """Extract information about guest time """
65 ret
= libvirtmod
.virDomainGetTime(self
._o
, flags
)
66 if ret
== -1: raise libvirtError ('virDomainGetTime() failed', dom
=self
)
69 def setTime(self
, time
=None, flags
=0):
70 """Set guest time to the given value. @time is a dict containing
71 'seconds' field for seconds and 'nseconds' field for nanoseconds """
72 ret
= libvirtmod
.virDomainSetTime(self
._o
, time
, flags
)
73 if ret
== -1: raise libvirtError ('virDomainSetTime() failed', dom
=self
)