LibvirtGObject.Domain¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
The domain handle |
||
r |
If domain is persistent |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class LibvirtGObject.Domain(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- create_snapshot(custom_conf, flags)¶
- Parameters:
custom_conf (
LibvirtGConfig.DomainSnapshotorNone) – configuration of snapshot orNoneflags (
int) – bitwise-OR ofLibvirtGObject.DomainSnapshotCreateFlags
- Raises:
- Returns:
snapshot of domain. The returned object should be unreffed when no longer needed
- Return type:
- create_snapshot_async(custom_conf, flags, cancellable, callback, *user_data)¶
- Parameters:
custom_conf (
LibvirtGConfig.DomainSnapshotorNone) – Configuration of snapshot orNoneflags (
int) – Bitwise-OR ofLibvirtGObject.DomainSnapshotCreateFlagscancellable (
Gio.CancellableorNone) – cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – Completion callback
- create_snapshot_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – Async method result- Raises:
- Returns:
The created snapshot
- Return type:
- fetch_snapshots(list_flags, cancellable)¶
- Parameters:
list_flags (
int) – bitwise-OR ofLibvirtGObject.DomainSnapshotListFlagscancellable (
Gio.CancellableorNone) – cancellation object
- Raises:
- Returns:
- Return type:
- fetch_snapshots_async(list_flags, cancellable, callback, *user_data)¶
- Parameters:
list_flags (
int) – bitwise-OR ofLibvirtGObject.DomainSnapshotListFlagscancellable (
Gio.CancellableorNone) – cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – completion callback
- fetch_snapshots_finish(res)¶
- Parameters:
res (
Gio.AsyncResult) – async method result- Raises:
- Returns:
- Return type:
- get_config(flags)¶
- Parameters:
flags (
int) – theLibvirtGObject.DomainXMLFlagsflags- Raises:
- Returns:
the config. The returned object should be unreffed with
GObject.Object.unref() when no longer needed.- Return type:
- get_devices()¶
- Raises:
- Returns:
a newly allocated
GLib.ListofLibvirtGObject.DomainDevice.- Return type:
Gets the list of devices attached to self. The returned list should be freed with g_list_free(), after its elements have been unreffed with
GObject.Object.unref().
- get_has_current_snapshot(flags)¶
- get_id()¶
- Raises:
- Return type:
- get_info()¶
- Raises:
- Returns:
the info. The returned structure should be freed using
GObject.boxed_free() with GVIR_TYPE_DOMAIN_INFO as the first argument when no longer needed.- Return type:
- get_info_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – completion callback
Asynchronous variant of
LibvirtGObject.Domain.get_info.
- get_info_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – async method result- Raises:
- Returns:
the info. The returned object should be unreffed with
GObject.Object.unref() when no longer needed.- Return type:
Finishes the operation started by
LibvirtGObject.Domain.get_info_async.
- get_saved()¶
- Returns:
Trueif a stopped domain has a saved state to which it can be restored to usingLibvirtGObject.Domain.start,Falseotherwise.- Return type:
- get_snapshots()¶
- Returns:
A list of all the snapshots available for the given domain. The returned list should be freed with g_list_free(), after its elements have been unreffed with
GObject.Object.unref().- Return type:
- open_console(stream, devname, flags)¶
- Parameters:
stream (
LibvirtGObject.Stream) – stream to use as outputflags (
int) – extra flags, currently unused
- Raises:
- Returns:
- Return type:
Open a text console for the domain self, connecting it to the stream stream. If devname is
None, the default console will be opened, otherwise devname can be used to specify a non-default console device.
- open_graphics(idx, fd, flags)¶
- Parameters:
- Raises:
- Returns:
Trueif the graphics connection was opened,Falseotherwise.- Return type:
Open a connection to the local graphics display, connecting it to the socket pair file descriptor passed in as fd.
- open_graphics_fd(idx, flags)¶
- Parameters:
- Raises:
- Returns:
An fd on success, -1 on failure.
- Return type:
This will create a socket pair connected to the graphics backend of self. One end of the socket will be returned on success, and the other end is handed to the hypervisor. If self has multiple graphics backends configured, then idx will determine which one is opened, starting from idx 0.
New in version 0.2.0.
- reboot(flags)¶
- Parameters:
flags (
int) – theLibvirtGObject.DomainRebootFlagsflags- Raises:
- Return type:
- resume_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – completion callback
Asynchronous variant of
LibvirtGObject.Domain.resume.
- resume_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) –- Raises:
- Return type:
- save(flags)¶
- Parameters:
flags (
int) – extra flags, currently unused- Raises:
- Returns:
- Return type:
Saves the state of the domain on disk and stops it. Use
LibvirtGObject.Domain.startto restore the saved state of the domain. A saved domain can be restored even after shutdown/reboot of host machine.
- save_async(flags, cancellable, callback, *user_data)¶
- Parameters:
flags (
int) – extra flags, currently unusedcancellable (
Gio.CancellableorNone) – cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – completion callback
Asynchronous variant of
LibvirtGObject.Domain.save.
- save_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – async method result- Raises:
- Returns:
- Return type:
Finishes the operation started by
LibvirtGObject.Domain.save_async.
- save_to_file(filename, custom_conf, flags)¶
- Parameters:
filename (
str) – path to the output filecustom_conf (
LibvirtGConfig.DomainorNone) – configuration for domain orNoneflags (
int) – the flags
- Raises:
- Returns:
- Return type:
- save_to_file_async(filename, custom_conf, flags, cancellable, callback, *user_data)¶
- Parameters:
filename (
str) – path to output filecustom_conf (
LibvirtGConfig.DomainorNone) – configuration for domain orNoneflags (
int) – the flagscancellable (
Gio.CancellableorNone) – cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – completion callback
Asynchronous variant of
LibvirtGObject.Domain.save_to_file
- save_to_file_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – async method result- Raises:
- Returns:
- Return type:
Finishes the operation started by
LibvirtGObject.Domain.save_to_file_async.
- screenshot(stream, monitor_id, flags)¶
- Parameters:
stream (
LibvirtGObject.Stream) – stream to use as outputmonitor_id (
int) – monitor ID to take screenshot fromflags (
int) – extra flags, currently unused
- Raises:
- Returns:
a newly allocated string containing the mime-type of the image format, or
Noneupon error.- Return type:
- set_config(conf)¶
- Parameters:
conf (
LibvirtGConfig.Domain) – the new configuration for the domain- Raises:
- Returns:
- Return type:
Resets configuration of an existing domain.
Note: If domain is already running, the new configuration will not take affect until domain reboots.
- set_time(date_time, flags)¶
- Parameters:
date_time (
GLib.DateTimeorNone) – the time to set asGLib.DateTime.flags (
int) – Unused, pass 0.
- Raises:
- Returns:
- Return type:
This function tries to set guest time to the given value. The passed time must in UTC.
If date_time is
None, the time is reset using the domain’s RTC.Please note that some hypervisors may require guest agent to be configured and running in order for this function to work.
- set_time_async(date_time, flags, cancellable, callback, *user_data)¶
- Parameters:
date_time (
GLib.DateTimeorNone) – the time to set asGLib.DateTime.flags (
int) – bitwise-OR of #GVirDomainSetTimeFlags.cancellable (
Gio.CancellableorNone) – cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – completion callback
Asynchronous variant of
LibvirtGObject.Domain.set_time.
- set_time_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – async method result- Raises:
- Returns:
- Return type:
Finishes the operation started by
LibvirtGObject.Domain.set_time_async.
- shutdown(flags)¶
- Parameters:
flags (
int) – theLibvirtGObject.DomainShutdownFlagsflags- Raises:
- Return type:
- start_async(flags, cancellable, callback, *user_data)¶
- Parameters:
flags (
int) – the flagscancellable (
Gio.CancellableorNone) – cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – completion callback
Asynchronous variant of
LibvirtGObject.Domain.start.
- start_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) –- Raises:
- Return type:
- suspend()¶
- Raises:
- Returns:
- Return type:
Suspends an active domain, the process is frozen without further access to CPU resources and I/O but the memory used by the domain at the hypervisor level will stay allocated. Use
LibvirtGObject.Domain.resume() to reactivate the domain.
- update_device(device, flags)¶
- Parameters:
device (
LibvirtGConfig.DomainDevice) – A modified device configflags (
int) – bitwise-OR ofLibvirtGObject.DomainUpdateDeviceFlags
- Raises:
- Returns:
- Return type:
Update the configuration of a device.
- wakeup(flags)¶
- wakeup_async(flags, cancellable, callback, *user_data)¶
- Parameters:
flags (
int) – placeholder for flags, pass 0cancellable (
Gio.CancellableorNone) – cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – completion callback
Asynchronous variant of
LibvirtGObject.Domain.wakeup.
- wakeup_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) –- Raises:
- Return type:
- do_pmsuspended() virtual¶
- do_resumed() virtual¶
- do_started() virtual¶
- do_stopped() virtual¶
- do_suspended() virtual¶
- do_updated() virtual¶
Signal Details¶
- LibvirtGObject.Domain.signals.pmsuspended(domain)¶
- Signal Name:
pmsuspended- Flags:
- Parameters:
domain (
LibvirtGObject.Domain) – The object which received the signal
- LibvirtGObject.Domain.signals.resumed(domain)¶
- Signal Name:
resumed- Flags:
- Parameters:
domain (
LibvirtGObject.Domain) – The object which received the signal
- LibvirtGObject.Domain.signals.started(domain)¶
- Signal Name:
started- Flags:
- Parameters:
domain (
LibvirtGObject.Domain) – The object which received the signal
- LibvirtGObject.Domain.signals.stopped(domain)¶
- Signal Name:
stopped- Flags:
- Parameters:
domain (
LibvirtGObject.Domain) – The object which received the signal
- LibvirtGObject.Domain.signals.suspended(domain)¶
- Signal Name:
suspended- Flags:
- Parameters:
domain (
LibvirtGObject.Domain) – The object which received the signal
- LibvirtGObject.Domain.signals.updated(domain)¶
- Signal Name:
updated- Flags:
- Parameters:
domain (
LibvirtGObject.Domain) – The object which received the signal
Property Details¶
- LibvirtGObject.Domain.props.handle¶
- Name:
handle- Type:
- Default Value:
- Flags:
The domain handle