python: treat flags as default argument with value 0
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):
2013-03-21 08:27:09 +00:00
|
|
|
def listAllSnapshots(self, flags=0):
|
2012-06-09 15:55:36 +00:00
|
|
|
"""List all snapshots and returns a list of snapshot objects"""
|
|
|
|
ret = libvirtmod.virDomainListAllSnapshots(self._o, flags)
|
|
|
|
if ret is None:
|
|
|
|
raise libvirtError("virDomainListAllSnapshots() failed", conn=self)
|
|
|
|
|
|
|
|
retlist = list()
|
|
|
|
for snapptr in ret:
|
|
|
|
retlist.append(virDomainSnapshot(self, _obj=snapptr))
|
|
|
|
|
|
|
|
return retlist
|
Introduce new domain create APIs to pass pre-opened FDs to LXC
With container based virt, it is useful to be able to pass
pre-opened file descriptors to the container init process.
This allows for containers to be auto-activated from incoming
socket connections, passing the active socket into the container.
To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles
and virDomainCreateWithFiles, which accept an array of file
descriptors. For the LXC driver, UNIX file descriptor passing
will be used to send them to libvirtd, which will them pass
them down to libvirt_lxc, which will then pass them to the container
init process.
This will only be implemented for LXC right now, but the design
is generic enough it could work with other hypervisors, hence
I suggest adding this to libvirt.so, rather than libvirt-lxc.so
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-09 16:12:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
def createWithFiles(self, files, flags=0):
|
|
|
|
"""Launch a defined domain. If the call succeeds the domain moves from the
|
|
|
|
defined to the running domains pools.
|
|
|
|
|
|
|
|
@files provides an array of file descriptors which will be
|
|
|
|
made available to the 'init' process of the guest. The file
|
|
|
|
handles exposed to the guest will be renumbered to start
|
|
|
|
from 3 (ie immediately following stderr). This is only
|
|
|
|
supported for guests which use container based virtualization
|
|
|
|
technology.
|
|
|
|
|
|
|
|
If the VIR_DOMAIN_START_PAUSED flag is set, or if the guest domain
|
|
|
|
has a managed save image that requested paused state (see
|
|
|
|
virDomainManagedSave()) the guest domain will be started, but its
|
|
|
|
CPUs will remain paused. The CPUs can later be manually started
|
|
|
|
using virDomainResume(). In all other cases, the guest domain will
|
|
|
|
be running.
|
|
|
|
|
|
|
|
If the VIR_DOMAIN_START_AUTODESTROY flag is set, the guest
|
|
|
|
domain will be automatically destroyed when the virConnectPtr
|
|
|
|
object is finally released. This will also happen if the
|
|
|
|
client application crashes / loses its connection to the
|
|
|
|
libvirtd daemon. Any domains marked for auto destroy will
|
|
|
|
block attempts at migration, save-to-file, or snapshots.
|
|
|
|
|
|
|
|
If the VIR_DOMAIN_START_BYPASS_CACHE flag is set, and there is a
|
|
|
|
managed save file for this domain (created by virDomainManagedSave()),
|
|
|
|
then libvirt will attempt to bypass the file system cache while restoring
|
|
|
|
the file, or fail if it cannot do so for the given system; this can allow
|
|
|
|
less pressure on file system cache, but also risks slowing loads from NFS.
|
|
|
|
|
|
|
|
If the VIR_DOMAIN_START_FORCE_BOOT flag is set, then any managed save
|
|
|
|
file for this domain is discarded, and the domain boots from scratch. """
|
|
|
|
ret = libvirtmod.virDomainCreateWithFiles(self._o, files, flags)
|
|
|
|
if ret == -1: raise libvirtError ('virDomainCreateWithFiles() failed', dom=self)
|
|
|
|
return ret
|