---
name: "Sys::Virt::Domain"
section: "3pm"
platform: "linux"
package: "perl-sys-virt"
version: "12.7.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Sys::Virt::Domain"
---

# Sys::Virt::Domain(3pm)

Represent & manage a libvirt guest domain

## NAME

Sys::Virt::Domain - Represent & manage a libvirt guest domain

## DESCRIPTION

The `"Sys::Virt::Domain"` module represents a guest domain managed by the virtual machine monitor.

## METHODS

- my $id = $dom-\>**get\_id()**

  Returns an integer with a locally unique identifier for the domain.

- my $uuid = $dom-\>**get\_uuid()**

  Returns a 16 byte long string containing the raw globally unique identifier (UUID) for the domain.

- my $uuid = $dom-\>**get\_uuid\_string()**

  Returns a printable string representation of the raw UUID, in the format 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'.

- my $name = $dom-\>**get\_name()**

  Returns a string with a locally unique name of the domain

- my $hostname = $dom-\>get\_hostname($flags=0)

  Returns a string representing the hostname of the guest.  `$flags` can be zero or more of

  - Sys::Virt::Domain::GET\_HOSTNAME\_AGENT

    Report the guest agent hostname

  - Sys::Virt::Domain::GET\_HOSTNAME\_LEASE

    Report the DHCP lease hostname

- my $str = $dom-\>get\_metadata($type, $uri, $flags =0)

  Returns the metadata element of type `$type` associated with the domain. If `$type` is `"Sys::Virt::Domain::METADATA_ELEMENT"` then the `$uri` parameter specifies the XML namespace to retrieve, otherwise `$uri` should be `"undef"`. The optional `$flags` parameter defaults to zero.

- $dom-\>set\_metadata($type, $val, $key, $uri, $flags=0)

  Sets the metadata element of type `$type` to hold the value `$val`. If `$type` is  `"Sys::Virt::Domain::METADATA_ELEMENT"` then the `$key` and `$uri` elements specify an XML namespace to use, otherwise they should both be `"undef"`. The optional `$flags` parameter defaults to zero.

- $dom-\>**is\_active()**

  Returns a true value if the domain is currently running

- $dom-\>**is\_persistent()**

  Returns a true value if the domain has a persistent configuration file defined

- $dom-\>**is\_updated()**

  Returns a true value if the domain is running and has a persistent configuration file defined that is out of date compared to the current live config.

- my $xml = $dom-\>get\_xml\_description($flags=0)

  Returns an XML document containing a complete description of the domain's configuration. The optional `$flags` parameter controls generation of the XML document, defaulting to 0 if omitted. It can be one or more of the XML DUMP constants listed later in this document.

- my $type = $dom-\>**get\_os\_type()**

  Returns a string containing the name of the OS type running within the domain.

- $dom-\>create($flags)

  Start a domain whose configuration was previously defined using the `"define_domain"` method in Sys::Virt. The `$flags` parameter accepts one of the DOMAIN CREATION constants documented later, and defaults to 0 if omitted.

- $dom-\>create\_with\_files($fds, $flags)

  Start a domain whose configuration was previously defined using the `"define_domain"` method in Sys::Virt. The `$fds` parameter is an array of UNIX file descriptors which will be passed to the init process of the container. This is only supported with container based virtualization.The `$flags` parameter accepts one of the DOMAIN CREATION constants documented later, and defaults to 0 if omitted.

- $dom-\>**undefine()**

  Remove the configuration associated with a domain previously defined with the `"define_domain"` method in Sys::Virt. If the domain is running, you probably want to use the `"shutdown"` or `"destroy"` methods instead.

- $dom-\>**suspend()**

  Temporarily stop execution of the domain, allowing later continuation by calling the `"resume"` method.

- $dom-\>**resume()**

  Resume execution of a domain previously halted with the `"suspend"` method.

- $dom-\>**pm\_wakeup()**

  Wakeup the guest from power management suspend state

- $dom-\>pm\_suspend\_for\_duration($target, $duration, $flags=0)

  Tells the guest OS to enter the power management suspend state identified by `$target`. The `$target` parameter should be one of the NODE SUSPEND CONSTANTS listed in `"Sys::Virt"`. The `$duration` specifies when the guest should automatically wakeup. The `$flags` parameter is optional and defaults to zero.

- $dom-\>save($filename, $dxml=undef, $params=undef, $flags=0)

  Take a snapshot of the domain's state and save the information to the file named in the `$filename` parameter. The domain can later be restored from this file with the `"restore_domain"` method on the Sys::Virt object. The optional `$dxml` parameter can be used to alter portions of the domain XML that will be used when performing restore.  The `$params` parameter is a hash reference whose keys is a subset of the SAVE / RESTORE PARAMETER CONSTANTS. The `$flags` parameter accepts one of the SAVE / RESTORE FLAG CONSTANTS described later and defaults to zero.

- $dom-\>managed\_save($flags=0)

  Take a snapshot of the domain's state and save the information to a managed save location. The domain will be automatically restored with this state when it is next started. The `$flags` parameter is unused and defaults to zero.

- $bool = $dom-\>has\_managed\_save\_image($flags=0)

  Return a non-zero value if the domain has a managed save image that will be used at next start. The `$flags` parameter is unused and defaults to zero.

- $dom-\>managed\_save\_remove($flags=0)

  Remove the current managed save image, causing the guest to perform a full boot next time it is started. The `$flags` parameter is unused and defaults to zero.

- $dom-\>managed\_save\_define\_xml($xml, $flags=0)

  Update the XML of the managed save image to `$xml`. The `$flags` parameter is unused and defaults to zero.

- $xml = $dom-\>managed\_save\_get\_xml\_description($flags=0)

  Get the XML in the managed save image. The `$flags` parameter accepts the following constants

  - Sys::Virt::Domain::SAVE\_IMAGE\_XML\_SECURE

    Include security sensitive information in the XML dump, such as passwords.

- $dom-\>core\_dump($filename\[, $flags\])

  Trigger a core dump of the guest virtual machine, saving its memory image to `$filename` so it can be analysed by tools such as `"crash"`. The optional `$flags` flags parameter is currently unused and if omitted will default to 0.

- $dom-\>core\_dump\_format($filename, $format, \[, $flags\])

  Trigger a core dump of the guest virtual machine, saving its memory image to `$filename` so it can be analysed by tools such as `"crash"`. The `$format` parameter is one of the core dump format constants. The optional `$flags` flags parameter is currently unused and if omitted will default to 0.

  - Sys::Virt::Domain::CORE\_DUMP\_FORMAT\_RAW

    The raw ELF format

  - Sys::Virt::Domain::CORE\_DUMP\_FORMAT\_KDUMP\_ZLIB

    The zlib compressed ELF format

  - Sys::Virt::Domain::CORE\_DUMP\_FORMAT\_KDUMP\_SNAPPY

    The snappy compressed ELF format

  - Sys::Virt::Domain::CORE\_DUMP\_FORMAT\_KDUMP\_LZO

    The lzo compressed ELF format

  - Sys::Virt::Domain::CORE\_DUMP\_FORMAT\_WIN\_DMP

    The Windows dump format

- $dom-\>**destroy()**

  Immediately poweroff the machine. This is equivalent to removing the power plug. The guest OS is given no time to cleanup / save state. For a clean poweroff sequence, use the `"shutdown"` method instead.

- my $info = $dom-\>**get\_info()**

  Returns a hash reference summarising the execution state of the domain. The elements of the hash are as follows:

  - maxMem

    The maximum memory allowed for this domain, in kilobytes

  - memory

    The current memory allocated to the domain in kilobytes

  - cpuTime

    The amount of CPU time used by the domain

  - nrVirtCpu

    The current number of virtual CPUs enabled in the domain

  - state

    The execution state of the machine, which will be one of the constants &Sys::Virt::Domain::STATE\_\*.

- my ($state, $reason) = $dom-\>**get\_state()**

  Returns an array whose values specify the current state of the guest, and the reason for it being in that state. The `$state` values are the same as for the `"get_info"` API, and the `$reason` values come from:

  - Sys::Virt::Domain::STATE\_CRASHED\_UNKNOWN

    It is not known why the domain has crashed

  - Sys::Virt::Domain::STATE\_CRASHED\_PANICKED

    The domain has crashed due to a kernel panic

  - Sys::Virt::Domain::STATE\_NOSTATE\_UNKNOWN

    It is not known why the domain has no state

  - Sys::Virt::Domain::STATE\_PAUSED\_DUMP

    The guest is paused due to a core dump operation

  - Sys::Virt::Domain::STATE\_PAUSED\_FROM\_SNAPSHOT

    The guest is paused due to a snapshot

  - Sys::Virt::Domain::STATE\_PAUSED\_IOERROR

    The guest is paused due to an I/O error

  - Sys::Virt::Domain::STATE\_PAUSED\_MIGRATION

    The guest is paused due to migration

  - Sys::Virt::Domain::STATE\_PAUSED\_SAVE

    The guest is paused due to a save operation

  - Sys::Virt::Domain::STATE\_PAUSED\_UNKNOWN

    It is not known why the domain has paused

  - Sys::Virt::Domain::STATE\_PAUSED\_USER

    The guest is paused at admin request

  - Sys::Virt::Domain::STATE\_PAUSED\_WATCHDOG

    The guest is paused due to the watchdog

  - Sys::Virt::Domain::STATE\_PAUSED\_SHUTTING\_DOWN

    The guest is paused while domain shutdown takes place

  - Sys::Virt::Domain::STATE\_PAUSED\_SNAPSHOT

    The guest is paused while a snapshot takes place

  - Sys::Virt::Domain::STATE\_PAUSED\_CRASHED

    The guest is paused due to a kernel panic

  - Sys::Virt::Domain::STATE\_PAUSED\_STARTING\_UP

    The guest is paused as it is being started up.

  - Sys::Virt::Domain::STATE\_PAUSED\_POSTCOPY

    The guest is paused as post-copy migration is taking place

  - Sys::Virt::Domain::STATE\_PAUSED\_POSTCOPY\_FAILED

    The guest is paused as post-copy migration failed

  - Sys::Virt::Domain::STATE\_PAUSED\_API\_ERROR

    The guest is paused as a result of failed resume operation at the end of some APIs which internally suspend guests.

  - Sys::Virt::Domain::STATE\_RUNNING\_BOOTED

    The guest is running after being booted

  - Sys::Virt::Domain::STATE\_RUNNING\_FROM\_SNAPSHOT

    The guest is running after restore from snapshot

  - Sys::Virt::Domain::STATE\_RUNNING\_MIGRATED

    The guest is running after migration

  - Sys::Virt::Domain::STATE\_RUNNING\_MIGRATION\_CANCELED

    The guest is running after migration abort

  - Sys::Virt::Domain::STATE\_RUNNING\_RESTORED

    The guest is running after restore from file

  - Sys::Virt::Domain::STATE\_RUNNING\_SAVE\_CANCELED

    The guest is running after save cancel

  - Sys::Virt::Domain::STATE\_RUNNING\_UNKNOWN

    It is not known why the domain has started

  - Sys::Virt::Domain::STATE\_RUNNING\_UNPAUSED

    The guest is running after a resume

  - Sys::Virt::Domain::STATE\_RUNNING\_WAKEUP

    The guest is running after wakeup from power management suspend

  - Sys::Virt::Domain::STATE\_RUNNING\_CRASHED

    The guest was restarted after crashing

  - Sys::Virt::Domain::STATE\_RUNNING\_POSTCOPY

    The guest is running but post-copy is taking place

  - Sys::Virt::Domain::STATE\_RUNNING\_POSTCOPY\_FAILED

    The guest is running, but migration failed in post-copy

  - Sys::Virt::Domain::STATE\_BLOCKED\_UNKNOWN

    The guest is blocked for an unknown reason

  - Sys::Virt::Domain::STATE\_SHUTDOWN\_UNKNOWN

    It is not known why the domain has shutdown

  - Sys::Virt::Domain::STATE\_SHUTDOWN\_USER

    The guest is shutdown due to admin request

  - Sys::Virt::Domain::STATE\_SHUTOFF\_CRASHED

    The guest is shutoff after a crash

  - Sys::Virt::Domain::STATE\_SHUTOFF\_DESTROYED

    The guest is shutoff after being destroyed

  - Sys::Virt::Domain::STATE\_SHUTOFF\_FAILED

    The guest is shutoff due to a virtualization failure

  - Sys::Virt::Domain::STATE\_SHUTOFF\_FROM\_SNAPSHOT

    The guest is shutoff after a snapshot

  - Sys::Virt::Domain::STATE\_SHUTOFF\_MIGRATED

    The guest is shutoff after migration

  - Sys::Virt::Domain::STATE\_SHUTOFF\_SAVED

    The guest is shutoff after a save

  - Sys::Virt::Domain::STATE\_SHUTOFF\_SHUTDOWN

    The guest is shutoff due to controlled shutdown

  - Sys::Virt::Domain::STATE\_SHUTOFF\_UNKNOWN

    It is not known why the domain has shutoff

  - Sys::Virt::Domain::STATE\_SHUTOFF\_DAEMON

    The daemon stopped the guest due to a failure

  - Sys::Virt::Domain::STATE\_PMSUSPENDED\_UNKNOWN

    It is not known why the domain was suspended to RAM

  - Sys::Virt::Domain::STATE\_PMSUSPENDED\_DISK\_UNKNOWN

    It is not known why the domain was suspended to disk

- my $info = $dom-\>get\_control\_info($flags=0)

  Returns a hash reference providing information about the control channel. The returned keys in the hash are

  - "state"

    One of the CONTROL INFO constants listed later

  - "details"

    Currently unused, always 0.

  - "stateTime"

    The elapsed time since the control channel entered the current state.

- my $time = $dom-\>get\_time($flags=0);

  Get the current time of the guest, in seconds and nanoseconds. The `$flags` parameter is currently unused and defaults to zero. The return value is an array ref with two elements, the first contains the time in seconds, the second contains the remaining nanoseconds.

- $dom-\>set\_time($secs, $nsecs, $flags=0);

  Set the current time of the guest, in seconds and nanoseconds. The `$flags` parameter accepts one of

  - "Sys::Virt::Domain::TIME\_SYNC"

    Re-sync domain time from domain's RTC.

- $dom-\>set\_user\_password($username, $password, $flags=0);

  Update the password for account `$username` to be `$password`. `$password` is the clear-text password string unless the PASSWORD\_ENCRYPTED flag is set.

  - "Sys::Virt::Domain::PASSWORD\_ENCRYPTED"

    The `$password` is encrypted with the password scheme required by the guest OS.

- $dom-\>rename($newname, $flags=0)

  Change the name of an inactive guest to be `$newname`. The `$flags` parameter is currently unused and defaults to zero.

- my @errs = $dom-\>get\_disk\_errors($flags=0)

  Returns a list of all disk errors that have occurred on the backing store for the guest's virtual disks. The returned array elements are hash references, containing two keys

  - "path"

    The path of the disk with an error

  - "error"

    The error type

- $dom-\>send\_key($keycodeset, $holdtime, \\@keycodes, $flags=0)

  Sends a sequence of keycodes to the guest domain. The `$keycodeset` should be one of the constants listed later in the KEYCODE SET section. `$holdtiem` is the duration, in milliseconds, to keep the key pressed before releasing it and sending the next keycode. `@keycodes` is an array reference containing the list of keycodes to send to the guest. The elements in the array should be keycode values from the specified keycode set. `$flags` is currently unused.

- my $info = $dom-\>get\_block\_info($dev, $flags=0)

  Returns a hash reference summarising the disk usage of the host backing store for a guest block device. The `$dev` parameter should be the path to the backing store on the host. `$flags` is currently unused and defaults to 0 if omitted. The returned hash contains the following elements

  - capacity

    Logical size in bytes of the block device backing image \*

  - allocation

    Highest allocated extent in bytes of the block device backing image

  - physical

    Physical size in bytes of the container of the backing image

- $dom-\>set\_max\_memory($mem)

  Set the maximum memory for the domain to the value `$mem`. The value of the `$mem` parameter is specified in kilobytes.

- $mem = $dom-\>**get\_max\_memory()**

  Returns the current maximum memory allowed for this domain in kilobytes.

- $dom-\>set\_memory($mem, $flags)

  Set the current memory for the domain to the value `$mem`. The value of the `$mem` parameter is specified in kilobytes. This must be less than, or equal to the domain's max memory limit. The `$flags` parameter can control whether the update affects the live guest, or inactive config, defaulting to modifying the current state.

- $dom-\>set\_memory\_stats\_period($period, $flags)

  Set the period on which guests memory stats are refreshed, with `$period` being a value in seconds. The `$flags` parameter is currently unused.

- $dom-\>shutdown(\[$flags\])

  Request that the guest OS perform a graceful shutdown and poweroff. This usually requires some form of cooperation from the guest operating system, such as responding to an ACPI signal, or a guest agent process. For an immediate, forceful poweroff, use the `"destroy"` method instead. The optional `$flags` parameter specifies the shutdown mechanism, see "SHUTDOWN CONSTANTS". If not specified, driver's defaults are used.

- $dom-\>reboot(\[$flags\])

  Request that the guest OS perform a graceful shutdown and optionally restart. The optional `$flags` parameter specifies the reboot mechanism, see "REBOOT CONSTANTS". If not specified, driver's defaults are used.

- $dom-\>reset(\[$flags\])

  Perform a hardware reset of the virtual machine. The guest OS is given no opportunity to shutdown gracefully. The optional `$flags` parameter is currently unused and if omitted defaults to zero.

- $dom-\>**get\_max\_vcpus()**

  Return the maximum number of vcpus that are configured for the domain

- $dom-\>attach\_device($xml\[, $flags\])

  Hotplug a new device whose configuration is given by `$xml`, to the running guest. The optional \<$flags\> parameter defaults to 0, but can accept one of the device hotplug flags described later.

- $dom-\>detach\_device($xml\[, $flags\])

  Hotunplug an existing device whose configuration is given by `$xml`, from the running guest. The optional \<$flags\> parameter defaults to 0, but can accept one of the device hotplug flags described later.

- $dom-\>detach\_device\_alias($alias\[, $flags\])

  Hotunplug an existing device which is identified by `$alias`. The optional \<$flags\> parameter defaults to 0, but can accept one of the device hotplug flags described later.

- $dom-\>update\_device($xml\[, $flags\])

  Update the configuration of an existing device. The new configuration is given by `$xml`. The optional \<$flags\> parameter defaults to 0 but can accept one of the device hotplug flags described later.

- $data = $dom-\>block\_peek($path, $offset, $size\[, $flags\])

  Peek into the guest disk `$path`, at byte `$offset` capturing `$size` bytes of data. The returned scalar may contain embedded NULLs. The optional `$flags` parameter is currently unused and if omitted defaults to zero.

- $data = $dom-\>memory\_peek($offset, $size\[, $flags\])

  Peek into the guest memory at byte `$offset` virtual address, capturing `$size` bytes of memory. The return scalar may contain embedded NULLs. The optional `$flags` parameter is currently unused and if omitted defaults to zero.

- $flag = $dom-\>**get\_autostart()**;

  Return a true value if the guest domain is configured to automatically start upon boot. Return false, otherwise

- $dom-\>set\_autostart($flag)

  Set the state of the autostart flag, which determines whether the guest will automatically start upon boot of the host OS

- $flag = $dom-\>**get\_autostart\_once()**;

  Provides a boolean value indicating whether the domain is configured to be automatically started the next time the host machine boots only.

- $dom-\>set\_autostart\_once($flag)

  Configure the domain to be automatically started the next time the host machine boots only.

- $dom-\>set\_vcpus($count, \[$flags\])

  Set the number of virtual CPUs in the guest VM to `$count`. The optional `$flags` parameter can be used to control whether the setting changes the live config or inactive config.

- $dom-\>set\_vcpu($cpumap, $state, \[$flags=0\])

  Set the state of the CPUs in `$cpumap` to `$state`. The `$flags` parameter accepts one or more the SETVCPU OPTIONS constants documented later, and defaults to 0 if omitted.

- $count = $dom-\>get\_vcpus(\[$flags\])

  Get the number of virtual CPUs in the guest VM. The optional `$flags` parameter can be used to control whether to query the setting of the live config or inactive config.

- $dom-\>set\_guest\_vcpus($cpumap, $state, \[$flags=0\])

  Set the online status of the guest OS CPUs. The `$cpumap` parameter describes the set of CPUs to modify (e.g. "0-3,^1"). `$state` is either **1** to set the CPUs online, or **0** to set them offline. The `$flags` parameter is currently unused and defaults to 0.

- $info $dom-\>get\_guest\_vcpus(\[$flags=0\])

  Query information about the guest OS CPUs. The returned data is a hash reference with the following keys.

  - **vcpus**

    String containing bitmap representing CPU ids reported currently known to the guest.

  - **online**

    String containing bitmap representing CPU ids that are currently online in the guest.

  - **offlinable**

    String containing bitmap representing CPU ids that can be offlined in the guest.

  The `$flags` parameter is currently unused and defaults to 0.

- $type = $dom-\>**get\_scheduler\_type()**

  Return the scheduler type for the guest domain

- $stats = $dom-\>block\_stats($path)

  Fetch the current I/O statistics for the block device given by `$path`. The returned hash reference contains keys for

  - "rd\_req"

    Number of read requests

  - "rd\_bytes"

    Number of bytes read

  - "wr\_req"

    Number of write requests

  - "wr\_bytes"

    Number of bytes written

  - "errs"

    Some kind of error count

- my $params = $dom-\>get\_scheduler\_parameters($flags=0)

  Return the set of scheduler tunable parameters for the guest, as a hash reference. The precise set of keys in the hash are specific to the hypervisor.

- $dom-\>set\_scheduler\_parameters($params, $flags=0)

  Update the set of scheduler tunable parameters. The value names for tunables vary, and can be discovered using the `"get_scheduler_params"` call

- my $params = $dom-\>get\_memory\_parameters($flags=0)

  Return a hash reference containing the set of memory tunable parameters for the guest. The keys in the hash are one of the constants MEMORY PARAMETERS described later. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- $dom-\>set\_memory\_parameters($params, $flags=0)

  Update the memory tunable parameters for the guest. The `$params` should be a hash reference whose keys are one of the MEMORY PARAMETERS constants. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- my $params = $dom-\>get\_blkio\_parameters($flags=0)

  Return a hash reference containing the set of blkio tunable parameters for the guest. The keys in the hash are one of the constants BLKIO PARAMETERS described later. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- $dom-\>set\_blkio\_parameters($params, $flags=0)

  Update the blkio tunable parameters for the guest. The `$params` should be a hash reference whose keys are one of the BLKIO PARAMETERS constants. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- $stats = $dom-\>get\_block\_iotune($disk, $flags=0)

  Return a hash reference containing the set of blkio tunable parameters for the guest disk `$disk`. The keys in the hash are one of the constants BLOCK IOTUNE PARAMETERS described later.

- $dom-\>set\_block\_iotune($disk, $params, $flags=0);

  Update the blkio tunable parameters for the guest disk `$disk`. The `$params` should be a hash reference whose keys are one of the BLOCK IOTUNE PARAMETERS constants.

- my $params = $dom-\>get\_interface\_parameters($intf, $flags=0)

  Return a hash reference containing the set of interface tunable parameters for the guest. The keys in the hash are one of the constants INTERFACE PARAMETERS described later.

- $dom-\>set\_interface\_parameters($intf, $params, $flags=0)

  Update the interface tunable parameters for the guest. The `$params` should be a hash reference whose keys are one of the INTERFACE PARAMETERS constants.

- my $params = $dom-\>get\_numa\_parameters($flags=0)

  Return a hash reference containing the set of numa tunable parameters for the guest. The keys in the hash are one of the constants NUMA PARAMETERS described later. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- $dom-\>set\_numa\_parameters($params, $flags=0)

  Update the numa tunable parameters for the guest. The `$params` should be a hash reference whose keys are one of the NUMA PARAMETERS constants. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- my $params = $dom-\>get\_perf\_events($flags=0)

  Return a hash reference containing the set of performance events that are available for the guest. The keys in the hash are one of the constants PERF EVENTS described later. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- $dom-\>set\_perf\_events($params, $flags=0)

  Update the enabled state for performance events for the guest. The `$params` should be a hash reference whose keys are one of the PERF EVENTS constants. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- $dom-\>block\_resize($disk, $newsize, $flags=0)

  Resize the disk `$disk` to have new size `$newsize` KB. If the disk is backed by a special image format, the actual resize is done by the hypervisor. If the disk is backed by a raw file, or block device, the resize must be done prior to invoking this API call, and it merely updates the hypervisor's view of the disk size. The following flags may be used

  - Sys::Virt::Domain::BLOCK\_RESIZE\_BYTES

    Treat `$newsize` as if it were in bytes, rather than KB.

  - Sys::Virt::Domain::BLOCK\_RESIZE\_CAPACITY

    Resize to full the capacity of the source

  - Sys::Virt::Domain::BLOCK\_RESIZE\_EXTEND

    Disallow shrinking of the disk in size.

- $dom-\>interface\_stats($path)

  Fetch the current I/O statistics for the block device given by `$path`. The returned hash contains keys for

  - "rx\_bytes"

    Total bytes received

  - "rx\_packets"

    Total packets received

  - "rx\_errs"

    Total packets received with errors

  - "rx\_drop"

    Total packets drop at reception

  - "tx\_bytes"

    Total bytes transmitted

  - "tx\_packets"

    Total packets transmitted

  - "tx\_errs"

    Total packets transmitted with errors

  - "tx\_drop"

    Total packets dropped at transmission.

- $dom-\>memory\_stats($flags=0)

  Fetch the current memory statistics for the guest domain. The `$flags` parameter is currently unused and can be omitted. The returned hash contains keys for

  - "swap\_in"

    Data read from swap space

  - "swap\_out"

    Data written to swap space

  - "major\_fault"

    Page fault involving disk I/O

  - "minor\_fault"

    Page fault not involving disk I/O

  - "unused"

    Memory not used by the system

  - "available"

    Total memory seen by guest

  - "rss"

    Resident set size. Size of memory resident in host RAM.

- $info = $dom-\>**get\_security\_label()**

  Fetch information about the security label assigned to the guest domain. The returned hash reference has two keys, `"model"` gives the name of the security model in effect (e.g. `"selinux"`), while `"label"` provides the name of the security label applied to the domain. This method only returns information about the first security label. To retrieve all labels, use `"get_security_label_list"`.

- @info = $dom-\>**get\_security\_label\_list()**

  Fetches information about all security labels assigned to the guest domain. The elements in the returned array are all hash references, whose keys are as described for `"get_security_label"`.

- $ddom = $dom-\>migrate(destcon, \\%params, flags=0)

  Migrate a domain to an alternative host. The `"destcon"` parameter should be a `"Sys::Virt"` connection to the remote target host. The `"flags"` parameter takes one or more of the `"Sys::Virt::Domain::MIGRATE_XXX"` constants described later in this document. The `%params` parameter is a hash reference used to set various parameters for the migration operation, with the following valid keys.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_URI"

    The URI to use for initializing the domain migration. It takes a hypervisor specific format. The uri\_transports element of the hypervisor capabilities XML includes details of the supported URI schemes. When omitted libvirt will auto-generate suitable default URI. It is typically only necessary to specify this URI if the destination host has multiple interfaces and a specific interface is required to transmit migration data.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_DEST\_NAME"

    The name to be used for the domain on the destination host. Omitting this parameter keeps the domain name the same. This field is only allowed to be used with hypervisors that support domain renaming during migration.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_DEST\_XML"

    The new configuration to be used for the domain on the destination host. The configuration must include an identical set of virtual devices, to ensure a stable guest ABI across migration. Only parameters related to host side configuration can be changed in the XML. Hypervisors which support this field will forbid migration if the provided XML would cause a change in the guest ABI. This field cannot be used to rename the domain during migration (use VIR\_MIGRATE\_PARAM\_DEST\_NAME field for that purpose). Domain name in the destination XML must match the original domain name.

    Omitting this parameter keeps the original domain configuration. Using this field with hypervisors that do not support changing domain configuration during migration will result in a failure.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_GRAPHICS\_URI"

    URI to use for migrating client's connection to domain's graphical console as VIR\_TYPED\_PARAM\_STRING. If specified, the client will be asked to automatically reconnect using these parameters instead of the automatically computed ones. This can be useful if, e.g., the client does not have a direct access to the network virtualization hosts are connected to and needs to connect through a proxy. The URI is formed as follows:

    ```
          protocol://hostname[:port]/[?parameters]
    ```

    where protocol is either "spice" or "vnc" and parameters is a list of protocol specific parameters separated by '&'. Currently recognized parameters are "tlsPort" and "tlsSubject". For example,

    ```
          spice://target.host.com:1234/?tlsPort=4567
    ```

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_BANDWIDTH"

    The maximum bandwidth (in MiB/s) that will be used for migration. If set to 0 or omitted, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if this field is used and is not 0.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_BANDWIDTH\_POSTCOPY"

    The maximum bandwidth (in MiB/s) that will be used for migration during post-copy phase. If set to 0 or omitted, libvirt will choose a suitable default. Some hypervisors do not support this feature and return an error if this field is used and is not 0.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_LISTEN\_ADDRESS"

    The address on which to listen for incoming migration connections. If omitted, libvirt will listen on the wildcard address (0.0.0.0 or ::). This default may be a security risk if guests, or other untrusted users have the ability to connect to the virtualization host, thus use of an explicit restricted listen address is recommended.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_DISK\_PORT"

    Port that destination server should use for incoming disks migration. Type is VIR\_TYPED\_PARAM\_INT. If set to 0 or omitted, libvirt will choose a suitable default. At the moment this is only supported by the QEMU driver.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_MIGRATE\_DISKS"

    The list of disks to migrate when doing block storage migration. In contrast to other parameters whose values are plain strings, the parameter value should be an array reference, whose elements are in turn strings representing the disk target names.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_COMPRESSION"

    The type of compression method use use, either `"xbzrle"` or `"mt"`.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_COMPRESSION\_MT\_THREADS"

    The number of compression threads to use

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_COMPRESSION\_MT\_DTHREADS"

    The number of decompression threads

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_COMPRESSION\_MT\_LEVEL"

    The compression level from 0 (no compression) to 9 (maximum compression)

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_COMPRESSION\_XBZRLE\_CACHE"

    The size of the cache for xbzrle compression

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_PERSIST\_XML"

    The alternative persistent XML config to copy

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_AUTO\_CONVERGE\_INITIAL"

    The initial percentage to throttle guest vCPUs

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_AUTO\_CONVERGE\_INCREMENT"

    The additional percentage step size to throttle guest vCPUs if progress is not made

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_PARALLEL\_CONNECTIONS"

    The number of connections used during parallel migration.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_TLS\_DESTINATION"

    Override the destination host name used for TLS verification. Normally the TLS certificate from the destination host must match the host's name for TLS verification to succeed. When the certificate does not match the destination hostname and the expected certificate's hostname is known, this parameter can be used to pass this expected hostname when starting the migration.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_DISKS\_URI"

    The URI to use for initializing the domain migration for storage. It takes a hypervisor specific format. The uri\_transports element of the hypervisor capabilities XML includes details of the supported URI schemes. When omitted libvirt will auto-generate suitable default URI. It is typically only necessary to specify this URI if the destination host has multiple interfaces and a specific interface is required to transmit storage data.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_ZLIB\_LEVEL"

    The level of compression for zlib. Accepted values are in range 0-9. 0 is no compression, 1 is maximum speed and 9 is maximum compression.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_ZSTD\_LEVEL"

    The level of compression for zstd. Accepted values are in range 0-20. 0 is no compression, 1 is maximum speed and 20 is maximum compression.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_DISKS\_DETECT\_ZEROES"

    Enable zero detection on list of disks to avoid transferring zero blocks. Users must ensure that any pre-created storage source on the destination will be cleared and thus read all-zeroes before using this feature, otherwise the destination image may become corrupted. In contrast to other parameters whose values are plain strings, the parameter value should be an array reference, whose elements are in turn strings representing the disk target names.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_BANDWIDTH\_AVAIL\_SWITCHOVER"

    The maximum bandwidth (in MiB/s) that will be used for migration during the switchover phase. If set to 0 or omitted, QEMU will estimate a suitable default.

  - "Sys::Virt::Domain::MIGRATE\_PARAM\_MIGRATE\_DISKS\_TARGET\_ZERO"

    List of target disks that can be assumed to be initialized to all zeros.

- $ddom = $dom-\>migrate(destcon, flags=0, dname=undef, uri=undef, bandwidth=0)

  Migrate a domain to an alternative host. Use of positional parameters with `"migrate"` is deprecated in favour of passing a hash reference as described above.

- $ddom = $dom-\>migrate2(destcon, dxml, flags, dname, uri, bandwidth)

  Migrate a domain to an alternative host. This method is deprecated in favour of passing a hash ref to `"migrate"`.

- $ddom = $dom-\>migrate\_to\_uri(desturi, \\%params, flags=0)

  Migrate a domain to an alternative host. The `"desturi"` parameter should be a valid libvirt connection URI for the remote target host. The `"flags"` parameter takes one or more of the `"Sys::Virt::Domain::MIGRATE_XXX"` constants described later in this document. The `%params` parameter is a hash reference used to set various parameters for the migration operation, with the same keys described for the `"migrate"` API.

- $dom-\>migrate\_to\_uri(desturi, flags, dname, bandwidth)

  Migrate a domain to an alternative host. Use of positional parameters with `"migrate_to_uri"` is deprecated in favour of passing a hash reference as described above.

- $dom-\>migrate\_to\_uri2(dconnuri, miguri, dxml, flags, dname, bandwidth)

  Migrate a domain to an alternative host. This method is deprecated in favour of passing a hash ref to `"migrate_to_uri"`.

- $dom-\>migrate\_set\_max\_downtime($downtime, $flags=0)

  Set the maximum allowed downtime during migration of the guest. A longer downtime makes it more likely that migration will complete, at the cost of longer time blackout for the guest OS at the switch over point. The `"downtime"` parameter is measured in milliseconds. The `$flags` parameter is currently unused and defaults to zero.

- $downtime = $dom-\>migrate\_get\_max\_downtime($flags=0)

  Get the current value of the maximum downtime allowed during a migration of a guest. The returned \<downtime\> value is measured in milliseconds. The `$flags` parameter is currently unused and defaults to zero.

- $dom-\>migrate\_set\_max\_speed($bandwidth, $flags=0)

  Set the maximum allowed bandwidth during migration of the guest. The `"bandwidth"` parameter is measured in MB/second. The `$flags` parameter takes zero or more of the constants:

  - $Sys::Virt::Domain::MIGRATE\_MAX\_SPEED\_POSTCOPY

    Set the post-copy speed instead of the pre-copy speed.

- $bandwidth = $dom-\>migrate\_get\_max\_speed($flags=0)

  Get the maximum allowed bandwidth during migration of the guest. The returned \<bandwidth\> value is measured in MB/second. The `$flags` parameter is accepts the same constants as `"migrate_set_max_speed"`.

- $dom-\>migrate\_set\_compression\_cache($cacheSize, $flags=0)

  Set the maximum allowed compression cache size during migration of the guest. The `"cacheSize"` parameter is measured in bytes. The `$flags` parameter is currently unused and defaults to zero.

- $cacheSize = $dom-\>migrate\_get\_compression\_cache($flags=0)

  Get the maximum allowed compression cache size during migration of the guest. The returned \<bandwidth\> value is measured in bytes. The `$flags` parameter is currently unused and defaults to zero.

- $dom-\>migrate\_start\_post\_copy($flags=0)

  Switch the domain from pre-copy to post-copy mode. This requires that the original migrate command had the `"Sys::Virt::Domain::MIGRATE_POST_COPY"` flag specified.

- $dom-\>inject\_nmi($flags)

  Trigger an NMI in the guest virtual machine. The `$flags` parameter is currently unused and defaults to 0.

- $dom-\>open\_console($st, $devname, $flags)

  Open the text console for a serial, parallel or paravirt console device identified by `$devname`, connecting it to the stream `$st`. If `$devname` is undefined, the default console will be opened. `$st` must be a `"Sys::Virt::Stream"` object used for bi-directional communication with the console. `$flags` is currently unused, defaulting to 0.

- $dom-\>open\_channel($st, $devname, $flags)

  Open the text console for a data channel device identified by `$devname`, connecting it to the stream `$st`. `$st` must be a `"Sys::Virt::Stream"` object used for bi-directional communication with the channel. `$flags` is currently unused, defaulting to 0.

- $dom-\>open\_graphics($idx, $fd, $flags)

  Open the graphics console for a guest, identified by `$idx`, counting from 0. The `$fd` should be a file descriptor for an anonymous socket pair. The `$flags` argument should be one of the constants listed at the end of this document, and defaults to 0.

- $fd = $dom-\>open\_graphics\_fd($idx, $flags)

  Open the graphics console for a guest, identified by `$idx`, counting from 0. The `$flags` argument should be one of the constants listed at the end of this document, and defaults to 0. The return value will be a file descriptor connected to the console which must be closed when no longer needed. This method is preferred over `"open_graphics"` since it will work correctly under sVirt mandatory access control policies.

- my $mimetype = $dom-\>screenshot($st, $screen, $flags)

  Capture a screenshot of the virtual machine's monitor. The `$screen` parameter controls which monitor is captured when using a multi-head or multi-card configuration. `$st` must be a `"Sys::Virt::Stream"` object from which the data can be read. `$flags` is currently unused and defaults to 0. The mimetype of the screenshot is returned

- @vcpuinfo = $dom-\>get\_vcpu\_info($flags=0)

  Obtain information about the state of all virtual CPUs in a running guest domain. The returned list will have one element for each vCPU, where each elements contains a hash reference. The keys in the hash are, `"number"` the vCPU number, `"cpu"` the physical CPU on which the vCPU is currently scheduled, `"cpuTime"` the cumulative execution time of the vCPU, `"state"` the running state and `"affinity"` giving the allowed scheduler placement. The value for `"affinity"` is a string representing a bitmask against physical CPUs, 8 cpus per character. To extract the bits use the `"unpack"` function with the `"b*"` template. NB The `"state"`, `"cpuTime"`, `"cpu"` values are only available if using `$flags` value of 0, and the domain is currently running; otherwise they will all be set to zero.

- $dom-\>pin\_vcpu($vcpu, $mask)

  Pin the virtual CPU given by index `$vcpu` to physical CPUs given by `$mask`. The `$mask` is a string representing a bitmask against physical CPUs, 8 cpus per character.

- $mask = $dom-\>**get\_emulator\_pin\_info()**

  Obtain information about the CPU affinity of the emulator process. The returned `$mask` is a bitstring against physical CPUs, 8 cpus per character. To extract the bits use the `"unpack"` function with the `"b*"` template.

- $dom-\>pin\_emulator($newmask, $flags=0)

  Pin the emulator threads to the physical CPUs identified by the affinity in `$newmask`. The `$newmask` is a bitstring against the physical CPUa, 8 cpus per character. To create a suitable bitstring, use the `"vec"` function with a value of `1` for the `"BITS"` parameter.

- @iothreadinfo = $dom-\>get\_iothread\_info($flags=0)

  Obtain information about the state of all IOThreads in a running guest domain. The returned list will have one element for each IOThread, where each elements contains a hash reference. The keys in the hash are, `"number"` the IOThread number and `"affinity"` giving the allowed scheduler placement. The value for `"affinity"` is a string representing a bitmask against physical CPUs, 8 cpus per character. To extract the bits use the `"unpack"` function with the `"b*"` template.

- $dom-\>pin\_iothread($iothread, $mask)

  Pin the IOThread given by index `$iothread` to physical CPUs given by `$mask`. The `$mask` is a string representing a bitmask against physical CPUs, 8 cpus per character.

- $dom-\>add\_iothread($iothread, $flags=0)

  Add a new IOThread by the `$iothread` value to the guest domain. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- $dom-\>del\_iothread($iothread, $flags=0)

  Delete an existing IOThread by the `$iothread` value from the guest domain. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- $dom-\>set\_iothread($iothread, $params, $flags=0)

  Set parameters for the IOThread by the `$iothread` value on the guest domain. The `$params` parameter is a hash reference whose keys are the `"IOTHREAD STATS"` constants documented later. The `$flags` parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted.

- my @stats = $dom-\>get\_cpu\_stats($startCpu, $numCpus, $flags=0)

  Requests the guests host physical CPU usage statistics, starting from host CPU \<$startCpu\> counting up to `$numCpus`. If `$startCpu` is -1 and `$numCpus` is 1, then the utilization across all CPUs is returned. Returns an array of hash references, each element containing stats for one CPU.

- my $info = $dom-\>**get\_job\_info()**

  Returns a hash reference summarising the execution state of the background job. The elements of the hash are as follows:

  - type

    The type of job, one of the JOB TYPE constants listed later in this document.

  - timeElapsed

    The elapsed time in milliseconds

  - timeRemaining

    The expected remaining time in milliseconds. Only set if the `"type"` is JOB\_UNBOUNDED.

  - dataTotal

    The total amount of data expected to be processed by the job, in bytes.

  - dataProcessed

    The current amount of data processed by the job, in bytes.

  - dataRemaining

    The expected amount of data remaining to be processed by the job, in bytes.

  - memTotal

    The total amount of memory expected to be processed by the job, in bytes.

  - memProcessed

    The current amount of memory processed by the job, in bytes.

  - memRemaining

    The expected amount of memory remaining to be processed by the job, in bytes.

  - fileTotal

    The total amount of file expected to be processed by the job, in bytes.

  - fileProcessed

    The current amount of file processed by the job, in bytes.

  - fileRemaining

    The expected amount of file remaining to be processed by the job, in bytes.

- my ($type, $stats) = $dom-\>get\_job\_stats($flags=0)

  Returns an array summarising the execution state of the background job. The `$type` value is one of the JOB TYPE constants listed later in this document. The `$stats` value is a hash reference, whose elements are one of the following constants.

  - type

    The type of job, one of the JOB TYPE constants listed later in this document.

    The `$flags` parameter defaults to zero and can take one of the following constants.

    - Sys::Virt::Domain::JOB\_STATS\_COMPLETED

      Return the stats of the most recently completed job.

    - Sys::Virt::Domain::JOB\_STATS\_KEEP\_COMPLETED

      Don't clear the completed stats after reading them.

  - Sys::Virt::Domain::JOB\_TIME\_ELAPSED

    The elapsed time in milliseconds

  - Sys::Virt::Domain::JOB\_TIME\_ELAPSED\_NET

    Time in milliseconds since the beginning of the migration job NOT including the time required to transfer control flow from the source host to the destination host.

  - Sys::Virt::Domain::JOB\_TIME\_REMAINING

    The expected remaining time in milliseconds. Only set if the `"type"` is JOB\_UNBOUNDED.

  - Sys::Virt::Domain::JOB\_DATA\_TOTAL

    The total amount of data expected to be processed by the job, in bytes.

  - Sys::Virt::Domain::JOB\_DATA\_PROCESSED

    The current amount of data processed by the job, in bytes.

  - Sys::Virt::Domain::JOB\_DATA\_REMAINING

    The expected amount of data remaining to be processed by the job, in bytes.

  - Sys::Virt::Domain::JOB\_MEMORY\_TOTAL

    The total amount of memory expected to be processed by the job, in bytes.

  - Sys::Virt::Domain::JOB\_MEMORY\_PROCESSED

    The current amount of memory processed by the job, in bytes.

  - Sys::Virt::Domain::JOB\_MEMORY\_REMAINING

    The expected amount of memory remaining to be processed by the job, in bytes.

  - Sys::Virt::Domain::JOB\_MEMORY\_CONSTANT

    The number of pages filled with a constant byte which have been transferred

  - Sys::Virt::Domain::JOB\_MEMORY\_NORMAL

    The number of pages transferred without any compression

  - Sys::Virt::Domain::JOB\_MEMORY\_NORMAL\_BYTES

    The number of bytes transferred without any compression

  - Sys::Virt::Domain::JOB\_MEMORY\_BPS

    The bytes per second transferred

  - Sys::Virt::Domain::JOB\_MEMORY\_DIRTY\_RATE

    The number of memory pages dirtied per second

  - Sys::Virt::Domain::JOB\_MEMORY\_PAGE\_SIZE

    The memory page size in bytes

  - Sys::Virt::Domain::JOB\_MEMORY\_ITERATION

    The total number of iterations over guest memory

  - Sys::Virt::Domain::JOB\_MEMORY\_POSTCOPY\_REQS

    The number of page requests received from the destination host during post-copy migration.

  - Sys::Virt::Domain::JOB\_DISK\_TOTAL

    The total amount of file expected to be processed by the job, in bytes.

  - Sys::Virt::Domain::JOB\_DISK\_PROCESSED

    The current amount of file processed by the job, in bytes.

  - Sys::Virt::Domain::JOB\_DISK\_REMAINING

    The expected amount of file remaining to be processed by the job, in bytes.

  - Sys::Virt::Domain::JOB\_DISK\_BPS

    The bytes per second transferred

  - Sys::Virt::Domain::JOB\_AUTO\_CONVERGE\_THROTTLE

    The percentage by which vCPUs are currently throttled

  - Sys::Virt::Domain::JOB\_COMPRESSION\_CACHE

    The size of the compression cache in bytes

  - Sys::Virt::Domain::JOB\_COMPRESSION\_BYTES

    The number of compressed bytes transferred

  - Sys::Virt::Domain::JOB\_COMPRESSION\_PAGES

    The number of compressed pages transferred

  - Sys::Virt::Domain::JOB\_COMPRESSION\_CACHE\_MISSES

    The number of changing pages not in compression cache

  - Sys::Virt::Domain::JOB\_COMPRESSION\_OVERFLOW

    The number of changing pages in the compression cache but sent uncompressed since the compressed page was larger than the non-compressed page.

  - Sys::Virt::Domain::JOB\_DOWNTIME

    The number of milliseconds of downtime expected during migration switchover.

  - Sys::Virt::Domain::JOB\_DOWNTIME\_NET

    Real measured downtime (ms) NOT including the time required to transfer control flow from the source host to the destination host.

  - Sys::Virt::Domain::JOB\_SETUP\_TIME

    The number of milliseconds of time doing setup of the job

  - Sys::Virt::Domain::JOB\_OPERATION

    The type of operation associated with the job

  - Sys::Virt::Domain::JOB\_SUCCESS

    Whether the job was successfully completed.

  - Sys::Virt::Domain::JOB\_DISK\_TEMP\_TOTAL

    Possible total temporary disk space for the job in bytes

  - Sys::Virt::Domain::JOB\_DISK\_TEMP\_USED

    Current total temporary disk space for the job in bytes

  - Sys::Virt::Domain::JOB\_ERRMSG

    The error message from a failed job

  - Sys::Virt::Domain::JOB\_VFIO\_DATA\_TRANSFERRED

    Total data transferred for VFIO devices

  The values for the Sys::Virt::Domain::JOB\_OPERATION field are

  - Sys::Virt::Domain::JOB\_OPERATION\_UNKNOWN

    No known job type

  - Sys::Virt::Domain::JOB\_OPERATION\_START

    The guest is starting

  - Sys::Virt::Domain::JOB\_OPERATION\_SAVE

    The guest is saving to disk

  - Sys::Virt::Domain::JOB\_OPERATION\_RESTORE

    The guest is restoring from disk

  - Sys::Virt::Domain::JOB\_OPERATION\_MIGRATION\_IN

    The guest is migrating in from another host

  - Sys::Virt::Domain::JOB\_OPERATION\_MIGRATION\_OUT

    The guest is migrating out to another host

  - Sys::Virt::Domain::JOB\_OPERATION\_SNAPSHOT

    The guest is saving a snapshot

  - Sys::Virt::Domain::JOB\_OPERATION\_SNAPSHOT\_REVERT

    The guest is reverting to a snapshot

  - Sys::Virt::Domain::JOB\_OPERATION\_DUMP

    The guest is saving a crash dump

  - Sys::Virt::Domain::JOB\_OPERATION\_BACKUP

    The guest is performing a block backup

  - Sys::Virt::Domain::JOB\_OPERATION\_SNAPSHOT\_DELETE

    The guest is deleting a snapshot

- $dom-\>abort\_job($flags=0)

  Aborts the currently executing job. Valid `$flags` include:

  - Sys::Virt::Domain::DOMAIN\_ABORT\_JOB\_POSTCOPY

    Interrupt post-copy migration. It can later be resumed using migrate APIs with `"MIGRATE_POSTCOPY_RESUME"` flag.

- my $info = $dom-\>get\_block\_job\_info($path, $flags=0)

  Returns a hash reference summarising the execution state of the block job. The `$path` parameter should be the fully qualified path of the block device being changed. Valid `$flags` include:

  - Sys::Virt::Domain::BLOCK\_JOB\_INFO\_BANDWIDTH\_BYTES

    Treat bandwidth value as bytes instead of MiB.

- $dom-\>set\_block\_job\_speed($path, $bandwidth, $flags=0)

  Change the maximum I/O bandwidth used by the block job that is currently executing for `$path`. The `$bandwidth` argument is specified in MB/s.  The `$flags` parameter can take the bitwise union of the values:

  - Sys::Virt::Domain::BLOCK\_JOB\_SPEED\_BANDWIDTH\_BYTES

    The `$bandwidth` parameter value is measured in bytes/s instead of MB/s.

- $dom-\>abort\_block\_job($path, $flags=0)

  Abort the current job that is executing for the block device associated with `$path`

- $dom-\>block\_pull($path, $bandwidth, $flags=0)

  Merge the backing files associated with `$path` into the top level file. The `$bandwidth` parameter specifies the maximum I/O rate to allow in MB/s. The `$flags` parameter can take the bitwise union of the values:

  - Sys::Virt::Domain::BLOCK\_PULL\_BANDWIDTH\_BYTES

    The `$bandwidth` parameter value is measured in bytes/s instead of MB/s.

- $dom-\>block\_rebase($path, $base, $bandwidth, $flags=0)

  Switch the backing path associated with `$path` to instead use `$base`. The `$bandwidth` parameter specifies the maximum I/O rate to allow in MB/s. The `$flags` parameter can take the bitwise union of the values:

  - Sys::Virt::Domain::BLOCK\_REBASE\_BANDWIDTH\_BYTES

    The `$bandwidth` parameter value is measured in bytes/s instead of MB/s.

- $dom-\>block\_copy($path, $destxml, $params, $flags=0)

  Copy contents of a disk image \<$path\> into the target volume described by `$destxml` which follows the schema of the \<disk\> element in the domain XML. The `$params` parameter is a hash of optional parameters to control the process

  - Sys::Virt::Domain::BLOCK\_COPY\_BANDWIDTH

    The maximum bandwidth in bytes per second.

  - Sys::Virt::Domain::BLOCK\_COPY\_GRANULARITY

    The granularity in bytes of the copy process

  - Sys::Virt::Domain::BLOCK\_COPY\_BUF\_SIZE

    The maximum amount of data in flight in bytes.

- $dom-\>block\_commit($path, $base, $top, $bandwidth, $flags=0)

  Commit changes there were made to the temporary top level file `$top`. Takes all the differences between `$top` and `$base` and merge them into `$base`. The `$bandwidth` parameter specifies the maximum I/O rate to allow in MB/s.  The `$flags` parameter can take the bitwise union of the values:

  - Sys::Virt::Domain::BLOCK\_COMMIT\_BANDWIDTH\_BYTES

    The `$bandwidth` parameter value is measured in bytes instead of MB/s.

- $count = $dom-\>**num\_of\_snapshots()**

  Return the number of saved snapshots of the domain

- @names = $dom-\>**list\_snapshot\_names()**

  List the names of all saved snapshots. The names can be used with the `"lookup_snapshot_by_name"`

- @snapshots = $dom-\>**list\_snapshots()**

  Return a list of all snapshots currently known to the domain. The elements in the returned list are instances of the Sys::Virt::DomainSnapshot class. This method requires O(n) RPC calls, so the `"list_all_snapshots"` method is recommended as a more efficient alternative.

- my @snapshots = $dom-\>list\_all\_snapshots($flags)

  Return a list of all domain snapshots associated with this domain. The elements in the returned list are instances of the Sys::Virt::DomainSnapshot class. The `$flags` parameter can be used to filter the list of return domain snapshots.

- my $snapshot = $dom-\>get\_snapshot\_by\_name($name)

  Return the domain snapshot with a name of `$name`. The returned object is an instance of the Sys::Virt::DomainSnapshot class.

- $dom-\>**has\_current\_snapshot()**

  Returns a true value if the domain has a currently active snapshot

- $snapshot = $dom-\>**current\_snapshot()**

  Returns the currently active snapshot for the domain.

- $snapshot = $dom-\>create\_snapshot($xml\[, $flags\])

  Create a new snapshot from the `$xml`. The `$flags` parameter accepts the **SNAPSHOT CREATION** constants listed in `"Sys::Virt::DomainSnapshots"`.

- my @checkpoints = $dom-\>list\_all\_checkpoints($flags)

  Return a list of all domain checkpoints associated with this domain. The elements in the returned list are instances of the Sys::Virt::DomainCheckpoint class. The `$flags` parameter can be used to filter the list of return domain checkpoints.

- my $checkpoint = $dom-\>get\_checkpoint\_by\_name($name)

  Return the domain checkpoint with a name of `$name`. The returned object is an instance of the Sys::Virt::DomainCheckpoint class.

- $checkpoint = $dom-\>create\_checkpoint($xml\[, $flags\])

  Create a new checkpoint from the `$xml`. The `$flags` parameter accepts the **CHECKPOINT CREATION** constants listed in `"Sys::Virt::DomainCheckpoints"`.

- $dom-\>backup\_begin($backupxml, $checkpointxml=undef, $flags=0);

  Start a point-in-time backup job for the specified disks of a running domain. The `$backupxml` parameter describes the backup operation, including which disks to use. The optional `$checkpointxml` parameter can be used to create a checkpoint covering to the same point in time as the backup. The optional `$flags` parameter can be one of the following constants:

  - Sys::Virt::Domain::BACKUP\_BEGIN\_REUSE\_EXTERNAL

    Assume that the output/temporary files for the backup have been precreated by the caller with the correct size and format.

  - Sys::Virt::Domain::BACKUP\_BEGIN\_PRESERVE\_SHUTDOWN\_DOMAIN

    Preserve the domain if the guest OS shuts down while the backup is running.

- $xml = $dom-\>backup\_get\_xml\_description($flags=0);

  Get the XML description of the currently executing backup job. If there is no backup job then an error is raised.

- $dom-\>fs\_trim($mountPoint, $minimum, $flags=0);

  Issue an FS\_TRIM command to the device at `$mountPoint` to remove chunks of unused space that are at least `$minimum` bytes in length. `$flags` is currently unused and defaults to zero.

- $dom-\>fs\_freeze(\\@mountPoints, $flags=0);

  Freeze all the filesystems associated with the `@mountPoints` array reference. If \<@mountPoints\> is an empty list, then all filesystems will be frozen. `$flags` is currently unused and defaults to zero.

- $dom-\>fs\_thaw(\\@mountPoints, $flags=0);

  Thaw all the filesystems associated with the `@mountPoints` array reference. If \<@mountPoints\> is an empty list, then all filesystems will be thawed. `$flags` is currently unused and defaults to zero.

- @fslist = $dom-\>get\_fs\_info($flags=0);

  Obtain a list of all guest filesystems. The returned list will contain one element for each filesystem, whose value will be a hash reference with the following keys

  - name

    The name of the guest device that is mounted

  - fstype

    The filesystem type (e.g. 'ext4', 'fat', 'ntfs', etc)

  - mountpoint

    The location in the filesystem tree of the mount

  - devalias

    An array reference containing list of device aliases associated with the guest device. The device aliases correspond to disk target names in the guest XML configuration

- @nics = $dom-\>get\_interface\_addresses($src, $flags=0);

  Obtain a list of all guest network interfaces. The `$src` parameter is one of the constants

  - Sys::Virt::Domain::INTERFACE\_ADDRESSES\_SRC\_LEASE

    Extract the DHCP server lease information

  - Sys::Virt::Domain::INTERFACE\_ADDRESSES\_SRC\_AGENT

    Query the guest OS via an agent

  - Sys::Virt::Domain::INTERFACE\_ADDRESSES\_SRC\_ARP

    Extract from the local ARP tables

  The returned list will contain one element for each interface. The values in the list will be a hash reference with the following keys

  - name

    The name of the guest interface that is mounted

  - hwaddr

    The hardware address, aka MAC, if available.

  - addrs

    An array reference containing list of IP addresses associated with the guest NIC. Each element in the array is a further hash containing

    - addr

      The IP address string

    - prefix

      The IP address network prefix

    - type

      The IP address type (IPv4 vs IPv6)

- $dom-\>send\_process\_signal($pid, $signum, $flags=0);

  Send the process `$pid` the signal `$signum`. The `$signum` value must be one of the constants listed later, not a POSIX or Linux signal value. `$flags` is currently unused and defaults to zero.

- $dom-\>set\_block\_threshold($dev, $threshold, $flags=0);

  Set the threshold level for delivering the EVENT\_ID\_BLOCK\_THRESHOLD if the device or backing chain element described by `$dev` is written beyond the set `$threshold` level. The threshold level is unset once the event fires. The event might not be delivered at all if libvirtd was not running at the moment when the threshold was reached.

- $dom-\>set\_lifecycle\_action($type, $action, $flags=0)

  Changes the actions of lifecycle events for domain represented as \<on\_$type\>$action\</on\_$type\> in the domain XML.

- $info = $dom-\>get\_launch\_security\_info($flags=0)

  Get information about the domain launch security policy. `$flags` is currently unused and defaults to zero. The returned hash may contain the following keys

  - Sys::Virt::Domain::LAUNCH\_SECURITY\_SEV\_MEASUREMENT

    The AMD SEV launch measurement

  - Sys::Virt::Domain::LAUNCH\_SECURITY\_SEV\_API\_MAJOR

    The host SEV API major version

  - Sys::Virt::Domain::LAUNCH\_SECURITY\_SEV\_API\_MINOR

    The host SEV API minor version

  - Sys::Virt::Domain::LAUNCH\_SECURITY\_SEV\_BUILD\_ID

    The host SEV firmware build ID

  - Sys::Virt::Domain::LAUNCH\_SECURITY\_SEV\_POLICY

    The guest SEV policy

  - Sys::Virt::Domain::LAUNCH\_SECURITY\_SEV\_SNP\_POLICY

    The guest SEV-SNP policy

- $dom-\>set\_launch\_security\_state(\\%params, $flags=0)

  Set information about the domain launch security state. `$flags` is currently unused and defaults to zero. The provided hash may contain the following keys

  - Sys::Virt::Domain::LAUNCH\_SECURITY\_SEV\_SECRET

    The SEV secret string to inject

  - Sys::Virt::Domain::LAUNCH\_SECURITY\_SEV\_SECRET\_HEADER

    The SEV secret header string to inject

  - Sys::Virt::Domain::LAUNCH\_SECURITY\_SEV\_SECRET\_SET\_ADDRESS

    The address at which to inject the SEV secret. If omitted it can be automatically determined from the firmware

- $info = $dom-\>get\_guest\_info($types, $flags=0)

  Get information about the domain guest configuration. The `$types` parameter determines what pieces of information are returned and should be the bitwise or of the following constants:

  - Sys::Virt::Domain::GUEST\_INFO\_USERS

    Active user information.

    The following keys will be used for the returned parameters

    - Sys::Virt::Domain::GUEST\_INFO\_USER\_COUNT

      The number of active users on this domain as an unsigned int.

    - Sys::Virt::Domain::GUEST\_INFO\_USER\_PREFIX

      The parameter name prefix to access each user entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the user suffix parameters to form a complete parameter name.

    - Sys::Virt::Domain::GUEST\_INFO\_USER\_SUFFIX\_NAME

      Username of the user as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_USER\_SUFFIX\_DOMAIN

      Domain of the user as a string (may only be present on certain guest types).

    - Sys::Virt::Domain::GUEST\_INFO\_USER\_SUFFIX\_LOGIN\_TIME

      The login time of a user in milliseconds since the epoch as unsigned long long.

  - Sys::Virt::Domain::GUEST\_INFO\_OS

    Misc operating system information.

    The following keys will be used for the returned parameters

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_ID

      A string identifying the operating system.

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_NAME

      The name of the operating system, suitable for presentation to a user, as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_PRETTY\_NAME

      A pretty name for the operating system, suitable for presentation to a user, as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_VERSION

      The version of the operating system suitable for presentation to a user, as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_VERSION\_ID

      The version id of the operating system suitable for processing by scripts, as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_KERNEL\_RELEASE

      The release of the operating system kernel, as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_KERNEL\_VERSION

      The version of the operating system kernel, as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_MACHINE

      The machine hardware name as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_VARIANT

      A specific variant or edition of the operating system suitable for presentation to a user, as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_OS\_VARIANT\_ID

      The id for a specific variant or edition of the operating system, as a string.

  - Sys::Virt::Domain::GUEST\_INFO\_TIMEZONE

    The guest timezone.

    The following keys will be used for the returned parameters

    - Sys::Virt::Domain::GUEST\_INFO\_TIMEZONE\_NAME

      The name of the timezone as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_TIMEZONE\_OFFSET

      The offset to UTC in seconds as an int.

  - Sys::Virt::Domain::GUEST\_INFO\_HOSTNAME

    The guest hostname.

    The following keys will be used for the returned parameters

    - Sys::Virt::Domain::GUEST\_INFO\_HOSTNAME\_HOSTNAME

      The hostname of the domain as a string.

  - Sys::Virt::Domain::GUEST\_INFO\_FILESYSTEM

    Filesystem mount information.

    The following keys will be used for the returned parameters

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_COUNT

      The number of filesystems defined on this domain as an unsigned int.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_PREFIX

      The parameter name prefix to access each filesystem entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the filesystem suffix parameters to form a complete parameter name.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_MOUNTPOINT

      The path to the mount point for the filesystem as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_NAME

      Device name in the guest (e.g. "sda1") as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_FSTYPE

      The type of filesystem as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_TOTAL\_BYTES

      The total size of the filesystem as an unsigned long long.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_USED\_BYTES

      The number of bytes used in the filesystem as an unsigned long long.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_DISK\_COUNT

      The number of disks targeted by this filesystem as an int.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_DISK\_PREFIX

      The parameter name prefix to access each disk entry. Concatenate the filesystem prefix, the filesystem entry number formatted as an unsigned integer, the disk prefix, the disk entry number formatted as an unsigned integer and one of the disk suffix parameters to form a complete parameter name.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_DISK\_SUFFIX\_ALIAS

      The device alias of the disk (e.g. sda) as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_DISK\_SUFFIX\_SERIAL

      The serial number of the disk as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_FS\_SUFFIX\_DISK\_SUFFIX\_DEVICE

      The device node of the disk as a string.

  - Sys::Virt::Domain::GUEST\_INFO\_DISKS

    Block device information.

    The following keys will be used for the returned parameters

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_COUNT

      The number of disks defined on this domain as an unsigned int.

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_PREFIX

      The parameter name prefix to access each disk entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the disk suffix parameters to form a complete parameter name.

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_SUFFIX\_NAME

      Device node (Linux) or device UNC (Windows) as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_SUFFIX\_PARTITION

      Whether this is a partition (true) or disk (false) as a boolean.

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_SUFFIX\_DEPENDENCY\_COUNT

      e.g. for LVs of the LVM this will hold the list of PVs, for LUKS encrypted volume this will contain the disk where the volume is placed. (Linux).

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_SUFFIX\_DEPENDENCY\_PREFIX

      The parameter name prefix to access each dependency entry. Concatenate the disk prefix, the disk entry number formatted as an unsigned integer, the dependency prefix, the dependency entry number formatted as an unsigned integer and one of the dependency suffix parameters to form a complete parameter name.

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_SUFFIX\_DEPENDENCY\_SUFFIX\_NAME

      A dependency name as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_SUFFIX\_SERIAL

      Optional disk serial number as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_SUFFIX\_ALIAS

      The device alias of the disk (e.g. sda) as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_SUFFIX\_GUEST\_ALIAS

      Optional alias assigned to the disk, on Linux this is a name assigned by device mapper, as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_DISK\_SUFFIX\_GUEST\_BUS

      Disk bus as reported by the guest OS.

  - Sys::Virt::Domain::GUEST\_INFO\_INTERFACES

    Network interfaces information.

    The following keys will be used for the returned parameters

    - Sys::Virt::Domain::GUEST\_INFO\_IF\_COUNT

      The number of interfaces defined on this domain as an unsigned int.

    - Sys::Virt::Domain::GUEST\_INFO\_IF\_PREFIX

      The parameter name prefix to access each interface entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the interface suffix parameters to form a complete parameter name.

    - Sys::Virt::Domain::GUEST\_INFO\_IF\_SUFFIX\_NAME

      Name in the guest (e.g. \`\`eth0\`\`) for the interface as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_IF\_SUFFIX\_HWADDR

      Hardware address in the guest of the interface as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_IF\_SUFFIX\_ADDR\_COUNT

      The number of IP addresses of interface as an unsigned int.

    - Sys::Virt::Domain::GUEST\_INFO\_IF\_SUFFIX\_ADDR\_PREFIX

      The parameter name prefix to access each address entry. Concatenate the interface prefix, the interface entry number formatted as an unsigned integer, the address prefix, the address entry number formatted as an unsigned integer and one of the address suffix parameters to form a complete parameter name.

    - Sys::Virt::Domain::GUEST\_INFO\_IF\_SUFFIX\_ADDR\_SUFFIX\_TYPE

      The IP address type (e.g. ipv4) as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_IF\_SUFFIX\_ADDR\_SUFFIX\_ADDR

      The IP address as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_IF\_SUFFIX\_ADDR\_SUFFIX\_PREFIX

      The prefix of IP address as an unsigned int.

  - Sys::Virt::Domain::GUEST\_INFO\_LOAD

    System load information.

    The following keys will be used for the returned parameters

    - Sys::Virt::Domain::GUEST\_INFO\_LOAD\_1M

      The guest load averaged over 1 minute as a double

    - Sys::Virt::Domain::GUEST\_INFO\_LOAD\_5M

      The guest load averaged over 5 minutes as a double

    - Sys::Virt::Domain::GUEST\_INFO\_LOAD\_15M

      The guest load averaged over 15 minutes as a double

  - Sys::Virt::Domain::GUEST\_INFO\_DEVICES

    Guest devices information.

    - Sys::Virt::Domain::GUEST\_INFO\_DEVICE\_COUNT

      The number of guest devices that detailed information is fetched for as unsigned int.

    - Sys::Virt::Domain::GUEST\_INFO\_DEVICE\_PREFIX

      The parameter name prefix to access each device entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the device suffix parameters to form a complete parameter name.

    - Sys::Virt::Domain::GUEST\_INFO\_DEVICE\_SUFFIX\_DRIVER\_DATE

      Driver release date in seconds since the epoch (e.g. 1736726400) as long long.

    - Sys::Virt::Domain::GUEST\_INFO\_DEVICE\_SUFFIX\_DRIVER\_NAME

      Name of the device driver (e.g. \`\`VirtIO Balloon Driver\`\`) as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_DEVICE\_SUFFIX\_DRIVER\_VERSION

      Driver version (e.g. \`\`100.100.104.27100\`\`) as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_DEVICE\_SUFFIX\_ID\_TYPE

      Device identification (e.g. \`\`pci\`\`) as a string.

    - Sys::Virt::Domain::GUEST\_INFO\_DEVICE\_SUFFIX\_PCI\_DEVICE

      PCI device (a device with GUEST\_INFO\_DEVICE\_SUFFIX\_ID\_TYPE equal to \`\`pci\`\`) device id (e.g. 4165) as a unsigned int.

    - Sys::Virt::Domain::GUEST\_INFO\_DEVICE\_SUFFIX\_PCI\_VENDOR

      PCI device (a device with GUEST\_INFO\_DEVICE\_SUFFIX\_ID\_TYPE equal to \`\`pci\`\`) vendor id (e.g. 6900) as a unsigned int.

  `$flags` is currently unused and defaults to zero.

- $dom-\>set\_agent\_response\_timeout($timeout, $flags=0)

  Set the amount of time to wait for the agent to respond to a command. `$timeout` is a positive integer representing the number of seconds to wait, or one of the constants:

  - Sys::Virt::Domain::AGENT\_RESPONSE\_TIMEOUT\_BLOCK

    Wait forever with no timeout

  - Sys::Virt::Domain::AGENT\_RESPONSE\_TIMEOUT\_NOWAIT

    Don't want at all, return immediately

  - Sys::Virt::Domain::AGENT\_RESPONSE\_TIMEOUT\_DEFAULT

    Use the hypervisor driver's default timeout

  The `$flags` parameter is currently unused and defaults to zero.

- my @keys = $dom-\>authorized\_ssh\_keys\_get($user, $flags=0)

  Retrieve the list of authorized SSH keys for the user account `$user`. The `$flags` parameter is currently unused and defaults to zero.

- $dom-\>authorized\_ssh\_keys\_set($user, \\@keys, $flags=0)

  Update the list of authorized SSH keys for the user account `$user`. The `@keys` parameter should be an array reference containing the new keys, if any. The default behaviour is to set the authorized SSH keys to the exact set specified in `@keys`. This can be modified via the `$flags` parameter which takes the following constants

  - Sys::Virt::Domain::AUTHORIZED\_SSH\_KEYS\_SET\_APPEND

    Append `@keys` to the current set of keys, rather than replacing the existing keys.

  - Sys::Virt::Domain::AUTHORIZED\_SSH\_KEYS\_SET\_REMOVE

    Remove `@keys` from the current set of keys, rather than replacing the existing keys. It is not an error if the keys do not exist.

- my @msgs = $dom-\>get\_messages($flags=0)

  Retrieve a list of messages associated with the domain. The optional `$flags` parameter can accept zero or more of

  - Sys::Virt::Domain::MESSAGE\_DEPRECATION

    Warnings about use of deprecated features

  - Sys::Virt::Domain::MESSAGE\_TAINTING

    Warnings about actions that have tainting the domain

  - Sys::Virt::Domain::MESSAGE\_IOERRORS

    Warnings about I/O errors that have occurred on the domain

- $dom-\>start\_dirty\_rate\_calc($dom, $secs, $flags=0)

  Request calculation of the domain's memory dirty rate over the next `$secs` seconds. `$flags` accepts one or more of

  - Sys::Virt::Domain::DIRTYRATE\_MODE\_PAGE\_SAMPLING

    Page sampling mode

  - Sys::Virt::Domain::DIRTYRATE\_MODE\_DIRTY\_BITMAP

    Dirty bitmap mode

  - Sys::Virt::Domain::DIRTYRATE\_MODE\_DIRTY\_RING

    Dirty ring mode

- $dom-\>fd\_associate($name, \\@fds, $flags=0)

  Associate a set of file descriptors in `@fds` with the domain, giving them the name `$name`. If `$flags` is non-zero, it can  take one or more of:

  - Sys::Virt::Domain::FD\_ASSOCIATE\_SECLABEL\_RESTORE

    Attempt to restore the label when shutting down

  - Sys::Virt::Domain::FD\_ASSOCIATE\_SECLABEL\_WRITABLE

    Label the FD to permit the guest to write to it.

- $dom-\>graphics\_reload($type, $flags=0)

  Request a reload of graphics backend state. The `$type` parameter specifies what type of graphics backend to reload if there are multiple present. It takes one of the constants:

  - Sys::Virt::Domain::GRAPHICS\_RELOAD\_TYPE\_ANY

    Reload state for any graphics backend type

  - Sys::Virt::Domain::GRAPHICS\_RELOAD\_TYPE\_VNC

    Reload state for only VNC graphics backends

  The `$flags` parameter is currently unused and defaults to zero.

- $dom-\>del\_throttle\_group($group, $flags=0)

  Delete an throttlegroup from the domain. The `$group` to be deleted must not have a throttlefilter associated with it and can be any of the current valid group.

- $dom-\>set\_throttle\_group($group, $params, $flags=0)

  Add throttlegroup or change all of the throttlegroup options within specific domain. The `$params` should be a hash reference whose keys are one of the BLKIO TUNING PARAMETERS constants.

- $dom-\>announce\_interface($device, $params, $flags=0)

  Cause this domain to "announce" its network interfaces by injecting a series of "gratuitous ARP" packets into the outgoing data stream for the interface matching `$device` (or all interfaces). This should cause local switches to direct traffic for that MAC address correctly after a topology change. The `$params` should be a hash reference whose keys are one of the INTERFACE ANNOUNCE PARAMETERS constants.

## CONSTANTS

A number of the APIs take a `"flags"` parameter. In most cases passing a value of zero will be satisfactory. Some APIs, however, accept named constants to alter their behaviour. This section documents the current known constants.

### DOMAIN STATE

The domain state constants are useful in interpreting the `"state"` key in the hash returned by the `"get_info"` method.

- Sys::Virt::Domain::STATE\_NOSTATE

  The domain is active, but is not running / blocked (e.g. idle)

- Sys::Virt::Domain::STATE\_RUNNING

  The domain is active and running

- Sys::Virt::Domain::STATE\_BLOCKED

  The domain is active, but execution is blocked

- Sys::Virt::Domain::STATE\_PAUSED

  The domain is active, but execution has been paused

- Sys::Virt::Domain::STATE\_SHUTDOWN

  The domain is active, but in the shutdown phase

- Sys::Virt::Domain::STATE\_SHUTOFF

  The domain is inactive, and shut down.

- Sys::Virt::Domain::STATE\_CRASHED

  The domain is inactive, and crashed.

- Sys::Virt::Domain::STATE\_PMSUSPENDED

  The domain is active, but in power management suspend state

### CONTROL INFO

The following constants can be used to determine what the guest domain control channel status is

- Sys::Virt::Domain::CONTROL\_ERROR

  The control channel has a fatal error

- Sys::Virt::Domain::CONTROL\_OK

  The control channel is ready for jobs

- Sys::Virt::Domain::CONTROL\_OCCUPIED

  The control channel is busy

- Sys::Virt::Domain::CONTROL\_JOB

  The control channel is busy with a job

If the status is `"Sys::Virt::Domain::CONTROL_ERROR"`, then one of the following constants describes the reason

- Sys::Virt::Domain::CONTROL\_ERROR\_REASON\_NONE

  There is no reason for the error available

- Sys::Virt::Domain::CONTROL\_ERROR\_REASON\_UNKNOWN

  The reason for the error is unknown

- Sys::Virt::Domain::CONTROL\_ERROR\_REASON\_INTERNAL

  There was an internal error in libvirt

- Sys::Virt::Domain::CONTROL\_ERROR\_REASON\_MONITOR

  There was an error speaking to the monitor

### DOMAIN CREATION

The following constants can be used to control the behaviour of domain creation

- Sys::Virt::Domain::START\_PAUSED

  Keep the guest vCPUs paused after starting the guest

- Sys::Virt::Domain::START\_AUTODESTROY

  Automatically destroy the guest when the connection is closed (or fails)

- Sys::Virt::Domain::START\_BYPASS\_CACHE

  Do not use OS I/O cache if starting a domain with a saved state image

- Sys::Virt::Domain::START\_FORCE\_BOOT

  Boot the guest, even if there was a saved snapshot

- Sys::Virt::Domain::START\_VALIDATE

  Validate the XML document against the XML schema

- Sys::Virt::Domain::START\_RESET\_NVRAM

  Reset the firmware NVRAM state from its original template

### DOMAIN DEFINE

The following constants can be used to control the behaviour of domain define operations

- Sys::Virt::Domain::DEFINE\_VALIDATE

  Validate the XML document against the XML schema

### KEYCODE SETS

The following constants define the set of supported keycode sets

- Sys::Virt::Domain::KEYCODE\_SET\_LINUX

  The Linux event subsystem keycodes

- Sys::Virt::Domain::KEYCODE\_SET\_XT

  The original XT keycodes

- Sys::Virt::Domain::KEYCODE\_SET\_ATSET1

  The AT Set1 keycodes (aka XT)

- Sys::Virt::Domain::KEYCODE\_SET\_ATSET2

  The AT Set2 keycodes (aka AT)

- Sys::Virt::Domain::KEYCODE\_SET\_ATSET3

  The AT Set3 keycodes (aka PS2)

- Sys::Virt::Domain::KEYCODE\_SET\_OSX

  The OS-X keycodes

- Sys::Virt::Domain::KEYCODE\_SET\_XT\_KBD

  The XT keycodes from the Linux Keyboard driver

- Sys::Virt::Domain::KEYCODE\_SET\_USB

  The USB HID keycode set

- Sys::Virt::Domain::KEYCODE\_SET\_WIN32

  The Windows keycode set

- Sys::Virt::Domain::KEYCODE\_SET\_QNUM

  The XT keycode set, with the extended scancodes using the high bit of the first byte, instead of the low bit of the second byte.

- Sys::Virt::Domain::KEYCODE\_SET\_RFB

  A deprecated alias for `"Sys::Virt::Domain::KEYCODE_SET_QNUM"`

### MEMORY PEEK

The following constants can be used with the `"memory_peek"` method's flags parameter

- Sys::Virt::Domain::MEMORY\_VIRTUAL

  Indicates that the offset is using virtual memory addressing.

- Sys::Virt::Domain::MEMORY\_PHYSICAL

  Indicates that the offset is using physical memory addressing.

### VCPU STATE

The following constants are useful when interpreting the virtual CPU run state

- Sys::Virt::Domain::VCPU\_OFFLINE

  The virtual CPU is not online

- Sys::Virt::Domain::VCPU\_RUNNING

  The virtual CPU is executing code

- Sys::Virt::Domain::VCPU\_BLOCKED

  The virtual CPU is waiting to be scheduled

### VCPU HOST PLACEMENT STATE

The following constants are useful when interpreting the virtual CPU host placement

- Sys::Virt::Domain::VCPU\_INFO\_CPU\_OFFLINE

  The virtual CPU is not online

- Sys::Virt::Domain::VCPU\_INFO\_CPU\_UNAVAILABLE

  The virtual CPU placement is not available from this hypervisor

### OPEN GRAPHICS CONSTANTS

The following constants are used when opening a connection to the guest graphics server

- Sys::Virt::Domain::OPEN\_GRAPHICS\_SKIPAUTH

  Skip authentication of the client

### OPEN CONSOLE CONSTANTS

The following constants are used when opening a connection to the guest console

- Sys::Virt::Domain::OPEN\_CONSOLE\_FORCE

  Force opening of the console, disconnecting any other open session

- Sys::Virt::Domain::OPEN\_CONSOLE\_SAFE

  Check if the console driver supports safe operations

### OPEN CHANNEL CONSTANTS

The following constants are used when opening a connection to the guest channel

- Sys::Virt::Domain::OPEN\_CHANNEL\_FORCE

  Force opening of the channel, disconnecting any other open session

### XML DUMP OPTIONS

The following constants are used to control the information included in the XML configuration dump

- Sys::Virt::Domain::XML\_INACTIVE

  Report the persistent inactive configuration for the guest, even if it is currently running.

- Sys::Virt::Domain::XML\_SECURE

  Include security sensitive information in the XML dump, such as passwords.

- Sys::Virt::Domain::XML\_UPDATE\_CPU

  Update the CPU model definition to match the current executing state.

- Sys::Virt::Domain::XML\_MIGRATABLE

  Update the XML to allow migration to older versions of libvirt

### DEVICE HOTPLUG OPTIONS

The following constants are used to control device hotplug operations

- Sys::Virt::Domain::DEVICE\_MODIFY\_CURRENT

  Modify the domain in its current state

- Sys::Virt::Domain::DEVICE\_MODIFY\_LIVE

  Modify only the live state of the domain

- Sys::Virt::Domain::DEVICE\_MODIFY\_CONFIG

  Modify only the persistent config of the domain

- Sys::Virt::Domain::DEVICE\_MODIFY\_FORCE

  Force the device to be modified

### MEMORY OPTIONS

The following constants are used to control memory change operations

- Sys::Virt::Domain::MEM\_CURRENT

  Modify the current state

- Sys::Virt::Domain::MEM\_LIVE

  Modify only the live state of the domain

- Sys::Virt::Domain::MEM\_CONFIG

  Modify only the persistent config of the domain

- Sys::Virt::Domain::MEM\_MAXIMUM

  Modify the maximum memory value

### CONFIG OPTIONS

The following constants are used to control what configuration a domain update changes

- Sys::Virt::Domain::AFFECT\_CURRENT

  Modify the current state

- Sys::Virt::Domain::AFFECT\_LIVE

  Modify only the live state of the domain

- Sys::Virt::Domain::AFFECT\_CONFIG

  Modify only the persistent config of the domain

### SETVCPU OPTIONS

The following constants are used to control what setting vCPUs changes.

- Sys::Virt::Domain::SETVCPU\_AFFECT\_CURRENT

  Modify the current state

- Sys::Virt::Domain::SETVCPU\_AFFECT\_LIVE

  Modify only the live state of the domain

- Sys::Virt::Domain::SETVCPU\_AFFECT\_CONFIG

  Modify only the persistent config of the domain

- Sys::Virt::Domain::SETVCPU\_ASYNC\_UNPLUG

  Do not wait for the guest to comply with the request

### MIGRATE OPTIONS

The following constants are used to control how migration is performed

- Sys::Virt::Domain::MIGRATE\_LIVE

  Migrate the guest without interrupting its execution on the source host.

- Sys::Virt::Domain::MIGRATE\_PEER2PEER

  Manage the migration process over a direct peer-2-peer connection between the source and destination host libvirtd daemons.

- Sys::Virt::Domain::MIGRATE\_TUNNELLED

  Tunnel the migration data over the libvirt daemon connection, rather than the native hypervisor data transport. Requires PEER2PEER flag to be set.

- Sys::Virt::Domain::MIGRATE\_PERSIST\_DEST

  Make the domain persistent on the destination host, defining its configuration file upon completion of migration.

- Sys::Virt::Domain::MIGRATE\_UNDEFINE\_SOURCE

  Remove the domain's persistent configuration after migration completes successfully.

- Sys::Virt::Domain::MIGRATE\_PAUSED

  Do not re-start execution of the guest CPUs on the destination host after migration completes.

- Sys::Virt::Domain::MIGRATE\_NON\_SHARED\_DISK

  Copy the complete contents of the disk images during migration

- Sys::Virt::Domain::MIGRATE\_NON\_SHARED\_INC

  Copy the incrementally changed contents of the disk images during migration

- Sys::Virt::Domain::MIGRATE\_CHANGE\_PROTECTION

  Do not allow changes to the virtual domain configuration while migration is taking place. This option is automatically implied if doing a peer-2-peer migration.

- Sys::Virt::Domain::MIGRATE\_UNSAFE

  Migrate even if the compatibility check indicates the migration will be unsafe to the guest.

- Sys::Virt::Domain::MIGRATE\_OFFLINE

  Migrate the guest config if the guest is not currently running

- Sys::Virt::Domain::MIGRATE\_COMPRESSED

  Enable compression of the migration data stream

- Sys::Virt::Domain::MIGRATE\_ABORT\_ON\_ERROR

  Abort if an I/O error occurs on the disk

- Sys::Virt::Domain::MIGRATE\_AUTO\_CONVERGE

  Force convergence of the migration operation by throttling guest runtime

- Sys::Virt::Domain::MIGRATE\_RDMA\_PIN\_ALL

  Pin memory for RDMA transfer

- Sys::Virt::Domain::MIGRATE\_POSTCOPY

  Enable support for post-copy migration

- Sys::Virt::Domain::MIGRATE\_TLS

  Setting this flag will cause the migration to attempt to use the TLS environment configured by the hypervisor in order to perform the migration. If incorrectly configured on either source or destination, the migration will fail.

- Sys::Virt::Domain::MIGRATE\_PARALLEL

  Send memory pages to the destination host through several network connections. See `"Sys::Virt::Domain::MIGRATE_PARAM_PARALLEL_*"` parameters for configuring the parallel migration.

- Sys::Virt::Domain::MIGRATE\_NON\_SHARED\_SYNCHRONOUS\_WRITES

  Force the guest writes which happen when copying disk images for non-shared storage migration to be synchronously written to the destination. This ensures the storage migration converges for VMs doing heavy I/O on fast local storage and slow mirror.

- Sys::Virt::Domain::MIGRATE\_POSTCOPY\_RESUME

  Resume migration which failed in post-copy phase.

- Sys::Virt::Domain::MIGRATE\_ZEROCOPY

  Attempt to avoid copying data. This is a request, not a guarantee and may apply to either one or both directions of data transfer at discretion of the hypervisor implementation.

### UNDEFINE CONSTANTS

The following constants can be used when undefining virtual domain configurations

- Sys::Virt::Domain::UNDEFINE\_MANAGED\_SAVE

  Also remove any managed save image when undefining the virtual domain

- Sys::Virt::Domain::UNDEFINE\_SNAPSHOTS\_METADATA

  Also remove any snapshot metadata when undefining the virtual domain.

- Sys::Virt::Domain::UNDEFINE\_NVRAM

  Also remove any NVRAM state file when undefining the virtual domain.

- Sys::Virt::Domain::UNDEFINE\_KEEP\_NVRAM

  keep NVRAM state file when undefining the virtual domain.

- Sys::Virt::Domain::UNDEFINE\_CHECKPOINTS\_METADATA

  Also remove any checkpoint metadata when undefining the virtual domain.

- Sys::Virt::Domain::UNDEFINE\_TPM

  Also remove any TPM state when undefining the virtual domain.

- Sys::Virt::Domain::UNDEFINE\_KEEP\_TPM

  Keep TPM state when undefining the virtual domain.

### JOB TYPES

The following constants describe the different background job types.

- Sys::Virt::Domain::JOB\_NONE

  No job is active

- Sys::Virt::Domain::JOB\_BOUNDED

  A job with a finite completion time is active

- Sys::Virt::Domain::JOB\_UNBOUNDED

  A job with an unbounded completion time is active

- Sys::Virt::Domain::JOB\_COMPLETED

  The job has finished, but isn't cleaned up

- Sys::Virt::Domain::JOB\_FAILED

  The job has hit an error, but isn't cleaned up

- Sys::Virt::Domain::JOB\_CANCELLED

  The job was aborted at user request, but isn't cleaned up

### MEMORY PARAMETERS

The following constants are useful when getting/setting memory parameters for guests

- Sys::Virt::Domain::MEMORY\_HARD\_LIMIT

  The maximum memory the guest can use.

- Sys::Virt::Domain::MEMORY\_SOFT\_LIMIT

  The memory upper limit enforced during memory contention.

- Sys::Virt::Domain::MEMORY\_MIN\_GUARANTEE

  The minimum memory guaranteed to be reserved for the guest.

- Sys::Virt::Domain::MEMORY\_SWAP\_HARD\_LIMIT

  The maximum swap the guest can use.

- Sys::Virt::Domain::MEMORY\_PARAM\_UNLIMITED

  The value of an unlimited memory parameter

### BLKIO PARAMETERS

The following parameters control I/O tuning for the domain as a whole

- Sys::Virt::Domain::BLKIO\_WEIGHT

  The I/O weight parameter

- Sys::Virt::Domain::BLKIO\_DEVICE\_WEIGHT

  The per-device I/O weight parameter

- Sys::Virt::Domain::BLKIO\_DEVICE\_READ\_BPS

  The per-device I/O bytes read per second

- Sys::Virt::Domain::BLKIO\_DEVICE\_READ\_IOPS

  The per-device I/O operations read per second

- Sys::Virt::Domain::BLKIO\_DEVICE\_WRITE\_BPS

  The per-device I/O bytes write per second

- Sys::Virt::Domain::BLKIO\_DEVICE\_WRITE\_IOPS

  The per-device I/O operations write per second

### BLKIO TUNING PARAMETERS

The following parameters control I/O tuning for an individual guest disk.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_TOTAL\_BYTES\_SEC

  The total bytes processed per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_READ\_BYTES\_SEC

  The bytes read per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_WRITE\_BYTES\_SEC

  The bytes written per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_TOTAL\_IOPS\_SEC

  The total I/O operations processed per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_READ\_IOPS\_SEC

  The I/O operations read per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_WRITE\_IOPS\_SEC

  The I/O operations written per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_TOTAL\_BYTES\_SEC\_MAX

  The maximum total bytes processed per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_READ\_BYTES\_SEC\_MAX

  The maximum bytes read per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_WRITE\_BYTES\_SEC\_MAX

  The maximum bytes written per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_TOTAL\_IOPS\_SEC\_MAX

  The maximum total I/O operations processed per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_READ\_IOPS\_SEC\_MAX

  The maximum I/O operations read per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_WRITE\_IOPS\_SEC\_MAX

  The maximum I/O operations written per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_SIZE\_IOPS\_SEC

  The maximum I/O operations per second

- Sys::Virt::Domain::BLOCK\_IOTUNE\_GROUP\_NAME

  A string representing a group name to allow sharing of I/O throttling quota between multiple drives

- Sys::Virt::Domain::BLOCK\_IOTUNE\_TOTAL\_BYTES\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum total bytes processed per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_READ\_BYTES\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum bytes read per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_WRITE\_BYTES\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum bytes written per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_TOTAL\_IOPS\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum total I/O operations processed per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_READ\_IOPS\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum I/O operations read per second.

- Sys::Virt::Domain::BLOCK\_IOTUNE\_WRITE\_IOPS\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum I/O operations written per second.

### SCHEDULER CONSTANTS

- Sys::Virt::Domain::SCHEDULER\_CAP

  The VM cap tunable

- Sys::Virt::Domain::SCHEDULER\_CPU\_SHARES

  The CPU shares tunable

- Sys::Virt::Domain::SCHEDULER\_LIMIT

  The VM limit tunable

- Sys::Virt::Domain::SCHEDULER\_RESERVATION

  The VM reservation tunable

- Sys::Virt::Domain::SCHEDULER\_SHARES

  The VM shares tunable

- Sys::Virt::Domain::SCHEDULER\_VCPU\_PERIOD

  The VCPU period tunable

- Sys::Virt::Domain::SCHEDULER\_VCPU\_QUOTA

  The VCPU quota tunable

- Sys::Virt::Domain::SCHEDULER\_GLOBAL\_PERIOD

  The VM global period tunable

- Sys::Virt::Domain::SCHEDULER\_GLOBAL\_QUOTA

  The VM global quota tunable

- Sys::Virt::Domain::SCHEDULER\_WEIGHT

  The VM weight tunable

### NUMA PARAMETERS

The following constants are useful when getting/setting the guest NUMA memory policy

- Sys::Virt::Domain::NUMA\_MODE

  The NUMA policy mode

- Sys::Virt::Domain::NUMA\_NODESET

  The NUMA nodeset mask

The following constants are useful when interpreting the `"Sys::Virt::Domain::NUMA_MODE"` parameter value

- Sys::Virt::Domain::NUMATUNE\_MEM\_STRICT

  Allocation is mandatory from the mask nodes

- Sys::Virt::Domain::NUMATUNE\_MEM\_PREFERRED

  Allocation is preferred from the masked nodes

- Sys::Virt::Domain::NUMATUNE\_MEM\_INTERLEAVE

  Allocation is interleaved across all masked nodes

- Sys::Virt::Domain::NUMATUNE\_MEM\_RESTRICTIVE

  Allocation is determined by the host using the masked nodes.

### INTERFACE PARAMETERS

The following constants are useful when getting/setting the per network interface tunable parameters

- Sys::Virt::Domain::BANDWIDTH\_IN\_AVERAGE

  The average inbound bandwidth

- Sys::Virt::Domain::BANDWIDTH\_IN\_PEAK

  The peak inbound bandwidth

- Sys::Virt::Domain::BANDWIDTH\_IN\_BURST

  The burstable inbound bandwidth

- Sys::Virt::Domain::BANDWIDTH\_IN\_FLOOR

  The minimum inbound bandwidth

- Sys::Virt::Domain::BANDWIDTH\_OUT\_AVERAGE

  The average outbound bandwidth

- Sys::Virt::Domain::BANDWIDTH\_OUT\_PEAK

  The peak outbound bandwidth

- Sys::Virt::Domain::BANDWIDTH\_OUT\_BURST

  The burstable outbound bandwidth

### INTERFACE ANNOUNCE PARAMETERS

The following constants are useful when calling the `"Sys::Virt::Domain::announce_interface"` function.

- Sys::Virt::Domain::ANNOUNCE\_INTERFACE\_INITIAL

  Initial delay in milliseconds before the first announce packet is sent.

- Sys::Virt::Domain::ANNOUNCE\_INTERFACE\_MAX

  Maximum delay in milliseconds between packets.

- Sys::Virt::Domain::ANNOUNCE\_INTERFACE\_ROUNDS

  The number of packets to send.

- Sys::Virt::Domain::ANNOUNCE\_INTERFACE\_STEP

  Increment added to the delay (in milliseconds) after each packet is sent.

### PERF EVENTS

The following constants defined performance events which can be monitored for a guest

- Sys::Virt::Domain::PERF\_PARAM\_CMT

  The CMT event counter which can be used to measure the usage of cache (bytes) by applications running on the platform. It corresponds to the "perf.cmt" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_MBML

  The MBML event counter which can be used to monitor the amount of data (bytes/s) sent through the memory controller on the socket. It corresponds to the "perf.mbml" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_MBMT

  The MBMT event counter which can be used to monitor total system bandwidth (bytes/s) from one level of cache to another. It corresponds to the "perf.mbmt" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_CACHE\_MISSES

  The cache\_misses perf event counter which can be used to measure the count of cache misses by applications running on the platform. It corresponds to the "perf.cache\_misses" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_CACHE\_REFERENCES

  The cache\_references perf event counter which can be used to measure the count of cache hits by applications running on the platform. It corresponds to the "perf.cache\_references" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_CPU\_CYCLES

  The cpu\_cycles perf event counter which can be used to measure how many cpu cycles one instruction needs.  It corresponds to the "perf.cpu\_cycles" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_INSTRUCTIONS

  The instructions perf event counter which can be used to measure the count of instructions by applications running on the platform. It corresponds to the "perf.instructions" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_BRANCH\_INSTRUCTIONS

  The branch\_instructions perf event counter which can be used to measure the count of instructions by applications running on the platform. It corresponds to the "perf.branch\_instructions" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_BRANCH\_MISSES

  The branch\_misses perf event which can be used to measure the count of branch misses by applications running on the platform. It corresponds to the "perf.branch\_misses" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_BUS\_CYCLES

  The bus\_cycles perf event counter which can be used to measure the count of bus cycles by applications running on the platform. It corresponds to the "perf.bus\_cycles" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_STALLED\_CYCLES\_FRONTEND

  The stalled\_cycles\_frontend perf event counter which can be used to measure the count of stalled cpu cycles in the frontend of the instruction processor pipeline by applications running on the platform. It corresponds to the "perf.stalled\_cycles\_frontend" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_STALLED\_CYCLES\_BACKEND

  The stalled\_cycles\_backend perf event counter which can be used to measure the count of stalled cpu cycles in the backend of the instruction processor pipeline by application running on the platform. It corresponds to the "perf.stalled\_cycles\_backend" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_REF\_CPU\_CYCLES

  The ref\_cpu\_cycles perf event counter which can be used to measure the count of total cpu cycles not affected by CPU frequency scaling by applications running on the platform. It corresponds to the "perf.ref\_cpu\_cycles" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_CPU\_CLOCK

  The cpu\_clock perf event counter which can be used to measure the count of cpu clock time by applications running on the platform. It corresponds to the "perf.cpu\_clock" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_TASK\_CLOCK

  The task\_clock perf event counter which can be used to measure the count of task clock time by applications running on the platform. It corresponds to the "perf.task\_clock" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_PAGE\_FAULTS

  The page\_faults perf event counter which can be used to measure the count of page faults by applications running on the platform. It corresponds to the "perf.page\_faults" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_CONTEXT\_SWITCHES

  The context\_switches perf event counter which can be used to measure the count of context switches by applications running on the platform. It corresponds to the "perf.context\_switches" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_CPU\_MIGRATIONS

  The cpu\_migrations perf event counter which can be used to measure the count of cpu migrations by applications running on the platform. It corresponds to the "perf.cpu\_migrations" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_PAGE\_FAULTS\_MIN

  The page\_faults\_min perf event counter which can be used to measure the count of minor page faults by applications running on the platform. It corresponds to the "perf.page\_faults\_min" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_PAGE\_FAULTS\_MAJ

  The page\_faults\_maj perf event counter which can be used to measure the count of major page faults by applications running on the platform. It corresponds to the "perf.page\_faults\_maj" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_ALIGNMENT\_FAULTS

  The alignment\_faults perf event counter which can be used to measure the count of alignment faults by applications running on the platform. It corresponds to the "perf.alignment\_faults" field in the \*Stats APIs.

- Sys::Virt::Domain::PERF\_PARAM\_EMULATION\_FAULTS

  The emulation\_faults perf event counter which can be used to measure the count of emulation faults by applications running on the platform. It corresponds to the "perf.emulation\_faults" field in the \*Stats APIs.

### IOTHREAD STATS

The following constants defined IOThread statistics which can be monitored for a guest

- Sys::Virt::Domain::IOTHREAD\_PARAM\_POLL\_MAX\_NS

  The maximum polling time that can be used by polling algorithm in ns. The polling time starts at 0 (zero) and is the time spent by the guest to process IOThread data before returning the CPU to the host. The polling time will be dynamically modified over time based on the poll\_grow and poll\_shrink parameters provided.

- Sys::Virt::Domain::IOTHREAD\_PARAM\_POLL\_GROW

  This provides a value for the dynamic polling adjustment algorithm to use to grow its polling interval up to the poll\_max\_ns value.

- Sys::Virt::Domain::IOTHREAD\_PARAM\_POLL\_SHRINK

  This provides a value for the dynamic polling adjustment algorithm to use to shrink its polling interval when the polling interval exceeds the poll\_max\_ns value.

- Sys::Virt::Domain::IOTHREAD\_PARAM\_POLL\_WEIGHT

  This provides a shift value for the adaptive polling algorithm to control how much the most recent event interval affects the next polling duration calculation. Larger values decrease the weight of the current interval, enabling more gradual adjustments. Valid range is 0-63. A value of 0 lets the hypervisor select a default weight.

- Sys::Virt::Domain::IOTHREAD\_PARAM\_THREAD\_POOL\_MIN

  Sets the lower bound for thread pool size. A value of -1 disables this bound leaving hypervisor use its default value, though this value is not accepted for running domains. Due to internal implementation it's recommended to set lower and upper bounds separately.

- Sys::Virt::Domain::IOTHREAD\_PARAM\_THREAD\_POOL\_MAX

  Sets the upper bound for thread pool size. A value of -1 disables this bound leaving hypervisor use its default value, though this value is not accepted for running domains. Since the upper band has to be equal to or greater than lower bound value of 0 is not accepted. Due to internal implementation it's recommended to set lower and upper bounds separately.

### VCPU FLAGS

The following constants are useful when getting/setting the VCPU count for a guest

- Sys::Virt::Domain::VCPU\_LIVE

  Flag to request the live value

- Sys::Virt::Domain::VCPU\_CONFIG

  Flag to request the persistent config value

- Sys::Virt::Domain::VCPU\_CURRENT

  Flag to request the current config value

- Sys::Virt::Domain::VCPU\_MAXIMUM

  Flag to request adjustment of the maximum vCPU value

- Sys::Virt::Domain::VCPU\_GUEST

  Flag to request the guest VCPU mask

- Sys::Virt::Domain::VCPU\_HOTPLUGGABLE

  Flag to make vcpus added hot(un)pluggable

- Sys::Virt::Domain::VCPU\_ASYNC\_UNPLUG

  Flag to not wait for the guest to comply with unplug request(s)

### STATE CHANGE EVENTS

The following constants allow domain state change events to be interpreted. The events contain both a state change, and a reason.

- Sys::Virt::Domain::EVENT\_DEFINED

  Indicates that a persistent configuration has been defined for the domain.

  - Sys::Virt::Domain::EVENT\_DEFINED\_ADDED

    The defined configuration is newly added

  - Sys::Virt::Domain::EVENT\_DEFINED\_UPDATED

    The defined configuration is an update to an existing configuration

  - Sys::Virt::Domain::EVENT\_DEFINED\_RENAMED

    The defined configuration is a rename of an existing configuration

  - Sys::Virt::Domain::EVENT\_DEFINED\_FROM\_SNAPSHOT

    The defined configuration was restored from a snapshot

- Sys::Virt::Domain::EVENT\_RESUMED

  The domain has resumed execution

  - Sys::Virt::Domain::EVENT\_RESUMED\_MIGRATED

    The domain resumed because migration has completed. This is emitted on the destination host.

  - Sys::Virt::Domain::EVENT\_RESUMED\_UNPAUSED

    The domain resumed because the admin unpaused it.

  - Sys::Virt::Domain::EVENT\_RESUMED\_FROM\_SNAPSHOT

    The domain resumed because it was restored from a snapshot

  - Sys::Virt::Domain::EVENT\_RESUMED\_POSTCOPY

    The domain resumed but post-copy is running in background

  - Sys::Virt::Domain::EVENT\_RESUMED\_POSTCOPY\_FAILED

    The domain is running, but migration failed in post-copy.

- Sys::Virt::Domain::EVENT\_STARTED

  The domain has started running

  - Sys::Virt::Domain::EVENT\_STARTED\_BOOTED

    The domain was booted from shutoff state

  - Sys::Virt::Domain::EVENT\_STARTED\_MIGRATED

    The domain started due to an incoming migration

  - Sys::Virt::Domain::EVENT\_STARTED\_RESTORED

    The domain was restored from saved state file

  - Sys::Virt::Domain::EVENT\_STARTED\_FROM\_SNAPSHOT

    The domain was restored from a snapshot

  - Sys::Virt::Domain::EVENT\_STARTED\_WAKEUP

    The domain was woken up from suspend

  - Sys::Virt::Domain::EVENT\_STARTED\_RECREATED

    The secure domain started after being recreated for a reboot

- Sys::Virt::Domain::EVENT\_STOPPED

  The domain has stopped running

  - Sys::Virt::Domain::EVENT\_STOPPED\_CRASHED

    The domain stopped because guest operating system has crashed

  - Sys::Virt::Domain::EVENT\_STOPPED\_DESTROYED

    The domain stopped because administrator issued a destroy command.

  - Sys::Virt::Domain::EVENT\_STOPPED\_FAILED

    The domain stopped because of a fault in the host virtualization environment.

  - Sys::Virt::Domain::EVENT\_STOPPED\_MIGRATED

    The domain stopped because it was migrated to another machine.

  - Sys::Virt::Domain::EVENT\_STOPPED\_SAVED

    The domain was saved to a state file

  - Sys::Virt::Domain::EVENT\_STOPPED\_SHUTDOWN

    The domain stopped due to graceful shutdown of the guest.

  - Sys::Virt::Domain::EVENT\_STOPPED\_FROM\_SNAPSHOT

    The domain was stopped due to a snapshot

  - Sys::Virt::Domain::EVENT\_STOPPED\_RECREATED

    The secure domain stopped to be recreated for a reboot

- Sys::Virt::Domain::EVENT\_SHUTDOWN

  The domain has shutdown but is not yet stopped

  - Sys::Virt::Domain::EVENT\_SHUTDOWN\_FINISHED

    The domain finished shutting down

  - Sys::Virt::Domain::EVENT\_SHUTDOWN\_HOST

    The domain shutdown due to host trigger

  - Sys::Virt::Domain::EVENT\_SHUTDOWN\_GUEST

    The domain shutdown due to guest trigger

- Sys::Virt::Domain::EVENT\_SUSPENDED

  The domain has stopped executing, but still exists

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_MIGRATED

    The domain has been suspended due to offline migration

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_PAUSED

    The domain has been suspended due to administrator pause request.

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_IOERROR

    The domain has been suspended due to a block device I/O error.

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_FROM\_SNAPSHOT

    The domain has been suspended due to resume from snapshot

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_WATCHDOG

    The domain has been suspended due to the watchdog triggering

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_RESTORED

    The domain has been suspended due to restore from saved state

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_API\_ERROR

    The domain has been suspended due to an API error

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_POSTCOPY

    The domain has been suspended for post-copy migration

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_POSTCOPY\_FAILED

    The domain has been suspended due post-copy migration failing

  - Sys::Virt::Domain::EVENT\_SUSPENDED\_GUEST\_SHUTDOWN

    The domain has been suspended after guest os shut-down (a long running job is preserving the VM until completion)

- Sys::Virt::Domain::EVENT\_UNDEFINED

  The persistent configuration has gone away

  - Sys::Virt::Domain::EVENT\_UNDEFINED\_REMOVED

    The domain configuration has gone away due to it being removed by administrator.

  - Sys::Virt::Domain::EVENT\_UNDEFINED\_RENAMED

    The undefined configuration is a rename of an existing configuration

- Sys::Virt::Domain::EVENT\_PMSUSPENDED

  The domain has stopped running

  - Sys::Virt::Domain::EVENT\_PMSUSPENDED\_MEMORY

    The domain has suspend to RAM.

  - Sys::Virt::Domain::EVENT\_PMSUSPENDED\_DISK

    The domain has suspend to Disk.

- Sys::Virt::Domain::EVENT\_CRASHED

  The domain has crashed

  - Sys::Virt::Domain::EVENT\_CRASHED\_PANICKED

    The domain has crashed due to a kernel panic

  - Sys::Virt::Domain::EVENT\_CRASHED\_CRASHLOADED

    The domain has crashed and reloaded itself

### EVENT ID CONSTANTS

- Sys::Virt::Domain::EVENT\_ID\_LIFECYCLE

  Domain lifecycle events

- Sys::Virt::Domain::EVENT\_ID\_REBOOT

  Soft / warm reboot events

- Sys::Virt::Domain::EVENT\_ID\_RTC\_CHANGE

  RTC clock adjustments

- Sys::Virt::Domain::EVENT\_ID\_IO\_ERROR

  File IO errors, typically from disks

- Sys::Virt::Domain::EVENT\_ID\_WATCHDOG

  Watchdog device triggering

- Sys::Virt::Domain::EVENT\_ID\_GRAPHICS

  Graphics client connections.

- Sys::Virt::Domain::EVENT\_ID\_IO\_ERROR\_REASON

  File IO errors, typically from disks, with a root cause

- Sys::Virt::Domain::EVENT\_ID\_CONTROL\_ERROR

  Errors from the virtualization control channel

- Sys::Virt::Domain::EVENT\_ID\_BLOCK\_JOB

  Completion status of asynchronous block jobs, identified by source file name.

- Sys::Virt::Domain::EVENT\_ID\_BLOCK\_JOB\_2

  Completion status of asynchronous block jobs, identified by target device name.

- Sys::Virt::Domain::EVENT\_ID\_DISK\_CHANGE

  Changes in disk media

- Sys::Virt::Domain::EVENT\_ID\_TRAY\_CHANGE

  CDROM media tray state

- Sys::Virt::Domain::EVENT\_ID\_PMSUSPEND

  Power management initiated suspend to RAM

- Sys::Virt::Domain::EVENT\_ID\_PMSUSPEND\_DISK

  Power management initiated suspend to Disk

- Sys::Virt::Domain::EVENT\_ID\_PMWAKEUP

  Power management initiated wakeup

- Sys::Virt::Domain::EVENT\_ID\_BALLOON\_CHANGE

  Balloon target changes

- Sys::Virt::Domain::EVENT\_ID\_DEVICE\_ADDED

  Asynchronous guest device addition

- Sys::Virt::Domain::EVENT\_ID\_DEVICE\_REMOVED

  Asynchronous guest device removal

- Sys::Virt::Domain::EVENT\_ID\_TUNABLE

  Changes of any domain tuning parameters. The callback will be provided with a hash listing all changed parameters. The later DOMAIN TUNABLE constants can be useful when accessing the hash keys

- Sys::Virt::Domain::EVENT\_ID\_AGENT\_LIFECYCLE

  Domain guest agent lifecycle events. The `"state"` parameter to the callback will match one of the constants

  - Sys::Virt::Domain::EVENT\_AGENT\_LIFECYCLE\_STATE\_CONNECTED

    The agent is now connected

  - Sys::Virt::Domain::EVENT\_AGENT\_LIFECYCLE\_STATE\_DISCONNECTED

    The agent is now disconnected

  The second parameter, `"reason"`, matches one of the following constants

  - Sys::Virt::Domain::EVENT\_AGENT\_LIFECYCLE\_REASON\_UNKNOWN

    The reason is unknown

  - Sys::Virt::Domain::EVENT\_AGENT\_LIFECYCLE\_REASON\_DOMAIN\_STARTED

    The domain was initially booted

  - Sys::Virt::Domain::EVENT\_AGENT\_LIFECYCLE\_REASON\_CHANNEL

    The channel on a running guest changed state

- Sys::Virt::Domain::EVENT\_ID\_MIGRATION\_ITERATION

  Domain migration progress iteration. The `"iteration"` parameter to the callback will specify the number of iterations migration has made over guest RAM.

- Sys::Virt::Domain::EVENT\_ID\_JOB\_COMPLETED

  Domain background job completion notification. The callback provides a hash containing the job stats. The keys in the hash are the same as those used with the `Sys::Virt::Domain::get_job_stats()` method.

- Sys::Virt::Domain::EVENT\_ID\_DEVICE\_REMOVAL\_FAILED

  Guest device removal has failed.

- Sys::Virt::Domain::EVENT\_ID\_METADATA\_CHANGE

  The domain metadata has changed

- Sys::Virt::Domain::EVENT\_ID\_BLOCK\_THRESHOLD

  The event occurs when the hypervisor detects that the given storage element was written beyond the point specified by threshold. The event is useful for thin-provisioned storage.

- Sys::Virt::Domain::EVENT\_ID\_MEMORY\_FAILURE

  The event occurs when the hypervisor detects hardware memory corruption.

- Sys::Virt::Domain::EVENT\_ID\_MEMORY\_DEVICE\_SIZE\_CHANGE

  The event occurs when the guest accepts a request to change the memory device size.

- Sys::Virt::Domain::EVENT\_ID\_NIC\_MAC\_CHANGE

  The event occurs when the guest changes MAC address on one of its virtual network interfaces.

- Sys::Virt::Domain::EVENT\_ID\_VCPU\_REMOVED

  This event occurs when a vCPU is removed from the domain.

- Sys::Virt::Domain::EVENT\_ID\_CHANNEL\_LIFECYCLE

  Domain channel lifecycle events. The `"state"` parameter to the callback will match one of the constants

  - Sys::Virt::Domain::EVENT\_CHANNEL\_LIFECYCLE\_STATE\_CONNECTED

    The channel is now connected

  - Sys::Virt::Domain::EVENT\_CHANNEL\_LIFECYCLE\_STATE\_DISCONNECTED

    The channel is now disconnected

  The second parameter, `"reason"`, matches one of the following constants

  - Sys::Virt::Domain::EVENT\_CHANNEL\_LIFECYCLE\_REASON\_UNKNOWN

    The reason is unknown

  - Sys::Virt::Domain::EVENT\_CHANNEL\_LIFECYCLE\_REASON\_DOMAIN\_STARTED

    The domain was initially booted

  - Sys::Virt::Domain::EVENT\_CHANNEL\_LIFECYCLE\_REASON\_CHANNEL

    The channel on a running guest changed state

### IO ERROR EVENT CONSTANTS

These constants describe what action was taken due to the IO error.

- Sys::Virt::Domain::EVENT\_IO\_ERROR\_NONE

  No action was taken, the error was ignored & reported as success to guest

- Sys::Virt::Domain::EVENT\_IO\_ERROR\_PAUSE

  The guest is paused since the error occurred

- Sys::Virt::Domain::EVENT\_IO\_ERROR\_REPORT

  The error has been reported to the guest OS

### WATCHDOG EVENT CONSTANTS

These constants describe what action was taken due to the watchdog firing

- Sys::Virt::Domain::EVENT\_WATCHDOG\_NONE

  No action was taken, the watchdog was ignored

- Sys::Virt::Domain::EVENT\_WATCHDOG\_PAUSE

  The guest is paused since the watchdog fired

- Sys::Virt::Domain::EVENT\_WATCHDOG\_POWEROFF

  The guest is powered off after the watchdog fired

- Sys::Virt::Domain::EVENT\_WATCHDOG\_RESET

  The guest is reset after the watchdog fired

- Sys::Virt::Domain::EVENT\_WATCHDOG\_SHUTDOWN

  The guest attempted to gracefully shutdown after the watchdog fired

- Sys::Virt::Domain::EVENT\_WATCHDOG\_DEBUG

  No action was taken, the watchdog was logged

- Sys::Virt::Domain::EVENT\_WATCHDOG\_INJECTNMI

  An NMI was injected into the guest after the watchdog fired

### GRAPHICS EVENT PHASE CONSTANTS

These constants describe the phase of the graphics connection

- Sys::Virt::Domain::EVENT\_GRAPHICS\_CONNECT

  The initial client connection

- Sys::Virt::Domain::EVENT\_GRAPHICS\_INITIALIZE

  The client has been authenticated & the connection is running

- Sys::Virt::Domain::EVENT\_GRAPHICS\_DISCONNECT

  The client has disconnected

### GRAPHICS EVENT ADDRESS CONSTANTS

These constants describe the format of the address

- Sys::Virt::Domain::EVENT\_GRAPHICS\_ADDRESS\_IPV4

  An IPv4 address

- Sys::Virt::Domain::EVENT\_GRAPHICS\_ADDRESS\_IPV6

  An IPv6 address

- Sys::Virt::Domain::EVENT\_GRAPHICS\_ADDRESS\_UNIX

  An UNIX socket path address

### DISK CHANGE EVENT CONSTANTS

These constants describe the reason for a disk change event

- Sys::Virt::Domain::EVENT\_DISK\_CHANGE\_MISSING\_ON\_START

  The disk media was cleared, as its source was missing when attempting to start the guest

- Sys::Virt::Domain::EVENT\_DISK\_DROP\_MISSING\_ON\_START

  The disk device was dropped, as its source was missing when  attempting to start the guest

### TRAY CHANGE CONSTANTS

These constants describe the reason for a tray change event

- Sys::Virt::Domain::EVENT\_TRAY\_CHANGE\_CLOSE

  The tray was closed

- Sys::Virt::Domain::EVENT\_TRAY\_CHANGE\_OPEN

  The tray was opened

### DOMAIN BLOCK JOB TYPE CONSTANTS

The following constants identify the different types of domain block jobs

- Sys::Virt::Domain::BLOCK\_JOB\_TYPE\_UNKNOWN

  An unknown block job type

- Sys::Virt::Domain::BLOCK\_JOB\_TYPE\_PULL

  The block pull job type

- Sys::Virt::Domain::BLOCK\_JOB\_TYPE\_COPY

  The block copy job type

- Sys::Virt::Domain::BLOCK\_JOB\_TYPE\_COMMIT

  The block commit job type

- Sys::Virt::Domain::BLOCK\_JOB\_TYPE\_ACTIVE\_COMMIT

  The block active commit job type

- Sys::Virt::Domain::BLOCK\_JOB\_TYPE\_BACKUP

  The block backup job type

### DOMAIN BLOCK JOB COMPLETION CONSTANTS

The following constants can be used to determine the completion status of a block job

- Sys::Virt::Domain::BLOCK\_JOB\_COMPLETED

  A successfully completed block job

- Sys::Virt::Domain::BLOCK\_JOB\_FAILED

  An unsuccessful block job

- Sys::Virt::Domain::BLOCK\_JOB\_CANCELED

  A block job canceled by the user

- Sys::Virt::Domain::BLOCK\_JOB\_READY

  A block job is running

### DOMAIN BLOCK REBASE CONSTANTS

The following constants are useful when rebasing block devices

- Sys::Virt::Domain::BLOCK\_REBASE\_SHALLOW

  Limit copy to top of source backing chain

- Sys::Virt::Domain::BLOCK\_REBASE\_REUSE\_EXT

  Reuse existing external file for copy

- Sys::Virt::Domain::BLOCK\_REBASE\_COPY\_RAW

  Make destination file raw

- Sys::Virt::Domain::BLOCK\_REBASE\_COPY

  Start a copy job

- Sys::Virt::Domain::BLOCK\_REBASE\_COPY\_DEV

  Treat destination as a block device instead of file

- Sys::Virt::Domain::BLOCK\_REBASE\_RELATIVE

  Keep backing chain referenced using relative names

### DOMAIN BLOCK COPY CONSTANTS

The following constants are useful when copying block devices

- Sys::Virt::Domain::BLOCK\_COPY\_SHALLOW

  Limit copy to top of source backing chain

- Sys::Virt::Domain::BLOCK\_COPY\_REUSE\_EXT

  Reuse existing external file for copy

- Sys::Virt::Domain::BLOCK\_COPY\_TRANSIENT\_JOB

  Don't force usage of recoverable job for the copy operation

- Sys::Virt::Domain::BLOCK\_COPY\_SYNCHRONOUS\_WRITES

  Force the copy job to synchronously propagate guest writes into the destination image, so that the copy is guaranteed to converge

- Sys::Virt::Domain::BLOCK\_COPY\_TARGET\_ZEROED

  The target image is guaranteed to be pre-zeroed so all reads will return zeros.

### DOMAIN BLOCK JOB ABORT CONSTANTS

The following constants are useful when aborting job copy jobs

- Sys::Virt::Domain::BLOCK\_JOB\_ABORT\_ASYNC

  Request only, do not wait for completion

- Sys::Virt::Domain::BLOCK\_JOB\_ABORT\_PIVOT

  Pivot to mirror when ending a copy job

### DOMAIN BLOCK COMMIT JOB CONSTANTS

The following constants are useful with block commit job types

- Sys::Virt::Domain::BLOCK\_COMMIT\_DELETE

  Delete any files that are invalid after commit

- Sys::Virt::Domain::BLOCK\_COMMIT\_SHALLOW

  NULL base means next backing file, not whole chain

- Sys::Virt::Domain::BLOCK\_COMMIT\_ACTIVE

  Allow two phase commit when top is active layer

- Sys::Virt::Domain::BLOCK\_COMMIT\_RELATIVE

  Keep backing chain referenced using relative names

### DOMAIN SAVE / RESTORE FLAG CONSTANTS

The following constants can be used when saving or restoring virtual machines

- Sys::Virt::Domain::SAVE\_BYPASS\_CACHE

  Do not use OS I/O cache when saving state.

- Sys::Virt::Domain::SAVE\_PAUSED

  Mark the saved state as paused to prevent the guest CPUs starting upon restore.

- Sys::Virt::Domain::SAVE\_RUNNING

  Mark the saved state as running to allow the guest CPUs to start upon restore.

- Sys::Virt::Domain::SAVE\_RESET\_NVRAM

  Reset the firmware NVRAM state from its original template

### SAVE / RESTORE PARAMETER CONSTANTS

- Sys::Virt::Domain::SAVE\_PARAM\_FILE

  Specify the save state file to save to or restore from.

- Sys::Virt::Domain::SAVE\_PARAM\_DXML

  Used to adjust guest xml on restore, e.g. to alter a device while domain is stopped.

- Sys::Virt::Domain::SAVE\_PARAM\_IMAGE\_FORMAT

  Specify the save state image format. This can be one of the following constant values

  - Sys::Virt::Domain::SAVE\_PARAM\_IMAGE\_FORMAT\_RAW

    Uncompressed raw image

  - Sys::Virt::Domain::SAVE\_PARAM\_IMAGE\_FORMAT\_GZIP

    Image compressed with gzip

  - Sys::Virt::Domain::SAVE\_PARAM\_IMAGE\_FORMAT\_BZIP2

    Image compressed with bzip2

  - Sys::Virt::Domain::SAVE\_PARAM\_IMAGE\_FORMAT\_XZ

    Image compressed with xz

  - Sys::Virt::Domain::SAVE\_PARAM\_IMAGE\_FORMAT\_LZOP

    Image compressed with lzop

  - Sys::Virt::Domain::SAVE\_PARAM\_IMAGE\_FORMAT\_ZSTD

    Image compressed with zstd

  - Sys::Virt::Domain::SAVE\_PARAM\_IMAGE\_FORMAT\_SPARSE

    Uncompressed sparse image

- Sys::Virt::Domain::SAVE\_PARAM\_PARALLEL\_CHANNELS

  Specify the number of IO channels to use during parallel save or restore.

### DOMAIN CORE DUMP CONSTANTS

The following constants can be used when triggering domain core dumps

- Sys::Virt::Domain::DUMP\_LIVE

  Do not pause execution while dumping the guest

- Sys::Virt::Domain::DUMP\_CRASH

  Crash the guest after completing the core dump

- Sys::Virt::Domain::DUMP\_BYPASS\_CACHE

  Do not use OS I/O cache when writing core dump

- Sys::Virt::Domain::DUMP\_RESET

  Reset the virtual machine after finishing the dump

- Sys::Virt::Domain::DUMP\_MEMORY\_ONLY

  Only include guest RAM in the dump, not the device state

### DESTROY CONSTANTS

The following constants are useful when terminating guests using the `"destroy"` API.

- Sys::Virt::Domain::DESTROY\_DEFAULT

  Destroy the guest using the default approach

- Sys::Virt::Domain::DESTROY\_GRACEFUL

  Destroy the guest in a graceful manner

- Sys::Virt::Domain::DESTROY\_REMOVE\_LOGS

  Delete log files associated with the guest

### SHUTDOWN CONSTANTS

The following constants are useful when requesting that a guest terminate using the `"shutdown"` API

- Sys::Virt::Domain::SHUTDOWN\_DEFAULT

  Shutdown using the hypervisor's default mechanism

- Sys::Virt::Domain::SHUTDOWN\_GUEST\_AGENT

  Shutdown by issuing a command to a guest agent

- Sys::Virt::Domain::SHUTDOWN\_ACPI\_POWER\_BTN

  Shutdown by injecting an ACPI power button press

- Sys::Virt::Domain::SHUTDOWN\_INITCTL

  Shutdown by talking to initctl (containers only)

- Sys::Virt::Domain::SHUTDOWN\_SIGNAL

  Shutdown by sending SIGTERM to the init process

- Sys::Virt::Domain::SHUTDOWN\_PARAVIRT

  Shutdown by issuing a paravirt power control command

### REBOOT CONSTANTS

The following constants are useful when requesting that a guest terminate using the `"reboot"` API

- Sys::Virt::Domain::REBOOT\_DEFAULT

  Reboot using the hypervisor's default mechanism

- Sys::Virt::Domain::REBOOT\_GUEST\_AGENT

  Reboot by issuing a command to a guest agent

- Sys::Virt::Domain::REBOOT\_ACPI\_POWER\_BTN

  Reboot by injecting an ACPI power button press

- Sys::Virt::Domain::REBOOT\_INITCTL

  Reboot by talking to initctl (containers only)

- Sys::Virt::Domain::REBOOT\_SIGNAL

  Reboot by sending SIGHUP to the init process

- Sys::Virt::Domain::REBOOT\_PARAVIRT

  Reboot by issuing a paravirt power control command

### METADATA CONSTANTS

The following constants are useful when reading/writing metadata about a guest

- Sys::Virt::Domain::METADATA\_TITLE

  The short human friendly title of the guest

- Sys::Virt::Domain::METADATA\_DESCRIPTION

  The long free text description of the guest

- Sys::Virt::Domain::METADATA\_ELEMENT

  The structured metadata elements for the guest

### DISK ERROR CONSTANTS

The following constants are useful when interpreting disk error codes

- Sys::Virt::Domain::DISK\_ERROR\_NONE

  No error

- Sys::Virt::Domain::DISK\_ERROR\_NO\_SPACE

  The host storage has run out of free space

- Sys::Virt::Domain::DISK\_ERROR\_UNSPEC

  An unspecified error has occurred.

### MEMORY STATISTIC CONSTANTS

- Sys::Virt::Domain::MEMORY\_STAT\_SWAP\_IN

  Swap in

- Sys::Virt::Domain::MEMORY\_STAT\_SWAP\_OUT

  Swap out

- Sys::Virt::Domain::MEMORY\_STAT\_MINOR\_FAULT

  Minor faults

- Sys::Virt::Domain::MEMORY\_STAT\_MAJOR\_FAULT

  Major faults

- Sys::Virt::Domain::MEMORY\_STAT\_RSS

  Resident memory

- Sys::Virt::Domain::MEMORY\_STAT\_UNUSED

  Unused memory

- Sys::Virt::Domain::MEMORY\_STAT\_AVAILABLE

  Available memory

- Sys::Virt::Domain::MEMORY\_STAT\_ACTUAL\_BALLOON

  Actual balloon limit

- Sys::Virt::Domain::MEMORY\_STAT\_USABLE

  Amount of usable memory

- Sys::Virt::Domain::MEMORY\_STAT\_LAST\_UPDATE

  Time of last stats refresh from guest

- Sys::Virt::Domain::MEMORY\_STAT\_DISK\_CACHES

  Disk cache size

- Sys::Virt::Domain::MEMORY\_STAT\_HUGETLB\_PGALLOC

  The amount of successful huge page allocations

- Sys::Virt::Domain::MEMORY\_STAT\_HUGETLB\_PGFAIL

  The amount of failed huge page allocations

### DOMAIN LIST CONSTANTS

The following constants can be used when listing domains

- Sys::Virt::Domain::LIST\_ACTIVE

  Only list domains that are currently active (running, or paused)

- Sys::Virt::Domain::LIST\_AUTOSTART

  Only list domains that are set to automatically start on boot

- Sys::Virt::Domain::LIST\_HAS\_SNAPSHOT

  Only list domains that have a stored snapshot

- Sys::Virt::Domain::LIST\_INACTIVE

  Only list domains that are currently inactive (shutoff, saved)

- Sys::Virt::Domain::LIST\_MANAGEDSAVE

  Only list domains that have current managed save state

- Sys::Virt::Domain::LIST\_NO\_AUTOSTART

  Only list domains that are not set to automatically start on boto

- Sys::Virt::Domain::LIST\_NO\_MANAGEDSAVE

  Only list domains that do not have any managed save state

- Sys::Virt::Domain::LIST\_NO\_SNAPSHOT

  Only list domains that do not have a stored snapshot

- Sys::Virt::Domain::LIST\_OTHER

  Only list domains that are not running, paused or shutoff

- Sys::Virt::Domain::LIST\_PAUSED

  Only list domains that are paused

- Sys::Virt::Domain::LIST\_PERSISTENT

  Only list domains which have a persistent config

- Sys::Virt::Domain::LIST\_RUNNING

  Only list domains that are currently running

- Sys::Virt::Domain::LIST\_SHUTOFF

  Only list domains that are currently shutoff

- Sys::Virt::Domain::LIST\_TRANSIENT

  Only list domains that do not have a persistent config

- Sys::Virt::Domain::LIST\_HAS\_CHECKPOINT

  Only list domains that have a stored checkpoint

- Sys::Virt::Domain::LIST\_NO\_CHECKPOINT

  Only list domains that do not have a stored checkpoint

### SEND KEY CONSTANTS

The following constants are to be used with the `"send_key"` API

- Sys::Virt::Domain::SEND\_KEY\_MAX\_KEYS

  The maximum number of keys that can be sent in a single call to `"send_key"`

### BLOCK STATS CONSTANTS

The following constants provide the names of well known block stats fields

- Sys::Virt::Domain::BLOCK\_STATS\_ERRS

  The number of I/O errors

- Sys::Virt::Domain::BLOCK\_STATS\_FLUSH\_REQ

  The number of flush requests

- Sys::Virt::Domain::BLOCK\_STATS\_FLUSH\_TOTAL\_TIMES

  The time spent processing flush requests

- Sys::Virt::Domain::BLOCK\_STATS\_READ\_BYTES

  The amount of data read

- Sys::Virt::Domain::BLOCK\_STATS\_READ\_REQ

  The number of read requests

- Sys::Virt::Domain::BLOCK\_STATS\_READ\_TOTAL\_TIMES

  The time spent processing read requests

- Sys::Virt::Domain::BLOCK\_STATS\_WRITE\_BYTES

  The amount of data written

- Sys::Virt::Domain::BLOCK\_STATS\_WRITE\_REQ

  The number of write requests

- Sys::Virt::Domain::BLOCK\_STATS\_WRITE\_TOTAL\_TIMES

  The time spent processing write requests

### CPU STATS CONSTANTS

The following constants provide the names of well known cpu stats fields

- Sys::Virt::Domain::CPU\_STATS\_CPUTIME

  The total CPU time, including both hypervisor and vCPU time.

- Sys::Virt::Domain::CPU\_STATS\_USERTIME

  THe total time in kernel

- Sys::Virt::Domain::CPU\_STATS\_SYSTEMTIME

  The total time in userspace

- Sys::Virt::Domain::CPU\_STATS\_VCPUTIME

  The total vCPU time.

### CPU STATS CONSTANTS

The following constants provide the names of well known schedular parameters

- Sys::Virt::SCHEDULER\_EMULATOR\_PERIOD

  The duration of the time period for scheduling the emulator

- Sys::Virt::SCHEDULER\_EMULATOR\_QUOTA

  The quota for the emulator in one schedular time period

- Sys::Virt::SCHEDULER\_IOTHREAD\_PERIOD

  The duration of the time period for scheduling the iothread

- Sys::Virt::SCHEDULER\_IOTHREAD\_QUOTA

  The quota for the iothread in one schedular time period

### DOMAIN STATS FLAG CONSTANTS

The following constants are used as flags when requesting bulk domain stats from `"Sys::Virt::get_all_domain_stats"`.

- Sys::Virt::Domain::GET\_ALL\_STATS\_ACTIVE

  Include stats for active domains

- Sys::Virt::Domain::GET\_ALL\_STATS\_INACTIVE

  Include stats for inactive domains

- Sys::Virt::Domain::GET\_ALL\_STATS\_OTHER

  Include stats for other domains

- Sys::Virt::Domain::GET\_ALL\_STATS\_PAUSED

  Include stats for paused domains

- Sys::Virt::Domain::GET\_ALL\_STATS\_PERSISTENT

  Include stats for persistent domains

- Sys::Virt::Domain::GET\_ALL\_STATS\_RUNNING

  Include stats for running domains

- Sys::Virt::Domain::GET\_ALL\_STATS\_SHUTOFF

  Include stats for shutoff domains

- Sys::Virt::Domain::GET\_ALL\_STATS\_TRANSIENT

  Include stats for transient domains

- Sys::Virt::Domain::GET\_ALL\_STATS\_ENFORCE\_STATS

  Require that all requested stats fields are returned

- Sys::Virt::Domain::GET\_ALL\_STATS\_BACKING

  Get stats for image backing files too

- Sys::Virt::Domain::GET\_ALL\_STATS\_NOWAIT

  Skip stats if they can't be acquired without waiting

### DOMAIN STATS FIELD CONSTANTS

The following constants are used to control which fields are returned for stats queries.

- Sys::Virt::Domain::STATS\_BALLOON

  Balloon statistics.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_BALLOON\_CURRENT

    The memory in kiB currently used as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_MAXIMUM

    The maximum memory in kiB allowed as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_SWAP\_IN

    The amount of data read from swap space (in KiB) as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_SWAP\_OUT

    The amount of memory written out to swap space (in KiB) as unsigned long

  - Sys::Virt::Domain::STATS\_BALLOON\_MAJOR\_FAULT

    The number of page faults when disk IO was required as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_MINOR\_FAULT

    The number of other page faults as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_UNUSED

    The amount of memory left unused by the system (in KiB) as unsigned long

  - Sys::Virt::Domain::STATS\_BALLOON\_AVAILABLE

    The amount of usable memory as seen by the domain (in KiB) as unsigned long

  - Sys::Virt::Domain::STATS\_BALLOON\_RSS

    Resident Set Size of running domain's process (in KiB) as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_USABLE

    The amount of memory which can be reclaimed by balloon without causing host swapping (in KiB) as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_LAST\_UPDATE

    Timestamp of the last update of statistics (in seconds) as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_DISK\_CACHES

    The amount of memory that can be reclaimed without additional I/O, typically disk (in KiB) as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_HUGETLB\_PGALLOC

    The number of successful huge page allocations from inside the domain via virtio balloon as unsigned long long.

  - Sys::Virt::Domain::STATS\_BALLOON\_HUGETLB\_PGFAIL

    The number of failed huge page allocations from inside the domain via virtio balloon as unsigned long long.

- Sys::Virt::Domain::STATS\_BLOCK

  Block device info.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_BLOCK\_COUNT

    Number of block devices in the subsequent list, as unsigned int.

  - Sys::Virt::Domain::STATS\_BLOCK\_PREFIX

    The parameter name prefix to access each disk entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the block suffix parameters to form a complete parameter name.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_NAME

    Name of the block device as string. Matches the target name (vda/sda/hda) of the block device.  If the backing chain is listed, this name is the same for all host resources tied to the same guest device.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_BACKINGINDEX

    The \<backingStore\> index as unsigned int, only used when backing images are listed.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_PATH

    Source of the block device as a string, if it is a file or block device (omitted for network sources and drives with no media inserted).

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_RD\_REQS

    Number of read requests as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_RD\_BYTES

    Number of read bytes as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_RD\_TIMES

    Total time (ns) spent on reads as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_WR\_REQS

    Number of write requests as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_WR\_BYTES

    Number of written bytes as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_WR\_TIMES

    Total time (ns) spent on writes as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_FL\_REQS

    Total flush requests as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_FL\_TIMES

    Total time (ns) spent on cache flushing as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_ERRORS

    Xen only: the 'oo\_req' value as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_ALLOCATION

    Offset of the highest written sector as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_CAPACITY

    Logical size in bytes of the block device backing image as unsigned long

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_PHYSICAL

    Physical size in bytes of the container of the backing image as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_THRESHOLD

    Current threshold for delivering the VIR\_DOMAIN\_EVENT\_ID\_BLOCK\_THRESHOLD event in bytes as unsigned long long. See virDomainSetBlockThreshold.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_DISCARD\_ALIGNMENT

    Alignment for discard requests in bytes, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_DISCARD\_MAX

    Alignment for discard requests in bytes, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_IOV\_HW\_MAX

    Maximal number of scatter/gather elements of requests bypassing kernel IO scheduler, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_IOV\_MAX

    Maximum number of scatter/gather elements, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_MEMORY\_ALIGNMENT\_MINIMAL

    Memory alignment in bytes so that no bounce buffer is needed, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_MEMORY\_ALIGNMENT\_OPTIMAL

    Memory alignment in bytes that is used for bounce buffers, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_REQUEST\_ALIGNMENT

    Alignment requirement, in bytes, for offset/length of I/O requests, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_TRANSFER\_HW\_MAX

    Maximal hardware transfer length of requests bypassing kernel IO scheduler in bytes, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_TRANSFER\_MAX

    Maximal transfer length in bytes, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_TRANSFER\_OPTIMAL

    Optimal transfer length in bytes, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_WRITE\_ZEROES\_ALIGNMENT

    Optimal alignment for write\_zeroes requests in bytes, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LIMITS\_WRITE\_ZEROES\_MAX

    Maximum number of bytes that can be zeroed out at once, as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_COUNT

    Number of groups of statistics accounted in a configured time intervals as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_PREFIX

    The parameter name prefix to access each group of timed stats. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the timed group suffix parameters to form a complete paramter name.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_FLUSH\_LATENCY\_AVG

    Average latency of flush operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_FLUSH\_LATENCY\_MAX

    Maximum latency of flush operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_FLUSH\_LATENCY\_MIN

    Minimum latency of flush operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_INTERVAL

    The time interval in seconds as unsigned long long for which the statistics in this group were collected.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_RD\_LATENCY\_AVG

    Average latency of read operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_RD\_LATENCY\_MAX

    Maximum latency of read operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_RD\_LATENCY\_MIN

    Minimum latency of read operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_RD\_QUEUE\_DEPTH\_AVG

    Average number of pending read operations in the defined interval as double.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_WR\_LATENCY\_AVG

    Average latency of write operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_WR\_LATENCY\_MAX

    Maximum latency of write operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_WR\_LATENCY\_MIN

    Minimum latency of write operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_WR\_QUEUE\_DEPTH\_AVG

    Average number of pending write operations in the defined interval as double.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_ZONE\_APPEND\_LATENCY\_AVG

    Average latency of zone append operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_ZONE\_APPEND\_LATENCY\_MAX

    Maximum latency of zone append operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_ZONE\_APPEND\_LATENCY\_MIN

    Minimum latency of zone append operations in the defined interval, in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_TIMED\_GROUP\_SUFFIX\_ZONE\_APPEND\_QUEUE\_DEPTH\_AVG

    Average number of pending zone append operations in the defined interval as double.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LATENCY\_HISTOGRAM\_FLUSH\_PREFIX

    The parameter name prefix to access 'flush' latency histograms.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LATENCY\_HISTOGRAM\_READ\_PREFIX

    The parameter name prefix to access 'read' latency histograms.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LATENCY\_HISTOGRAM\_WRITE\_PREFIX

    The parameter name prefix to access 'write' latency histograms.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LATENCY\_HISTOGRAM\_ZONE\_APPEND\_PREFIX

    The parameter name prefix to access 'zone\_append' latency histograms.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LATENCY\_HISTOGRAM\_SUFFIX\_BIN\_COUNT

    The parameter name suffix to access number of bins in the histogram stats.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LATENCY\_HISTOGRAM\_SUFFIX\_BIN\_PREFIX

    The parameter name suffix to access a latency histogram bin.

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LATENCY\_HISTOGRAM\_SUFFIX\_BIN\_SUFFIX\_START

    Start of the current latency histogram bin in nanoseconds

  - Sys::Virt::Domain::STATS\_BLOCK\_SUFFIX\_LATENCY\_HISTOGRAM\_SUFFIX\_BIN\_SUFFIX\_VALUE

    Current value of the number of occurences of the latency within this bin

- Sys::Virt::Domain::STATS\_CPU\_TOTAL

  CPU usage info.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_CPU\_TIME

    Total cpu time spent for this domain in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_CPU\_USER

    User cpu time spent in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_CPU\_SYSTEM

    System cpu time spent in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_CPU\_HALTPOLL\_SUCCESS\_TIME

    Halt-polling cpu usage about the VCPU polled until a virtual interrupt was delivered in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_CPU\_HALTPOLL\_FAIL\_TIME

    Halt-polling cpu usage about the VCPU had to schedule out (either because the maximum poll time was reached or it needed to yield the CPU) in nanoseconds as unsigned long long.

  - Sys::Virt::Domain::STATS\_CPU\_CACHE\_MONITOR\_COUNT

    The number of cache monitors for this domain as an unsigned int.

  - Sys::Virt::Domain::STATS\_CPU\_CACHE\_MONITOR\_PREFIX

    The parameter name prefix to access each cache monitor entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the cache monitor suffix parameters to form a complete parameter name.

  - Sys::Virt::Domain::STATS\_CPU\_CACHE\_MONITOR\_SUFFIX\_NAME

    The name of cache monitor as a string.

  - Sys::Virt::Domain::STATS\_CPU\_CACHE\_MONITOR\_SUFFIX\_VCPUS

    Vcpu list of cache monitor as a string.

  - Sys::Virt::Domain::STATS\_CPU\_CACHE\_MONITOR\_SUFFIX\_BANK\_COUNT

    The number of cache banks in cache monitor as an unsigned int.

  - Sys::Virt::Domain::STATS\_CPU\_CACHE\_MONITOR\_SUFFIX\_BANK\_PREFIX

    The parameter name prefix to access each cache monitor bank entry. Concatenate the cache monitor prefix, the cache monitor entry number formatted as an unsigned integer, the bank prefix, the bank entry number formatted as an unsigned integer and one of the cache monitor bank suffix parameters to form a complete parameter name.

  - Sys::Virt::Domain::STATS\_CPU\_CACHE\_MONITOR\_SUFFIX\_BANK\_SUFFIX\_ID

    Host allocated cache id for the bank as an unsigned int.

  - Sys::Virt::Domain::STATS\_CPU\_CACHE\_MONITOR\_SUFFIX\_BANK\_SUFFIX\_BYTES

    The number of bytes of last level cache that the domain is using as an unsigned long long.

  - Sys::Virt::Domain::STATS\_CPU\_ENERGY\_MONITOR\_COUNT

    The number of energy monitors for this domain, as an unsigned int.

  - Sys::Virt::Domain::STATS\_CPU\_ENERGY\_MONITOR\_PREFIX

    Prefix for an individual energy monitor group. Concatenate with the monitor index and one of the "cpu.energy.monitor.\<i\>." suffix constants below to form a full parameter name.

  - Sys::Virt::Domain::STATS\_CPU\_ENERGY\_MONITOR\_SUFFIX\_NAME

    Name of the monitor group as a string.

  - Sys::Virt::Domain::STATS\_CPU\_ENERGY\_MONITOR\_SUFFIX\_VCPUS

    vCPU set covered by the monitor group as a string.

  - Sys::Virt::Domain::STATS\_CPU\_ENERGY\_MONITOR\_SUFFIX\_PKG\_COUNT

    Number of PERF\_PKG nodes the monitor group exposes, as an unsigned int.

  - Sys::Virt::Domain::STATS\_CPU\_ENERGY\_MONITOR\_SUFFIX\_PKG\_PREFIX

    Prefix for a single mon\_PERF\_PKG node inside a monitor group.

  - Sys::Virt::Domain::STATS\_CPU\_ENERGY\_MONITOR\_SUFFIX\_PKG\_SUFFIX\_ID

    Kernel-assigned mon\_PERF\_PKG node id, as an unsigned int.

- Sys::Virt::Domain::STATS\_INTERFACE

  Network interface info.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_NET\_COUNT

    Number of network interfaces on this domain as unsigned int.

  - Sys::Virt::Domain::STATS\_NET\_PREFIX

    The parameter name prefix to access each interface entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the network suffix parameters to form a complete parameter name.

  - Sys::Virt::Domain::STATS\_NET\_SUFFIX\_NAME

    Name of the interface as string.

  - Sys::Virt::Domain::STATS\_NET\_SUFFIX\_RX\_BYTES

    Bytes received as unsigned long long.

  - Sys::Virt::Domain::STATS\_NET\_SUFFIX\_RX\_PKTS

    Packets received as unsigned long long.

  - Sys::Virt::Domain::STATS\_NET\_SUFFIX\_RX\_ERRS

    Receive errors as unsigned long long.

  - Sys::Virt::Domain::STATS\_NET\_SUFFIX\_RX\_DROP

    Receive packets dropped as unsigned long long.

  - Sys::Virt::Domain::STATS\_NET\_SUFFIX\_TX\_BYTES

    Bytes transmitted as unsigned long long.

  - Sys::Virt::Domain::STATS\_NET\_SUFFIX\_TX\_PKTS

    Packets transmitted as unsigned long long.

  - Sys::Virt::Domain::STATS\_NET\_SUFFIX\_TX\_ERRS

    Transmission errors as unsigned long long.

  - Sys::Virt::Domain::STATS\_NET\_SUFFIX\_TX\_DROP

    Transmit packets dropped as unsigned long long.

- Sys::Virt::Domain::STATS\_STATE

  General lifecycle state.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_STATE\_STATE

    State of the VM, returned as int from virDomainState enum.

  - Sys::Virt::Domain::STATS\_STATE\_REASON

    Reason for entering given state, returned as int from virDomain\*Reason enum corresponding to given state.

- Sys::Virt::Domain::STATS\_VCPU

  Virtual CPU info.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_VCPU\_CURRENT

    Current number of online virtual CPUs as unsigned int.

  - Sys::Virt::Domain::STATS\_VCPU\_MAXIMUM

    Maximum number of online virtual CPUs as unsigned int.

  - Sys::Virt::Domain::STATS\_VCPU\_PREFIX

    The parameter name prefix to access each vCPU entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the vCPU suffix parameters to form a complete parameter name.

    Due to VCPU hotplug, the array could be sparse. The actual number of entries present corresponds to VIR\_DOMAIN\_STATS\_VCPU\_CURRENT, while the array size will never exceed VIR\_DOMAIN\_STATS\_VCPU\_MAXIMUM.

  - Sys::Virt::Domain::STATS\_VCPU\_SUFFIX\_STATE

    State of the virtual CPU \<num\>, as int from virVcpuState enum.

  - Sys::Virt::Domain::STATS\_VCPU\_SUFFIX\_TIME

    Virtual cpu time spent by virtual CPU as unsigned long long.

  - Sys::Virt::Domain::STATS\_VCPU\_SUFFIX\_WAIT

    Time the vCPU wants to run, but the host scheduler has something else running ahead of it as unsigned long long.

  - Sys::Virt::Domain::STATS\_VCPU\_SUFFIX\_HALTED

    Virtual CPU is halted as a boolean, may indicate the processor is idle or even disabled, depending on the architecture.

  - Sys::Virt::Domain::STATS\_VCPU\_SUFFIX\_DELAY

    Time the vCPU thread was enqueued by the host scheduler, but was waiting in the queue instead of running. Exposed to the VM as a steal time. In nanoseconds as unsigned long long.

- Sys::Virt::Domain::STATS\_PERF

  Performance event counter values.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_PERF\_CMT

    The usage of l3 cache (bytes) by applications running on the platform as unsigned long long. It is produced by the cmt perf event.

  - Sys::Virt::Domain::STATS\_PERF\_MBMT

    The total system bandwidth (bytes/s) from one level of cache to another as unsigned long long. It is produced by the mbmt perf event.

  - Sys::Virt::Domain::STATS\_PERF\_MBML

    The amount of data (bytes/s) sent through the memory controller on the socket as unsigned long long. It is produced by the mbml perf event.

  - Sys::Virt::Domain::STATS\_PERF\_CACHE\_MISSES

    The count of cache misses as unsigned long long. It is produced by the cache\_misses perf event.

  - Sys::Virt::Domain::STATS\_PERF\_CACHE\_REFERENCES

    The count of cache hits as unsigned long long. It is produced by the cache\_references perf event.

  - Sys::Virt::Domain::STATS\_PERF\_INSTRUCTIONS

    The count of instructions as unsigned long long. It is produced by the instructions perf event.

  - Sys::Virt::Domain::STATS\_PERF\_CPU\_CYCLES

    The count of cpu cycles (total/elapsed) as an unsigned long long. It is produced by the cpu\_cycles perf event.

  - Sys::Virt::Domain::STATS\_PERF\_BRANCH\_INSTRUCTIONS

    The count of branch instructions as unsigned long long. It is produced by the branch\_instructions perf event.

  - Sys::Virt::Domain::STATS\_PERF\_BRANCH\_MISSES

    The count of branch misses as unsigned long long. It is produced by the branch\_misses perf event.

  - Sys::Virt::Domain::STATS\_PERF\_BUS\_CYCLES

    The count of bus cycles as unsigned long long. It is produced by the bus\_cycles perf event.

  - Sys::Virt::Domain::STATS\_PERF\_STALLED\_CYCLES\_FRONTEND

    The count of stalled cpu cycles in the frontend of the instruction processor pipeline as unsigned long long. It is produced by the stalled\_cycles\_frontend perf event.

  - Sys::Virt::Domain::STATS\_PERF\_STALLED\_CYCLES\_BACKEND

    The count of stalled cpu cycles in the backend of the instruction processor pipeline as unsigned long long. It is produced by the stalled\_cycles\_backend perf event.

  - Sys::Virt::Domain::STATS\_PERF\_REF\_CPU\_CYCLES

    The count of total cpu cycles not affected by CPU frequency scaling by applications running as unsigned long long. It is produced by the ref\_cpu\_cycles perf event.

  - Sys::Virt::Domain::STATS\_PERF\_CPU\_CLOCK

    The count of cpu clock time as unsigned long long. It is produced by the cpu\_clock perf event.

  - Sys::Virt::Domain::STATS\_PERF\_TASK\_CLOCK

    The count of task clock time as unsigned long long. It is produced by the task\_clock perf event.

  - Sys::Virt::Domain::STATS\_PERF\_PAGE\_FAULTS

    The count of page faults as unsigned long long. It is produced by the page\_faults perf event

  - Sys::Virt::Domain::STATS\_PERF\_CONTEXT\_SWITCHES

    The count of context switches as unsigned long long. It is produced by the context\_switches perf event.

  - Sys::Virt::Domain::STATS\_PERF\_CPU\_MIGRATIONS

    The count of cpu migrations, from one logical processor to another, as unsigned long long. It is produced by the cpu\_migrations perf event.

  - Sys::Virt::Domain::STATS\_PERF\_PAGE\_FAULTS\_MIN

    The count of minor page faults as unsigned long long. It is produced by the page\_faults\_min perf event.

  - Sys::Virt::Domain::STATS\_PERF\_PAGE\_FAULTS\_MAJ

    The count of major page faults as unsigned long long. It is produced by the page\_faults\_maj perf event.

  - Sys::Virt::Domain::STATS\_PERF\_ALIGNMENT\_FAULTS

    The count of alignment faults as unsigned long long. It is produced by the alignment\_faults perf event

  - Sys::Virt::Domain::STATS\_PERF\_EMULATION\_FAULTS

    The count of emulation faults as unsigned long long. It is produced by the emulation\_faults perf event

- Sys::Virt::Domain::STATS\_IOTHREAD

  IOThread performance statistics values.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_IOTHREAD\_COUNT

    Maximum number of IOThreads in the subsequent list as unsigned int. Each IOThread in the list will will use it's iothread\_id value as the array index. There may be fewer array entries than the iothread.count value if the polling values are not supported.

  - Sys::Virt::Domain::STATS\_IOTHREAD\_PREFIX

    The parameter name prefix to access each iothread entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the iothread suffix parameters to form a complete parameter name.

  - Sys::Virt::Domain::STATS\_IOTHREAD\_SUFFIX\_POLL\_MAX\_NS

    Maximum polling time in ns as an unsigned long long. A 0 (zero) means polling is disabled.

  - Sys::Virt::Domain::STATS\_IOTHREAD\_SUFFIX\_POLL\_GROW

    Polling time factor as an unsigned int or unsigned long long if exceeding range of unsigned int. A 0 (zero) indicates to allow the underlying hypervisor to choose how to grow the polling time.

  - Sys::Virt::Domain::STATS\_IOTHREAD\_SUFFIX\_POLL\_SHRINK

    Polling time divisor as an unsigned int or unsigned long long if exceeding range of unsigned int. A 0 (zero) indicates to allow the underlying hypervisor to choose how to shrink the polling time.

  - Sys::Virt::Domain::STATS\_IOTHREAD\_SUFFIX\_POLL\_WEIGHT

    Polling weight factor as an unsigned int. This shift value controls how much the most recent event interval affects adaptive polling calculations. A 0 (zero) indicates the hypervisor's default weight is used.

- Sys::Virt::Domain::STATS\_MEMORY

  Memory bandwidth statistics values.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_MEMORY\_BANDWIDTH\_MONITOR\_COUNT

    The number of memory bandwidth monitors for this domain as an unsigned int.

  - Sys::Virt::Domain::STATS\_MEMORY\_BANDWIDTH\_MONITOR\_PREFIX

    The parameter name prefix to access each bandwith monitor entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the memory bandwith suffix parameters to form a complete parameter name.

  - Sys::Virt::Domain::STATS\_MEMORY\_BANDWIDTH\_MONITOR\_SUFFIX\_NAME

    The name of the bandwidth monitor as a string.

  - Sys::Virt::Domain::STATS\_MEMORY\_BANDWIDTH\_MONITOR\_SUFFIX\_VCPUS

    The vcpu list of the bandwidth monitor as a string.

  - Sys::Virt::Domain::STATS\_MEMORY\_BANDWIDTH\_MONITOR\_SUFFIX\_NODE\_COUNT

    The number of memory controllers in the bandwidth monitor.

  - Sys::Virt::Domain::STATS\_MEMORY\_BANDWIDTH\_MONITOR\_SUFFIX\_NODE\_PREFIX

    The parameter name prefix to access each controller entry. Concatenate the bandwidth monitor prefix, the monitor entry number formatted as an unsigned integer, the controller prefix, the controller entry number formatted as an unsigned integer and one of the controller suffix parameters to form a complete parameter name.

  - Sys::Virt::Domain::STATS\_MEMORY\_BANDWIDTH\_MONITOR\_SUFFIX\_NODE\_SUFFIX\_ID

    Host allocated memory controller id for the controller as an unsigned int.

  - Sys::Virt::Domain::STATS\_MEMORY\_BANDWIDTH\_MONITOR\_SUFFIX\_NODE\_SUFFIX\_BYTES\_LOCAL

    The accumulative bytes consumed by vcpus passing through the memory controller in the same processor that the scheduled host CPU belongs to as an unsigned long long.

  - Sys::Virt::Domain::STATS\_MEMORY\_BANDWIDTH\_MONITOR\_SUFFIX\_NODE\_SUFFIX\_BYTES\_TOTAL

    The accumulative bytes consumed by vcpus passing through all memory controllers, either local or remote, as an unsigned long long.

- Sys::Virt::Domain::STATS\_DIRTYRATE

  Memory dirty rate statistics.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_DIRTYRATE\_CALC\_STATUS

    The status of last memory dirty rate calculation as an int from the virDomainDirtyRateStatus enum.

  - Sys::Virt::Domain::STATS\_DIRTYRATE\_CALC\_START\_TIME

    The start time in seconds of the last memory dirty rate calculation as long long.

  - Sys::Virt::Domain::STATS\_DIRTYRATE\_CALC\_PERIOD

    The period in seconds of last memory dirty rate calculation as int.

  - Sys::Virt::Domain::STATS\_DIRTYRATE\_MEGABYTES\_PER\_SECOND

    The calculated memory dirty rate in MiB/s as long long. It is produced only if the calc\_status is measured.

  - Sys::Virt::Domain::STATS\_DIRTYRATE\_CALC\_MODE

    The calculation mode used last measurement as string, either of these 'page-sampling', 'dirty-bitmap' or 'dirty-ring' values returned.

  - Sys::Virt::Domain::STATS\_DIRTYRATE\_VCPU\_PREFIX

    The parameter name prefix to access each VCPU entry. Concatenate the prefix, the entry number formatted as an unsigned integer and one of the VCPU suffix parameters to form a complete parameter name.

  - Sys::Virt::Domain::STATS\_DIRTYRATE\_VCPU\_SUFFIX\_MEGABYTES\_PER\_SECOND

    The calculated memory dirty rate for a virtual cpu as unsigned long long.

- Sys::Virt::Domain::STATS\_VM

  Hypervisor-specific stats fields for given VM.

  The following keys will be used for the returned parameters

  - Sys::Virt::Domain::STATS\_VM\_PREFIX

    Concatenate the prefix, a hypervisor specific custom stats name and one of the VIR\_DOMAIN\_STATS\_CUSTOM\_TYPE\_\* constants to form a complete parameter name

  The `"STATS_VM"` and `"STATS_VCPU"` types also use the following parameters for hypervisor specific statistics:

  - Sys::Virt::Domain::STATS\_CUSTOM\_SUFFIX\_TYPE\_CUR

    Hypervisor specific custom data type for current instant value

    The complete parameter name is formed by concatenating the field prefix, the array index formatted as an unsigned integer, a hypervisor specific parameter name, and this data type suffix.

  - Sys::Virt::Domain::STATS\_CUSTOM\_SUFFIX\_TYPE\_MAX

    Hypervisor specific custom data type for aggregate value

    The complete parameter name is formed by concatenating the field prefix, the array index formatted as an unsigned integer, a hypervisor specific parameter name, and this data type suffix.

  - Sys::Virt::Domain::STATS\_CUSTOM\_SUFFIX\_TYPE\_SUM

    Hypervisor specific custom data type for peak value.

    The complete parameter name is formed by concatenating the field prefix, the array index formatted as an unsigned integer, a hypervisor specific parameter name, and this data type suffix.

### PROCESS SIGNALS

The following constants provide the names of signals which can be sent to guest processes. They mostly correspond to POSIX signal names.

- Sys::Virt::Domain::PROCESS\_SIGNAL\_NOP

  SIGNOP

- Sys::Virt::Domain::PROCESS\_SIGNAL\_HUP

  SIGHUP

- Sys::Virt::Domain::PROCESS\_SIGNAL\_INT

  SIGINT

- Sys::Virt::Domain::PROCESS\_SIGNAL\_QUIT

  SIGQUIT

- Sys::Virt::Domain::PROCESS\_SIGNAL\_ILL

  SIGILL

- Sys::Virt::Domain::PROCESS\_SIGNAL\_TRAP

  SIGTRAP

- Sys::Virt::Domain::PROCESS\_SIGNAL\_ABRT

  SIGABRT

- Sys::Virt::Domain::PROCESS\_SIGNAL\_BUS

  SIGBUS

- Sys::Virt::Domain::PROCESS\_SIGNAL\_FPE

  SIGFPE

- Sys::Virt::Domain::PROCESS\_SIGNAL\_KILL

  SIGKILL

- Sys::Virt::Domain::PROCESS\_SIGNAL\_USR1

  SIGUSR1

- Sys::Virt::Domain::PROCESS\_SIGNAL\_SEGV

  SIGSEGV

- Sys::Virt::Domain::PROCESS\_SIGNAL\_USR2

  SIGUSR2

- Sys::Virt::Domain::PROCESS\_SIGNAL\_PIPE

  SIGPIPE

- Sys::Virt::Domain::PROCESS\_SIGNAL\_ALRM

  SIGALRM

- Sys::Virt::Domain::PROCESS\_SIGNAL\_TERM

  SIGTERM

- Sys::Virt::Domain::PROCESS\_SIGNAL\_STKFLT

  SIGSTKFLT

- Sys::Virt::Domain::PROCESS\_SIGNAL\_CHLD

  SIGCHLD

- Sys::Virt::Domain::PROCESS\_SIGNAL\_CONT

  SIGCONT

- Sys::Virt::Domain::PROCESS\_SIGNAL\_STOP

  SIGSTOP

- Sys::Virt::Domain::PROCESS\_SIGNAL\_TSTP

  SIGTSTP

- Sys::Virt::Domain::PROCESS\_SIGNAL\_TTIN

  SIGTTIN

- Sys::Virt::Domain::PROCESS\_SIGNAL\_TTOU

  SIGTTOU

- Sys::Virt::Domain::PROCESS\_SIGNAL\_URG

  SIGURG

- Sys::Virt::Domain::PROCESS\_SIGNAL\_XCPU

  SIGXCPU

- Sys::Virt::Domain::PROCESS\_SIGNAL\_XFSZ

  SIGXFSZ

- Sys::Virt::Domain::PROCESS\_SIGNAL\_VTALRM

  SIGVTALRM

- Sys::Virt::Domain::PROCESS\_SIGNAL\_PROF

  SIGPROF

- Sys::Virt::Domain::PROCESS\_SIGNAL\_WINCH

  SIGWINCH

- Sys::Virt::Domain::PROCESS\_SIGNAL\_POLL

  SIGPOLL

- Sys::Virt::Domain::PROCESS\_SIGNAL\_PWR

  SIGPWR

- Sys::Virt::Domain::PROCESS\_SIGNAL\_SYS

  SIGSYS

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT0

  SIGRT0

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT1

  SIGRT1

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT2

  SIGRT2

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT3

  SIGRT3

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT4

  SIGRT4

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT5

  SIGRT5

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT6

  SIGRT6

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT7

  SIGRT7

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT8

  SIGRT8

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT9

  SIGRT9

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT10

  SIGRT10

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT11

  SIGRT11

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT12

  SIGRT12

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT13

  SIGRT13

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT14

  SIGRT14

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT15

  SIGRT15

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT16

  SIGRT16

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT17

  SIGRT17

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT18

  SIGRT18

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT19

  SIGRT19

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT20

  SIGRT20

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT21

  SIGRT21

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT22

  SIGRT22

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT23

  SIGRT23

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT24

  SIGRT24

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT25

  SIGRT25

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT26

  SIGRT26

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT27

  SIGRT27

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT28

  SIGRT28

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT29

  SIGRT29

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT30

  SIGRT30

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT31

  SIGRT31

- Sys::Virt::Domain::PROCESS\_SIGNAL\_RT32

  SIGRT32

### DOMAIN TUNABLE CONSTANTS

The following constants are useful when accessing domain tuning parameters in APIs and events

- Sys::Virt::Domain::TUNABLE\_CPU\_CPU\_SHARES

  Proportional CPU weight

- Sys::Virt::Domain::TUNABLE\_CPU\_EMULATORPIN

  Emulator thread CPU pinning mask

- Sys::Virt::Domain::TUNABLE\_CPU\_EMULATOR\_PERIOD

  Emulator thread CPU period

- Sys::Virt::Domain::TUNABLE\_CPU\_EMULATOR\_QUOTA

  Emulator thread CPU quota

- Sys::Virt::Domain::TUNABLE\_CPU\_IOTHREAD\_PERIOD

  Iothread thread CPU period

- Sys::Virt::Domain::TUNABLE\_CPU\_IOTHREAD\_QUOTA

  Iothread thread CPU quota

- Sys::Virt::Domain::TUNABLE\_CPU\_VCPUPIN

  VCPU thread pinning mask

- Sys::Virt::Domain::TUNABLE\_CPU\_VCPU\_PERIOD

  VCPU thread period

- Sys::Virt::Domain::TUNABLE\_CPU\_VCPU\_QUOTA

  VCPU thread quota

- Sys::Virt::Domain::TUNABLE\_CPU\_GLOBAL\_PERIOD

  VM global period

- Sys::Virt::Domain::TUNABLE\_CPU\_GLOBAL\_QUOTA

  VM global quota

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_DISK

  The name of guest disks

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_READ\_BYTES\_SEC

  Read throughput in bytes per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_READ\_IOPS\_SEC

  Read throughput in I/O operations per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_TOTAL\_BYTES\_SEC

  Total throughput in bytes per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_TOTAL\_IOPS\_SEC

  Total throughput in I/O operations per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_WRITE\_BYTES\_SEC

  Write throughput in bytes per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_WRITE\_IOPS\_SEC

  Write throughput in I/O operations per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_READ\_BYTES\_SEC\_MAX

  Maximum read throughput in bytes per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_READ\_IOPS\_SEC\_MAX

  Maximum read throughput in I/O operations per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_TOTAL\_BYTES\_SEC\_MAX

  Maximum total throughput in bytes per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_TOTAL\_IOPS\_SEC\_MAX

  Maximum total throughput in I/O operations per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_WRITE\_BYTES\_SEC\_MAX

  Maximum write throughput in bytes per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_WRITE\_IOPS\_SEC\_MAX

  Maximum write throughput in I/O operations per sec

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_SIZE\_IOPS\_SEC

  The maximum I/O operations per second

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_TOTAL\_BYTES\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum total bytes processed per second.

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_READ\_BYTES\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum bytes read per second.

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_WRITE\_BYTES\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum bytes written per second.

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_TOTAL\_IOPS\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum total I/O operations processed per second.

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_READ\_IOPS\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum I/O operations read per second.

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_WRITE\_IOPS\_SEC\_MAX\_LENGTH

  The duration in seconds allowed for maximum I/O operations written per second.

- Sys::Virt::Domain::TUNABLE\_BLKDEV\_GROUP\_NAME

  The name of the blkdev group

- Sys::Virt::Domain::TUNABLE\_IOTHREADSPIN

  The I/O threads pinning

### DOMAIN LIFECYCLE CONSTANTS

The following constants are useful when setting action for lifecycle events.

- Sys::Virt::Domain::LIFECYCLE\_POWEROFF

  The poweroff lifecycle event type

- Sys::Virt::Domain::LIFECYCLE\_REBOOT

  The reboot lifecycle event type

- Sys::Virt::Domain::LIFECYCLE\_CRASH

  The crash lifecycle event type

### DOMAIN LIFECYCLE ACTION CONSTANTS

- Sys::Virt::Domain::LIFECYCLE\_ACTION\_DESTROY

  The destroy lifecycle action

- Sys::Virt::Domain::LIFECYCLE\_ACTION\_RESTART

  The restart lifecycle action

- Sys::Virt::Domain::LIFECYCLE\_ACTION\_RESTART\_RENAME

  The restart-rename lifecycle action

- Sys::Virt::Domain::LIFECYCLE\_ACTION\_PRESERVE

  The preserve lifecycle action

- Sys::Virt::Domain::LIFECYCLE\_ACTION\_COREDUMP\_DESTROY

  The coredump-destroy lifecycle action

- Sys::Virt::Domain::LIFECYCLE\_ACTION\_COREDUMP\_RESTART

  The coredump-restart lifecycle action

- Sys::Virt::Domain::LIFECYCLE\_ACTION\_PRESERVE\_RUNNING

  The preserve-running lifecycle action

### MEMORY FAILURE ACTION CONSTANTS

- Sys::Virt::Domain::EVENT\_MEMORY\_FAILURE\_ACTION\_IGNORE

  The failure could be ignored

- Sys::Virt::Domain::EVENT\_MEMORY\_FAILURE\_ACTION\_INJECT

  An MCE was injected to the guest

- Sys::Virt::Domain::EVENT\_MEMORY\_FAILURE\_ACTION\_FATAL

  The failure is non-recoverable and the hypervisor was not able to handle it

- Sys::Virt::Domain::EVENT\_MEMORY\_FAILURE\_ACTION\_RESET

  The failure is non-recoverable and the guest was not able to handle it.

### MEMORY FAILURE RECIPIENT CONSTANTS

- Sys::Virt::Domain::EVENT\_MEMORY\_FAILURE\_RECIPIENT\_HYPERVISOR

  The memory failure was in hypervisor address space

- Sys::Virt::Domain::EVENT\_MEMORY\_FAILURE\_RECIPIENT\_GUEST

  The memory failure was in guest address space

### MEMORY FAILURE FLAG CONSTANTS

- Sys::Virt::Domain::MEMORY\_FAILURE\_ACTION\_REQUIRED

  Whether the flag is action-required or action-optional

- Sys::Virt::Domain::MEMORY\_FAILURE\_RECURSIVE

  The failure occurred while the previous fault was being handled.

### MEMORY DIRTY RATE STATUS CONSTANTS

- Sys::Virt::Domain::DIRTYRATE\_UNSTARTED

  The dirty rate is not being measured currently.

- Sys::Virt::Domain::DIRTYRATE\_MEASURING

  The dity rate is in the process of being measured

- Sys::Virt::Domain::DIRTYRATE\_MEASURED

  The dirty rate has been measured

## AUTHORS

Daniel P. Berrange \<berrange@redhat.com\>

## COPYRIGHT

Copyright (C) 2006 Red Hat Copyright (C) 2006-2007 Daniel P. Berrange

## LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of either the GNU General Public License as published by the Free Software Foundation (either version 2 of the License, or at your option any later version), or, the Artistic License, as specified in the Perl README file.

## SEE ALSO

Sys::Virt, Sys::Virt::Error, `"http://libvirt.org"`
