## GVirConfigDomain GVirConfigDomain |

## Synopsis

    struct              GVirConfigDomain;
    struct              GVirConfigDomainClass;
    enum                GVirConfigDomainVirtType;
    enum                GVirConfigDomainLifecycleEvent;
    enum                GVirConfigDomainLifecycleAction;
    GVirConfigDomain *  gvir_config_domain_new_from_xml     (const gchar *xml,
                                                             GError **error);
    GVirConfigDomain *  gvir_config_domain_new              (void);
    GVirConfigDomainVirtType gvir_config_domain_get_virt_type
                                                            (GVirConfigDomain *domain);
    void                gvir_config_domain_set_virt_type    (GVirConfigDomain *domain,
                                                             GVirConfigDomainVirtType type);
    const char *        gvir_config_domain_get_name         (GVirConfigDomain *domain);
    void                gvir_config_domain_set_name         (GVirConfigDomain *domain,
                                                             const char *name);
    const char *        gvir_config_domain_get_description  (GVirConfigDomain *domain);
    void                gvir_config_domain_set_description  (GVirConfigDomain *domain,
                                                             const char *description);
    guint64             gvir_config_domain_get_memory       (GVirConfigDomain *domain);
    void                gvir_config_domain_set_memory       (GVirConfigDomain *domain,
                                                             guint64 memory);
    guint64             gvir_config_domain_get_current_memory
                                                            (GVirConfigDomain *domain);
    void                gvir_config_domain_set_current_memory
                                                            (GVirConfigDomain *domain,
                                                             guint64 memory);
    guint64             gvir_config_domain_get_vcpus        (GVirConfigDomain *domain);
    void                gvir_config_domain_set_vcpus        (GVirConfigDomain *domain,
                                                             guint64 vcpu_count);
    GStrv               gvir_config_domain_get_features     (GVirConfigDomain *domain);
    void                gvir_config_domain_set_features     (GVirConfigDomain *domain,
                                                             const GStrv features);
    void                gvir_config_domain_set_clock        (GVirConfigDomain *domain,
                                                             GVirConfigDomainClock *klock);
    GVirConfigDomainOs * gvir_config_domain_get_os          (GVirConfigDomain *domain);
    void                gvir_config_domain_set_os           (GVirConfigDomain *domain,
                                                             GVirConfigDomainOs *os);
    void                gvir_config_domain_set_seclabel     (GVirConfigDomain *domain,
                                                             GVirConfigDomainSeclabel *seclabel);
    const char *        gvir_config_domain_get_title        (GVirConfigDomain *domain);
    void                gvir_config_domain_set_title        (GVirConfigDomain *domain,
                                                             const char *title);
    void                gvir_config_domain_set_devices      (GVirConfigDomain *domain,
                                                             GList *devices);
    void                gvir_config_domain_add_device       (GVirConfigDomain *domain,
                                                             GVirConfigDomainDevice *device);
    GList *             gvir_config_domain_get_devices      (GVirConfigDomain *domain);
    void                gvir_config_domain_set_lifecycle    (GVirConfigDomain *domain,
                                                             GVirConfigDomainLifecycleEvent event,
                                                             GVirConfigDomainLifecycleAction action);
    gboolean            gvir_config_domain_set_custom_xml   (GVirConfigDomain *domain,
                                                             const gchar *xml,
                                                             const gchar *ns,
                                                             const gchar *ns_uri,
                                                             GError **error);
    gchar *             gvir_config_domain_get_custom_xml   (GVirConfigDomain *domain,
                                                             const gchar *ns_uri);
    GVirConfigDomainCpu * gvir_config_domain_get_cpu        (GVirConfigDomain *domain);
    void                gvir_config_domain_set_cpu          (GVirConfigDomain *domain,
                                                             GVirConfigDomainCpu *cpu);
    void                gvir_config_domain_set_power_management
                                                            (GVirConfigDomain *domain,
                                                             GVirConfigDomainPowerManagement *pm);

## Object Hierarchy

      GObject
       +----GVirConfigObject
             +----GVirConfigDomain

## Properties

      "current-memory"           guint64               : Read / Write
      "description"              gchar*                : Read / Write
      "features"                 GStrv                 : Read / Write
      "memory"                   guint64               : Read / Write
      "name"                     gchar*                : Read / Write
      "title"                    gchar*                : Read / Write
      "vcpu"                     guint64               : Read / Write

## Description

## Details

### struct GVirConfigDomain

    struct GVirConfigDomain;

### struct GVirConfigDomainClass

    struct GVirConfigDomainClass {
        GVirConfigObjectClass parent_class;

        gpointer padding[20];
    };

### enum GVirConfigDomainVirtType

    typedef enum {
        GVIR_CONFIG_DOMAIN_VIRT_QEMU,
        GVIR_CONFIG_DOMAIN_VIRT_KQEMU,
        GVIR_CONFIG_DOMAIN_VIRT_KVM,
        GVIR_CONFIG_DOMAIN_VIRT_XEN,
        GVIR_CONFIG_DOMAIN_VIRT_LXC,
        GVIR_CONFIG_DOMAIN_VIRT_UML,
        GVIR_CONFIG_DOMAIN_VIRT_OPENVZ,
        GVIR_CONFIG_DOMAIN_VIRT_VSERVER,
        GVIR_CONFIG_DOMAIN_VIRT_LDOM,
        GVIR_CONFIG_DOMAIN_VIRT_TEST,
        GVIR_CONFIG_DOMAIN_VIRT_VMWARE,
        GVIR_CONFIG_DOMAIN_VIRT_HYPERV,
        GVIR_CONFIG_DOMAIN_VIRT_VBOX,
        GVIR_CONFIG_DOMAIN_VIRT_ONE,
        GVIR_CONFIG_DOMAIN_VIRT_PHYP
    } GVirConfigDomainVirtType;

`GVIR_CONFIG_DOMAIN_VIRT_QEMU` |
`GVIR_CONFIG_DOMAIN_VIRT_KQEMU` |
`GVIR_CONFIG_DOMAIN_VIRT_KVM` |
`GVIR_CONFIG_DOMAIN_VIRT_XEN` |
`GVIR_CONFIG_DOMAIN_VIRT_LXC` |
`GVIR_CONFIG_DOMAIN_VIRT_UML` |
`GVIR_CONFIG_DOMAIN_VIRT_OPENVZ` |
`GVIR_CONFIG_DOMAIN_VIRT_VSERVER` |
`GVIR_CONFIG_DOMAIN_VIRT_LDOM` |
`GVIR_CONFIG_DOMAIN_VIRT_TEST` |
`GVIR_CONFIG_DOMAIN_VIRT_VMWARE` |
`GVIR_CONFIG_DOMAIN_VIRT_HYPERV` |
`GVIR_CONFIG_DOMAIN_VIRT_VBOX` |
`GVIR_CONFIG_DOMAIN_VIRT_ONE` |
`GVIR_CONFIG_DOMAIN_VIRT_PHYP` |

### enum GVirConfigDomainLifecycleEvent

    typedef enum {
        GVIR_CONFIG_DOMAIN_LIFECYCLE_ON_POWEROFF, /*< nick=on_poweroff >*/
        GVIR_CONFIG_DOMAIN_LIFECYCLE_ON_REBOOT, /*< nick=on_reboot >*/
        GVIR_CONFIG_DOMAIN_LIFECYCLE_ON_CRASH /*< nick=on_crash >*/
    } GVirConfigDomainLifecycleEvent;

`GVIR_CONFIG_DOMAIN_LIFECYCLE_ON_POWEROFF` |
`GVIR_CONFIG_DOMAIN_LIFECYCLE_ON_REBOOT` |
`GVIR_CONFIG_DOMAIN_LIFECYCLE_ON_CRASH` |

### enum GVirConfigDomainLifecycleAction

    typedef enum {
        GVIR_CONFIG_DOMAIN_LIFECYCLE_DESTROY,
        GVIR_CONFIG_DOMAIN_LIFECYCLE_RESTART,
        GVIR_CONFIG_DOMAIN_LIFECYCLE_PRESERVE,
        GVIR_CONFIG_DOMAIN_LIFECYCLE_RENAME_RESTART,
        GVIR_CONFIG_DOMAIN_LIFECYCLE_COREDUMP_DESTROY,
        GVIR_CONFIG_DOMAIN_LIFECYCLE_COREDUMP_RESTART
    } GVirConfigDomainLifecycleAction;

`GVIR_CONFIG_DOMAIN_LIFECYCLE_DESTROY` |
`GVIR_CONFIG_DOMAIN_LIFECYCLE_RESTART` |
`GVIR_CONFIG_DOMAIN_LIFECYCLE_PRESERVE` |
`GVIR_CONFIG_DOMAIN_LIFECYCLE_RENAME_RESTART` |
`GVIR_CONFIG_DOMAIN_LIFECYCLE_COREDUMP_DESTROY` |
`GVIR_CONFIG_DOMAIN_LIFECYCLE_COREDUMP_RESTART` |

### gvir_config_domain_new_from_xml ()

    GVirConfigDomain *  gvir_config_domain_new_from_xml     (const gchar *xml,
                                                             GError **error);

### gvir_config_domain_new ()

    GVirConfigDomain *  gvir_config_domain_new              (void);

### gvir_config_domain_get_virt_type ()

    GVirConfigDomainVirtType gvir_config_domain_get_virt_type
                                                            (GVirConfigDomain *domain);

### gvir_config_domain_set_virt_type ()

    void                gvir_config_domain_set_virt_type    (GVirConfigDomain *domain,
                                                             GVirConfigDomainVirtType type);

### gvir_config_domain_get_name ()

    const char *        gvir_config_domain_get_name         (GVirConfigDomain *domain);

### gvir_config_domain_set_name ()

    void                gvir_config_domain_set_name         (GVirConfigDomain *domain,
                                                             const char *name);

`domain` : | a GVirConfigDomain
`name` : | . [allow-none]

### gvir_config_domain_get_description ()

    const char *        gvir_config_domain_get_description  (GVirConfigDomain *domain);

### gvir_config_domain_set_description ()

    void                gvir_config_domain_set_description  (GVirConfigDomain *domain,
                                                             const char *description);

`domain` : | a GVirConfigDomain
`description` : | . [allow-none]

### gvir_config_domain_get_memory ()

    guint64             gvir_config_domain_get_memory       (GVirConfigDomain *domain);

`domain` : | a GVirConfigDomain
Returns : | maximum amount of RAM in kilobytes (i.e. blocks of 1024 bytes).

### gvir_config_domain_set_memory ()

    void                gvir_config_domain_set_memory       (GVirConfigDomain *domain,
                                                             guint64 memory);

Sets the maximum amount of RAM allocated to `domain` in kilobytes (i.e. blocks of 1024 bytes).

`domain` : | a GVirConfigDomain
`memory` : | The maximum amount of RAM in kilobytes.

### gvir_config_domain_get_current_memory ()

    guint64             gvir_config_domain_get_current_memory
                                                            (GVirConfigDomain *domain);

`domain` : | a GVirConfigDomain
Returns : | current amount of RAM in kilobytes (i.e. blocks of 1024 bytes).

### gvir_config_domain_set_current_memory ()

    void                gvir_config_domain_set_current_memory
                                                            (GVirConfigDomain *domain,
                                                             guint64 memory);

Sets the current amount of RAM allocated to `domain` in kilobytes (i.e. blocks of 1024 bytes). This can be set to less than the maximum domain memory to allow to balloon the guest memory on the fly. Be aware that libvirt will set it automatically if it's not explictly set, which means you may need to set this value in addition to 'memory' if you want to change the available domain memory after creation.

`domain` : | a GVirConfigDomain
`memory` : | The current amount of RAM in kilobytes.

### gvir_config_domain_get_vcpus ()

    guint64             gvir_config_domain_get_vcpus        (GVirConfigDomain *domain);

### gvir_config_domain_set_vcpus ()

    void                gvir_config_domain_set_vcpus        (GVirConfigDomain *domain,
                                                             guint64 vcpu_count);

### gvir_config_domain_get_features ()

    GStrv               gvir_config_domain_get_features     (GVirConfigDomain *domain);

`domain` : | a GVirConfigDomain
Returns : | The returned list should be freed with `g_strfreev()` when no longer needed. [transfer full]

### gvir_config_domain_set_features ()

    void                gvir_config_domain_set_features     (GVirConfigDomain *domain,
                                                             const GStrv features);

### gvir_config_domain_set_clock ()

    void                gvir_config_domain_set_clock        (GVirConfigDomain *domain,
                                                             GVirConfigDomainClock *klock);

`domain` : | a GVirConfigDomain
`klock` : | . [allow-none]

### gvir_config_domain_get_os ()

    GVirConfigDomainOs * gvir_config_domain_get_os          (GVirConfigDomain *domain);

Gets the operating system configuration of `domain`

`domain` : | a GVirConfigDomain
Returns : | A GVirConfigDomainOs. The returned object should be unreffed with `g_object_unref()` when no longer needed. [transfer full]

### gvir_config_domain_set_os ()

    void                gvir_config_domain_set_os           (GVirConfigDomain *domain,
                                                             GVirConfigDomainOs *os);

`domain` : | a GVirConfigDomain
`os` : | the os configuration to set. [allow-none]

### gvir_config_domain_set_seclabel ()

    void                gvir_config_domain_set_seclabel     (GVirConfigDomain *domain,
                                                             GVirConfigDomainSeclabel *seclabel);

`domain` : | a GVirConfigDomain
`seclabel` : | the security label configuration to set. [allow-none]

### gvir_config_domain_get_title ()

    const char *        gvir_config_domain_get_title        (GVirConfigDomain *domain);

### gvir_config_domain_set_title ()

    void                gvir_config_domain_set_title        (GVirConfigDomain *domain,
                                                             const char *title);

Sets the title of the domain. This is an optional short textual description of the domain. Passing a NULL `title` unsets the current domain title.

`domain` : | a GVirConfigDomain
`title` : | title of the domain. [allow-none]

### gvir_config_domain_set_devices ()

    void                gvir_config_domain_set_devices      (GVirConfigDomain *domain,
                                                             GList *devices);

`domain` : | a GVirConfigDomain
`devices` : | . [in][element-type LibvirtGConfig.DomainDevice]

### gvir_config_domain_add_device ()

    void                gvir_config_domain_add_device       (GVirConfigDomain *domain,
                                                             GVirConfigDomainDevice *device);

### gvir_config_domain_get_devices ()

    GList *             gvir_config_domain_get_devices      (GVirConfigDomain *domain);

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` : | a GVirConfigDomain
Returns : | a newly allocated GList of GVirConfigDomainDevice. [element-type LibvirtGConfig.DomainDevice][transfer full]

### gvir_config_domain_set_lifecycle ()

    void                gvir_config_domain_set_lifecycle    (GVirConfigDomain *domain,
                                                             GVirConfigDomainLifecycleEvent event,
                                                             GVirConfigDomainLifecycleAction action);

### gvir_config_domain_set_custom_xml ()

    gboolean            gvir_config_domain_set_custom_xml   (GVirConfigDomain *domain,
                                                             const gchar *xml,
                                                             const gchar *ns,
                                                             const gchar *ns_uri,
                                                             GError **error);

### gvir_config_domain_get_custom_xml ()

    gchar *             gvir_config_domain_get_custom_xml   (GVirConfigDomain *domain,
                                                             const gchar *ns_uri);

### gvir_config_domain_get_cpu ()

    GVirConfigDomainCpu * gvir_config_domain_get_cpu        (GVirConfigDomain *domain);

Gets the CPU configuration of `domain`

`domain` : | a GVirConfigDomain
Returns : | A GVirConfigDomainCpu. The returned object should be unreffed with `g_object_unref()` when no longer needed. [transfer full]

### gvir_config_domain_set_cpu ()

    void                gvir_config_domain_set_cpu          (GVirConfigDomain *domain,
                                                             GVirConfigDomainCpu *cpu);

`domain` : | a GVirConfigDomain
`cpu` : | . [allow-none]

### gvir_config_domain_set_power_management ()

    void                gvir_config_domain_set_power_management
                                                            (GVirConfigDomain *domain,
                                                             GVirConfigDomainPowerManagement *pm);

`domain` : | a GVirConfigDomain
`pm` : | a GVirPowerManagement instance. [allow-none]

## Property Details

### The `"current-memory"` property

      "current-memory"           guint64               : Read / Write

Current Guest Memory (in kilobytes).

Default value: 0

### The `"description"` property

      "description"              gchar*                : Read / Write

Some human readable description (could be anything).

Default value: NULL

### The `"features"` property

      "features"                 GStrv                 : Read / Write

Hypervisor Features.

### The `"memory"` property

      "memory"                   guint64               : Read / Write

Maximum Guest Memory (in kilobytes).

Default value: 0

### The `"name"` property

      "name"                     gchar*                : Read / Write

Domain Name.

Default value: NULL

### The `"title"` property

      "title"                    gchar*                : Read / Write

A short description - title - of the domain.

Default value: NULL

### The `"vcpu"` property

      "vcpu"                     guint64               : Read / Write

Maximum Number of Guest Virtual CPUs.

Default value: 1