## GVirDomain GVirDomain |

## Synopsis

    struct              GVirDomain;
    struct              GVirDomainClass;
    enum                GVirDomainState;
    enum                GVirDomainStartFlags;
    enum                GVirDomainDeleteFlags;
    enum                GVirDomainXMLFlags;
    enum                GVirDomainShutdownFlags;
    enum                GVirDomainSnapshotCreateFlags;
    enum                GVirDomainUpdateDeviceFlags;
    enum                GVirDomainRebootFlags;
    struct              GVirDomainInfo;
    const gchar *       gvir_domain_get_name                (GVirDomain *dom);
    const gchar *       gvir_domain_get_uuid                (GVirDomain *dom);
    gint                gvir_domain_get_id                  (GVirDomain *dom,
                                                             GError **err);
    gboolean            gvir_domain_start                   (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);
    void                gvir_domain_start_async             (GVirDomain *dom,
                                                             guint flags,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            gvir_domain_start_finish            (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);
    gboolean            gvir_domain_resume                  (GVirDomain *dom,
                                                             GError **err);
    void                gvir_domain_resume_async            (GVirDomain *dom,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            gvir_domain_resume_finish           (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);
    gboolean            gvir_domain_wakeup                  (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);
    void                gvir_domain_wakeup_async            (GVirDomain *dom,
                                                             guint flags,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            gvir_domain_wakeup_finish           (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);
    gboolean            gvir_domain_stop                    (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);
    gboolean            gvir_domain_delete                  (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);
    gboolean            gvir_domain_shutdown                (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);
    gboolean            gvir_domain_reboot                  (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);
    gboolean            gvir_domain_save_to_file            (GVirDomain *dom,
                                                             gchar *filename,
                                                             GVirConfigDomain *custom_conf,
                                                             guint flags,
                                                             GError **err);
    void                gvir_domain_save_to_file_async      (GVirDomain *dom,
                                                             gchar *filename,
                                                             GVirConfigDomain *custom_conf,
                                                             guint flags,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            gvir_domain_save_to_file_finish     (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);
    GVirDomainInfo *    gvir_domain_get_info                (GVirDomain *dom,
                                                             GError **err);
    void                gvir_domain_get_info_async          (GVirDomain *dom,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    GVirDomainInfo *    gvir_domain_get_info_finish         (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);
    GVirConfigDomain *  gvir_domain_get_config              (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);
    gboolean            gvir_domain_set_config              (GVirDomain *domain,
                                                             GVirConfigDomain *conf,
                                                             GError **err);
    gchar *             gvir_domain_screenshot              (GVirDomain *dom,
                                                             GVirStream *stream,
                                                             guint monitor_id,
                                                             guint flags,
                                                             GError **err);
    gboolean            gvir_domain_open_console            (GVirDomain *dom,
                                                             GVirStream *stream,
                                                             const gchar *devname,
                                                             guint flags,
                                                             GError **err);
    gboolean            gvir_domain_open_graphics           (GVirDomain *dom,
                                                             guint idx,
                                                             int fd,
                                                             unsigned int flags,
                                                             GError **err);
    gboolean            gvir_domain_suspend                 (GVirDomain *dom,
                                                             GError **err);
    gboolean            gvir_domain_save                    (GVirDomain *dom,
                                                             unsigned int flags,
                                                             GError **err);
    void                gvir_domain_save_async              (GVirDomain *dom,
                                                             unsigned int flags,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            gvir_domain_save_finish             (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);
    gboolean            gvir_domain_get_persistent          (GVirDomain *dom);
    gboolean            gvir_domain_get_saved               (GVirDomain *dom);
    GList *             gvir_domain_get_devices             (GVirDomain *domain,
                                                             GError **err);
    gboolean            gvir_domain_update_device           (GVirDomain *dom,
                                                             GVirConfigDomainDevice *device,
                                                             guint flags,
                                                             GError **err);
    GVirDomainSnapshot * gvir_domain_create_snapshot        (GVirDomain *dom,
                                                             GVirConfigDomainSnapshot *custom_conf,
                                                             guint flags,
                                                             GError **err);

## Object Hierarchy

      GObject
       +----GVirDomain

      GBoxed
       +----GVirDomainInfo

## Properties

      "handle"                   GVirDomainHandle*     : Read / Write / Construct Only
      "persistent"               gboolean              : Read

## Signals

      "pmsuspended"                                    : No Hooks
      "resumed"                                        : No Hooks
      "started"                                        : No Hooks
      "stopped"                                        : No Hooks
      "suspended"                                      : No Hooks
      "updated"                                        : No Hooks

## Description

## Details

### struct GVirDomain

    struct GVirDomain;

### struct GVirDomainClass

    struct GVirDomainClass {
        GObjectClass parent_class;

        /* signals */
        void (*started)(GVirDomain *dom);
        void (*stopped)(GVirDomain *dom);
        void (*resumed)(GVirDomain *dom);
        void (*updated)(GVirDomain *dom);
        void (*suspended)(GVirDomain *dom);
        void (*pmsuspended)(GVirDomain *dom);

        gpointer padding[19];
    };

### enum GVirDomainState

    typedef enum {
        GVIR_DOMAIN_STATE_NONE    = 0,     /* no state */
        GVIR_DOMAIN_STATE_RUNNING = 1,     /* the domain is running */
        GVIR_DOMAIN_STATE_BLOCKED = 2,     /* the domain is blocked on resource */
        GVIR_DOMAIN_STATE_PAUSED  = 3,     /* the domain is paused by user */
        GVIR_DOMAIN_STATE_SHUTDOWN= 4,     /* the domain is being shut down */
        GVIR_DOMAIN_STATE_SHUTOFF = 5,     /* the domain is shut off */
        GVIR_DOMAIN_STATE_CRASHED = 6,     /* the domain is crashed */
        GVIR_DOMAIN_STATE_PMSUSPENDED = 7  /* the domain is suspended by guest
                                              power management */
    } GVirDomainState;

`GVIR_DOMAIN_STATE_NONE` |
`GVIR_DOMAIN_STATE_RUNNING` |
`GVIR_DOMAIN_STATE_BLOCKED` |
`GVIR_DOMAIN_STATE_PAUSED` |
`GVIR_DOMAIN_STATE_SHUTDOWN` |
`GVIR_DOMAIN_STATE_SHUTOFF` |
`GVIR_DOMAIN_STATE_CRASHED` |
`GVIR_DOMAIN_STATE_PMSUSPENDED` |

### enum GVirDomainStartFlags

    typedef enum {
        GVIR_DOMAIN_START_NONE         = 0,
        GVIR_DOMAIN_START_PAUSED       = (1 << 0),
        GVIR_DOMAIN_START_AUTODESTROY  = (1 << 1),
        GVIR_DOMAIN_START_BYPASS_CACHE = (1 << 2),
        GVIR_DOMAIN_START_FORCE_BOOT   = (1 << 3),
    } GVirDomainStartFlags;

`GVIR_DOMAIN_START_NONE` |
`GVIR_DOMAIN_START_PAUSED` |
`GVIR_DOMAIN_START_AUTODESTROY` |
`GVIR_DOMAIN_START_BYPASS_CACHE` |
`GVIR_DOMAIN_START_FORCE_BOOT` |

### enum GVirDomainDeleteFlags

    typedef enum {
        GVIR_DOMAIN_DELETE_NONE               = 0,
        GVIR_DOMAIN_DELETE_SAVED_STATE        = VIR_DOMAIN_UNDEFINE_MANAGED_SAVE,
        GVIR_DOMAIN_DELETE_SNAPSHOTS_METADATA = VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA,
    } GVirDomainDeleteFlags;

`GVIR_DOMAIN_DELETE_NONE` | No flags
`GVIR_DOMAIN_DELETE_SAVED_STATE` | Also remove associated saved state (if present).
`GVIR_DOMAIN_DELETE_SNAPSHOTS_METADATA` | If last use of domain, then also remove any snapshot metadata.

### enum GVirDomainXMLFlags

    typedef enum {
        GVIR_DOMAIN_XML_NONE            = 0,
        GVIR_DOMAIN_XML_SECURE          = VIR_DOMAIN_XML_SECURE,
        GVIR_DOMAIN_XML_INACTIVE        = VIR_DOMAIN_XML_INACTIVE,
        GVIR_DOMAIN_XML_UPDATE_CPU      = VIR_DOMAIN_XML_UPDATE_CPU,
    } GVirDomainXMLFlags;

`GVIR_DOMAIN_XML_NONE` | No flags
`GVIR_DOMAIN_XML_SECURE` | Dump security sensitive information too
`GVIR_DOMAIN_XML_INACTIVE` | Dump inactive domain information
`GVIR_DOMAIN_XML_UPDATE_CPU` | Update guest CPU requirements according to host CPU

### enum GVirDomainShutdownFlags

    typedef enum {
        GVIR_DOMAIN_SHUTDOWN_NONE           = 0,
        GVIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN = VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN,
        GVIR_DOMAIN_SHUTDOWN_GUEST_AGENT    = VIR_DOMAIN_SHUTDOWN_GUEST_AGENT,
    } GVirDomainShutdownFlags;

`GVIR_DOMAIN_SHUTDOWN_NONE` | No flags, hypervisor choice
`GVIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN` | Send ACPI event
`GVIR_DOMAIN_SHUTDOWN_GUEST_AGENT` | Use guest agent

### enum GVirDomainSnapshotCreateFlags

    typedef enum {
        GVIR_DOMAIN_SNAPSHOT_NONE         = 0,
        GVIR_DOMAIN_SNAPSHOT_REDEFINE     = VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE,
        GVIR_DOMAIN_SNAPSHOT_CURRENT      = VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT,
        GVIR_DOMAIN_SNAPSHOT_NO_METADATA  = VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA,
        GVIR_DOMAIN_SNAPSHOT_HALT         = VIR_DOMAIN_SNAPSHOT_CREATE_HALT,
        GVIR_DOMAIN_SNAPSHOT_DISK_ONLY    = VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY,
        GVIR_DOMAIN_SNAPSHOT_REUSE_EXT    = VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT,
        GVIR_DOMAIN_SNAPSHOT_QUIESCE      = VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE,
        GVIR_DOMAIN_SNAPSHOT_ATOMIC       = VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC,
    } GVirDomainSnapshotCreateFlags;

`GVIR_DOMAIN_SNAPSHOT_NONE` | No flags
`GVIR_DOMAIN_SNAPSHOT_REDEFINE` | Restore or alter metadata
`GVIR_DOMAIN_SNAPSHOT_CURRENT` | With redefine, make snapshot current
`GVIR_DOMAIN_SNAPSHOT_NO_METADATA` | Make snapshot without remembering it
`GVIR_DOMAIN_SNAPSHOT_HALT` | Stop running guest after snapshot
`GVIR_DOMAIN_SNAPSHOT_DISK_ONLY` | Disk snapshot, not system checkpoint
`GVIR_DOMAIN_SNAPSHOT_REUSE_EXT` | Reuse any existing external files
`GVIR_DOMAIN_SNAPSHOT_QUIESCE` | Use guest agent to quiesce all mounter file systems within the domain
`GVIR_DOMAIN_SNAPSHOT_ATOMIC` | Atomically avoid partial changes

### enum GVirDomainUpdateDeviceFlags

    typedef enum {
        GVIR_DOMAIN_UPDATE_DEVICE_CURRENT   = VIR_DOMAIN_AFFECT_CURRENT,
        GVIR_DOMAIN_UPDATE_DEVICE_LIVE      = VIR_DOMAIN_AFFECT_LIVE,
        GVIR_DOMAIN_UPDATE_DEVICE_CONFIG    = VIR_DOMAIN_AFFECT_CONFIG,
    } GVirDomainUpdateDeviceFlags;

`GVIR_DOMAIN_UPDATE_DEVICE_CURRENT` | Update current domain state
`GVIR_DOMAIN_UPDATE_DEVICE_LIVE` | Update state for only active domains
`GVIR_DOMAIN_UPDATE_DEVICE_CONFIG` | Update state for persistent state only

### enum GVirDomainRebootFlags

    typedef enum {
        GVIR_DOMAIN_REBOOT_NONE           = 0,
        GVIR_DOMAIN_REBOOT_ACPI_POWER_BTN = VIR_DOMAIN_REBOOT_ACPI_POWER_BTN,
        GVIR_DOMAIN_REBOOT_GUEST_AGENT    = VIR_DOMAIN_REBOOT_GUEST_AGENT,
    } GVirDomainRebootFlags;

`GVIR_DOMAIN_REBOOT_NONE` | No flags, hypervisor choice
`GVIR_DOMAIN_REBOOT_ACPI_POWER_BTN` | Send ACPI event
`GVIR_DOMAIN_REBOOT_GUEST_AGENT` | Use guest agent

### struct GVirDomainInfo

    struct GVirDomainInfo {
        GVirDomainState state; /* the running state */
        guint64 maxMem;        /* the maximum memory in KBytes allowed */
        guint64 memory;        /* the memory in KBytes used by the domain */
        guint16 nrVirtCpu;     /* the number of virtual CPUs for the domain */
        guint64 cpuTime;       /* the CPU time used in nanoseconds */
    };

### gvir_domain_get_name ()

    const gchar *       gvir_domain_get_name                (GVirDomain *dom);

### gvir_domain_get_uuid ()

    const gchar *       gvir_domain_get_uuid                (GVirDomain *dom);

### gvir_domain_get_id ()

    gint                gvir_domain_get_id                  (GVirDomain *dom,
                                                             GError **err);

### gvir_domain_start ()

    gboolean            gvir_domain_start                   (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);

`dom` : | the domain
`flags` : | the flags

### gvir_domain_start_async ()

    void                gvir_domain_start_async             (GVirDomain *dom,
                                                             guint flags,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronous variant of gvir_domain_start.

`dom` : | the domain
`flags` : | the flags
`cancellable` : | cancellation object. [allow-none][transfer none]
`callback` : | completion callback. [scope async]
`user_data` : | opaque data for callback. [closure]

### gvir_domain_start_finish ()

    gboolean            gvir_domain_start_finish            (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);

### gvir_domain_resume ()

    gboolean            gvir_domain_resume                  (GVirDomain *dom,
                                                             GError **err);

`dom` : | the domain
`err` : | Place-holder for possible errors
Returns : | TRUE on success

### gvir_domain_resume_async ()

    void                gvir_domain_resume_async            (GVirDomain *dom,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronous variant of gvir_domain_resume.

`dom` : | the domain to resume
`cancellable` : | cancellation object. [allow-none][transfer none]
`callback` : | completion callback. [scope async]
`user_data` : | opaque data for callback. [closure]

### gvir_domain_resume_finish ()

    gboolean            gvir_domain_resume_finish           (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);

### gvir_domain_wakeup ()

    gboolean            gvir_domain_wakeup                  (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);

`dom` : | the domain
`flags` : | placeholder for flags, pass 0
`err` : | Place-holder for possible errors
Returns : | TRUE on success

### gvir_domain_wakeup_async ()

    void                gvir_domain_wakeup_async            (GVirDomain *dom,
                                                             guint flags,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronous variant of gvir_domain_wakeup.

`dom` : | the domain to wakeup
`flags` : | placeholder for flags, pass 0
`cancellable` : | cancellation object. [allow-none][transfer none]
`callback` : | completion callback. [scope async]
`user_data` : | opaque data for callback. [closure]

### gvir_domain_wakeup_finish ()

    gboolean            gvir_domain_wakeup_finish           (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);

### gvir_domain_stop ()

    gboolean            gvir_domain_stop                    (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);

`dom` : | the domain
`flags` : | the flags

### gvir_domain_delete ()

    gboolean            gvir_domain_delete                  (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);

`dom` : | the domain
`flags` : | the flags

### gvir_domain_shutdown ()

    gboolean            gvir_domain_shutdown                (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);

`dom` : | the domain
`flags` : | the `GVirDomainShutdownFlags` flags

### gvir_domain_reboot ()

    gboolean            gvir_domain_reboot                  (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);

`dom` : | the domain
`flags` : | the `GVirDomainRebootFlags` flags

### gvir_domain_save_to_file ()

    gboolean            gvir_domain_save_to_file            (GVirDomain *dom,
                                                             gchar *filename,
                                                             GVirConfigDomain *custom_conf,
                                                             guint flags,
                                                             GError **err);

`dom` : | the domain
`filename` : | path to the output file
`custom_conf` : | configuration for domain or NULL. [allow-none]
`flags` : | the flags
Returns : | TRUE on success, FALSE otherwise

### gvir_domain_save_to_file_async ()

    void                gvir_domain_save_to_file_async      (GVirDomain *dom,
                                                             gchar *filename,
                                                             GVirConfigDomain *custom_conf,
                                                             guint flags,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronous variant of gvir_domain_save_to_file

`dom` : | the domain
`filename` : | path to output file
`custom_conf` : | configuration for domain or NULL. [allow-none]
`flags` : | the flags
`cancellable` : | cancallation object. [allow-none][transfer none]
`callback` : | completion callback. [scope async]
`user_data` : | opaque data for callback. [closure]

### gvir_domain_save_to_file_finish ()

    gboolean            gvir_domain_save_to_file_finish     (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);

Finishes the operation started by gvir_domain_save_to_file_async.

`dom` : | the domain to save
`result` : | async method result. [transfer none]
`err` : | Place-holder for possible errors
Returns : | TRUE if domain was saved successfully, FALSE otherwise.

### gvir_domain_get_info ()

    GVirDomainInfo *    gvir_domain_get_info                (GVirDomain *dom,
                                                             GError **err);

`dom` : | the domain
Returns : | the info. The returned structure should be freed using #`g_boxed_free()` with GVIR_TYPE_DOMAIN_INFO as the first argument when no longer needed. [transfer full]

### gvir_domain_get_info_async ()

    void                gvir_domain_get_info_async          (GVirDomain *dom,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronous variant of gvir_domain_get_info.

`dom` : | the domain
`cancellable` : | cancellation object. [allow-none][transfer none]
`callback` : | completion callback. [scope async]
`user_data` : | opaque data for callback. [closure]

### gvir_domain_get_info_finish ()

    GVirDomainInfo *    gvir_domain_get_info_finish         (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);

Finishes the operation started by gvir_domain_get_info_async.

`dom` : | the domain
`result` : | async method result. [transfer none]
`err` : | Place-holder for possible errors
Returns : | the info. The returned object should be unreffed with `g_object_unref()` when no longer needed. [transfer full]

### gvir_domain_get_config ()

    GVirConfigDomain *  gvir_domain_get_config              (GVirDomain *dom,
                                                             guint flags,
                                                             GError **err);

`dom` : | the domain
`flags` : | the `GVirDomainXMLFlags` flags
Returns : | the config. The returned object should be unreffed with `g_object_unref()` when no longer needed. [transfer full]

### gvir_domain_set_config ()

    gboolean            gvir_domain_set_config              (GVirDomain *domain,
                                                             GVirConfigDomain *conf,
                                                             GError **err);

Resets configuration of an existing domain.

Note: If domain is already running, the new configuration will not take affect until domain reboots.

`domain` : | the domain
`conf` : | the new configuration for the domain
`err` : | Place-holder for error or NULL. [allow-none]
Returns : | TRUE on success, FALSE if an error occurred.

### gvir_domain_screenshot ()

    gchar *             gvir_domain_screenshot              (GVirDomain *dom,
                                                             GVirStream *stream,
                                                             guint monitor_id,
                                                             guint flags,
                                                             GError **err);

`stream` : | stream to use as output
`monitor_id` : | monitor ID to take screenshot from
`flags` : | extra flags, currently unused
Returns : | a newly allocated string containing the mime-type of the image format, or NULL upon error. [transfer full]

### gvir_domain_open_console ()

    gboolean            gvir_domain_open_console            (GVirDomain *dom,
                                                             GVirStream *stream,
                                                             const gchar *devname,
                                                             guint flags,
                                                             GError **err);

Open a text console for the domain `dom`, connecting it to the stream `stream`. If `devname` is NULL, the default console will be opened, otherwise `devname` can be used to specify a non-default console device.

`dom` : | the domain. [transfer none]
`devname` : | the device name. [transfer none][allow-none]
`stream` : | stream to use as output. [transfer none]
`flags` : | extra flags, currently unused
Returns : | TRUE if the console was opened, FALSE otherwise.

### gvir_domain_open_graphics ()

    gboolean            gvir_domain_open_graphics           (GVirDomain *dom,
                                                             guint idx,
                                                             int fd,
                                                             unsigned int flags,
                                                             GError **err);

Open a connection to the local graphics display, connecting it to the socket pair file descriptor passed in as `fd`.

`dom` : | the domain
`idx` : | the graphics index
`fd` : | pre-opened socket pair
`flags` : | extra flags, currently unused
Returns : | TRUE if the graphics connection was opened, FALSE otherwise.

### gvir_domain_suspend ()

    gboolean            gvir_domain_suspend                 (GVirDomain *dom,
                                                             GError **err);

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 `gvir_domain_resume()` to reactivate the domain.

`dom` : | the domain to suspend
`err` : | Place-holder for possible errors
Returns : | TRUE if domain was suspended successfully, FALSE otherwise.

### gvir_domain_save ()

    gboolean            gvir_domain_save                    (GVirDomain *dom,
                                                             unsigned int flags,
                                                             GError **err);

Saves the state of the domain on disk and stops it. Use gvir_domain_start to restore the saved state of the domain. A saved domain can be restored even after shutdown/reboot of host machine.

`dom` : | the domain to save
`flags` : | extra flags, currently unused
`err` : | Place-holder for possible errors
Returns : | TRUE if domain was saved successfully, FALSE otherwise.

### gvir_domain_save_async ()

    void                gvir_domain_save_async              (GVirDomain *dom,
                                                             unsigned int flags,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronous variant of gvir_domain_save.

`dom` : | the domain to save
`flags` : | extra flags, currently unused
`cancellable` : | cancellation object. [allow-none][transfer none]
`callback` : | completion callback. [scope async]
`user_data` : | opaque data for callback. [closure]

### gvir_domain_save_finish ()

    gboolean            gvir_domain_save_finish             (GVirDomain *dom,
                                                             GAsyncResult *result,
                                                             GError **err);

Finishes the operation started by gvir_domain_save_async.

`dom` : | the domain to save
`result` : | async method result. [transfer none]
`err` : | Place-holder for possible errors
Returns : | TRUE if domain was saved successfully, FALSE otherwise.

### gvir_domain_get_persistent ()

    gboolean            gvir_domain_get_persistent          (GVirDomain *dom);

`dom` : | the domain
Returns : | TRUE if domain is persistent, FALSE otherwise.

### gvir_domain_get_saved ()

    gboolean            gvir_domain_get_saved               (GVirDomain *dom);

`dom` : | the domain
Returns : | TRUE if a stopped domain has a saved state to which it can be restored to using gvir_domain_start, FALSE otherwise.

### gvir_domain_get_devices ()

    GList *             gvir_domain_get_devices             (GVirDomain *domain,
                                                             GError **err);

Gets the list of devices attached to `domain`. The returned list should be freed with `g_list_free()`, after its elements have been unreffed with `g_object_unref()`.

`domain` : | the domain
`err` : | place-holder for possible errors, or NULL
Returns : | a newly allocated GList of GVirDomainDevice. [element-type LibvirtGObject.DomainDevice][transfer full]

### gvir_domain_update_device ()

    gboolean            gvir_domain_update_device           (GVirDomain *dom,
                                                             GVirConfigDomainDevice *device,
                                                             guint flags,
                                                             GError **err);

Update the configuration of a device.

`dom` : | the domain
`device` : | A modified device config
`flags` : | bitwise-OR of GVirDomainUpdateDeviceFlags
`err` : | Place-holder for error or NULL. [allow-none]
Returns : | TRUE if device was updated successfully, FALSE otherwise.

### gvir_domain_create_snapshot ()

    GVirDomainSnapshot * gvir_domain_create_snapshot        (GVirDomain *dom,
                                                             GVirConfigDomainSnapshot *custom_conf,
                                                             guint flags,
                                                             GError **err);

`dom` : | the domain
`custom_conf` : | configuration of snapshot or NULL. [allow-none]
`flags` : | bitwise-OR of GVirDomainSnapshotCreateFlags
`err` : | Place-holder for error or NULL. [allow-none]
Returns : | snapshot of domain. The returned object should be unreffed when no longer needed. [transfer full]

## Property Details

### The `"handle"` property

      "handle"                   GVirDomainHandle*     : Read / Write / Construct Only

The domain handle.

### The `"persistent"` property

      "persistent"               gboolean              : Read

If domain is persistent.

Default value: TRUE

## Signal Details

### The `"pmsuspended"` signal

    void                user_function                      (GVirDomain *gvirdomain,
                                                            gpointer    user_data)       : No Hooks

### The `"resumed"` signal

    void                user_function                      (GVirDomain *gvirdomain,
                                                            gpointer    user_data)       : No Hooks

### The `"started"` signal

    void                user_function                      (GVirDomain *gvirdomain,
                                                            gpointer    user_data)       : No Hooks

### The `"stopped"` signal

    void                user_function                      (GVirDomain *gvirdomain,
                                                            gpointer    user_data)       : No Hooks

### The `"suspended"` signal

    void                user_function                      (GVirDomain *gvirdomain,
                                                            gpointer    user_data)       : No Hooks

### The `"updated"` signal

    void                user_function                      (GVirDomain *gvirdomain,
                                                            gpointer    user_data)       : No Hooks