Sys::V...:Domain(3pm)

๐Ÿฆ‹ Sys::Virt::Domain(3pm) ๐Ÿฆ‹

User Contributed Perl Documentation

โœจ NAME โœจ

Sys::Virt::Domain โ€” represent & manage a libvirt guest domain. That's the name, that's the mission, and honestly? iconic. ๐Ÿ’…

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so the Sys::Virt::Domain module represents a guest domain managed by the virtual machine monitor. It's the Perl-side main character energy for a VM, no cap. ๐Ÿฆ‹

๐Ÿ’… METHODS ๐Ÿ’…

  • my $id = $dom->get_id() โ€” returns an integer with a locally unique identifier for the domain. local ID slay โœจ
  • my $uuid = $dom->get_uuid() โ€” returns a 16 byte long string containing the raw globally unique identifier (UUID) for the domain. raw UUID vibes ๐ŸŽ€
  • my $uuid = $dom->get_uuid_string() โ€” returns a printable string representation of the raw UUID, in the format 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'. the way that this makes the UUID actually readable? obsessed. ๐Ÿ˜ญ
  • my $name = $dom->get_name() โ€” returns a string with a locally unique name of the domain. name drop, but local ๐Ÿ’–
  • 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. metadata moment โœจ
  • $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. set it, bestie ๐Ÿ’…
  • $dom->is_active() โ€” returns a true value if the domain is currently running. vibe check: active ๐Ÿ”ฅ
  • $dom->is_persistent() โ€” returns a true value if the domain has a persistent configuration file defined. persistent config realness ๐Ÿซถ
  • $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. stale config alert, lowkey ๐Ÿ˜ญ
  • 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. XML dump era ๐ŸŽ€
  • my $type = $dom->get_os_type() โ€” returns a string containing the name of the OS type running within the domain. OS type reveal ๐Ÿฆ‹
  • $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. boot it up, periodt โญ
  • $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. container kids, this one's for you ๐Ÿงš
  • $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. careful, bestie ๐Ÿซถ
  • $dom->suspend() โ€” temporarily stop execution of the domain, allowing later continuation by calling the resume method. pause button energy ๐Ÿ’œ
  • $dom->resume() โ€” resume execution of a domain previously halted with the suspend method. unpause slay โœจ
  • $dom->pm_wakeup() โ€” wakeup the guest from power management suspend state. rise and shine ๐ŸŒˆ
  • $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. nap time with a timer ๐ŸŽ€
  • $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. save state, stay iconic ๐Ÿ’…
  • $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. managed save main character ๐Ÿ‘‘
  • $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. does it have the image? vibe check ๐Ÿฆ‹
  • $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. full boot next time, no shortcuts ๐Ÿ”ฅ
  • $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 update, cute ๐ŸŽ€
  • $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. sensitive info, handle with care ๐Ÿ”
  • $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 parameter is currently unused and if omitted will default to 0. crash analysis era ๐Ÿ˜ญ
  • $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 parameter is currently unused and if omitted will default to 0. pick your dump format, bestie โœจ
    • 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. this is the unplug-the-power-cord method, fr fr ๐Ÿ’€
  • 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:

not me writing out every single reason constant, but bestie, we literally have to keep every fact. periodt. ๐Ÿ’…

  • 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 ๐Ÿ’–

Okay, picking up mid-lore: here are the rest of the domain state constants, bestie. These are literally the vibes your guest can be in, and the names tell you why it got there:

  • Sys::Virt::Domain::STATE_RUNNING_SAVE_CANCELED โ€” the guest is running after the save got canceled. ๐Ÿ’…
  • Sys::Virt::Domain::STATE_RUNNING_UNKNOWN โ€” nobody knows why the domain started. Itโ€™s a mystery, fr fr. ๐Ÿ™ˆ
  • Sys::Virt::Domain::STATE_RUNNING_UNPAUSED โ€” the guest is running after a resume.
  • Sys::Virt::Domain::STATE_RUNNING_WAKEUP โ€” the guest is running after waking up from power management suspend. โœจ
  • Sys::Virt::Domain::STATE_RUNNING_CRASHED โ€” the guest got 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 an 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.

And now back to the methods, because we are absolutely not done slaying:

  • my $info = $dom->get_control_info($flags=0) โ€” gives you a hash reference with info about the control channel. The keys in that 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); โ€” gets 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, and the second contains the remaining nanoseconds. ๐Ÿ•ฐ๏ธ
  • $dom->set_time($secs, $nsecs, $flags=0); โ€” sets 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 the domain's RTC.
  • $dom->set_user_password($username, $password, $flags=0); โ€” updates 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) โ€” changes 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. $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. (Yes, the page really spells it $holdtiem right there โ€” donโ€™t come for me. ๐Ÿ’€) @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 summarizing 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:
    • 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) โ€” sets 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) โ€” sets 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 the inactive config, defaulting to modifying the current state.
  • $dom->set_memory_stats_period($period, $flags) โ€” sets the period on which the guest's memory stats are refreshed, with $period being a value in seconds. The $flags parameter is currently unused.
  • $dom->shutdown() โ€” requests 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. โš ๏ธ
  • $dom->reboot([$flags]) โ€” requests that the guest OS perform a graceful shutdown and optionally restart. The optional $flags parameter is currently unused and, if omitted, defaults to zero.
  • $dom->reset([$flags]) โ€” performs 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() โ€” returns the maximum number of vcpus that are configured for the domain.
  • $dom->attach_device($xml[, $flags]) โ€” hotplugs 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]) โ€” hotunplugs 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]) โ€” hotunplugs 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]) โ€” updates 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]) โ€” peeks 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]) โ€” peeks 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(); โ€” returns a true value if the guest domain is configured to automatically start upon boot. Returns false otherwise.
  • $dom->set_autostart($flag) โ€” sets 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) โ€” configures the domain to be automatically started the next time the host machine boots only.
  • $dom->set_vcpus($count, [$flags]) โ€” sets 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 the inactive config.
  • $dom->set_vcpu($cpumap, $state, [$flags=0]) โ€” sets the state of the CPUs in $cpumap to $state. The $flags parameter accepts one or more of the SETVCPU OPTIONS constants documented later, and defaults to 0 if omitted.
  • $count = $dom->get_vcpus([$flags]) โ€” gets 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 the inactive config.
  • $dom->set_guest_vcpus($cpumap, $state, [$flags=0]) โ€” sets 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]) โ€” queries 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() โ€” returns the scheduler type for the guest domain. ๐Ÿ‘‘

๐Ÿ’พ $stats = $dom->block_stats($path)

Okay so this one grabs the current I/O stats for the block device at $path and hands you back a hash reference ๐Ÿ’… and the keys in it are:

  • rd_req โ€” how many read requests went through
  • rd_bytes โ€” how many bytes got read
  • wr_req โ€” how many write requests went through
  • wr_bytes โ€” how many bytes got written
  • errs โ€” "some kind of error count" (the docs literally say some kind, so bestie, don't ask me for more detail than that ๐Ÿ˜ญ)

๐Ÿง  my $params = $dom->get_scheduler_parameters($flags=0)

Returns the set of scheduler tunable parameters for the guest as a hash reference. Heads up tho: the exact keys in that hash are specific to the hypervisor โ€” so like, different hypervisors, different vibes, no cap ๐Ÿฆ‹

โœจ $dom->set_scheduler_parameters($params, $flags=0)

Updates the set of scheduler tunable parameters. The value names for tunables vary, and you can discover them using the get_scheduler_params call. (Yes, that name really does say params while the getter above says parameters โ€” that's the original's business, not mine, I'm just reporting it faithfully ๐Ÿ™ˆ)


๐ŸŒธ my $params = $dom->get_memory_parameters($flags=0)

Gives you a hash reference with the set of memory tunable parameters for the guest. The keys are one of the constants in MEMORY PARAMETERS, which is described later on in this doc. The $flags parameter accepts one or more of the CONFIG OPTION constants (also documented later), and defaults to 0 if you justโ€ฆ don't โœจ

๐Ÿ’œ $dom->set_memory_parameters($params, $flags=0)

Updates the memory tunable parameters for the guest. $params should be a hash reference whose keys are one of the MEMORY PARAMETERS constants. Same deal with $flags: one or more CONFIG OPTION constants, defaults to 0 if omitted ๐Ÿ’…


๐ŸŽ€ my $params = $dom->get_blkio_parameters($flags=0)

Returns a hash reference with the set of blkio tunable parameters for the guest. Keys = one of the BLKIO PARAMETERS constants described later. $flags takes one or more CONFIG OPTION constants and defaults to 0 if you skip it ๐Ÿซถ

๐Ÿ”ฅ $dom->set_blkio_parameters($params, $flags=0)

Updates the blkio tunable parameters for the guest. $params should be a hash reference whose keys are one of the BLKIO PARAMETERS constants. $flags โ€” you already know the drill โ€” one or more CONFIG OPTION constants, defaults to 0 ๐Ÿ˜Œ


โญ $stats = $dom->get_block_iotune($disk, $flags=0)

Returns a hash reference with the set of blkio tunable parameters for the guest disk $disk. The keys are one of the BLOCK IOTUNE PARAMETERS constants described later. It's giving "I know exactly which disk I'm obsessed with" energy ๐Ÿ’…

๐ŸŒˆ $dom->set_block_iotune($disk, $params, $flags=0);

Updates the blkio tunable parameters for the guest disk $disk. $params should be a hash reference whose keys are one of the BLOCK IOTUNE PARAMETERS constants. (Yup, the original's synopsis line really does end in a ; โ€” icon behaviour, keeping it ๐Ÿ’–)


๐Ÿฆ‹ my $params = $dom->get_interface_parameters($intf, $flags=0)

Returns a hash reference with the set of interface tunable parameters for the guest. Keys are one of the INTERFACE PARAMETERS constants described later ๐ŸŽ€

๐Ÿ“ $dom->set_interface_parameters($intf, $params, $flags=0)

Updates the interface tunable parameters for the guest. $params should be a hash reference whose keys are one of the INTERFACE PARAMETERS constants. Slay โœจ


๐Ÿงš my $params = $dom->get_numa_parameters($flags=0)

Returns a hash reference with the set of numa tunable parameters for the guest. Keys = one of the NUMA PARAMETERS constants described later. $flags accepts one or more CONFIG OPTION constants and defaults to 0 if omitted ๐Ÿ’œ

๐Ÿ’ซ $dom->set_numa_parameters($params, $flags=0)

Updates the numa tunable parameters for the guest. $params should be a hash reference whose keys are one of the NUMA PARAMETERS constants. $flags: one or more CONFIG OPTION constants, defaults to 0 if omitted ๐ŸŒธ


๐Ÿ‘‘ my $params = $dom->get_perf_events($flags=0)

Returns a hash reference containing the set of performance events available for the guest. Keys are one of the PERF EVENTS constants described later. $flags accepts one or more CONFIG OPTION constants, and defaults to 0 if omitted ๐Ÿ”ฅ

๐ŸŽฏ $dom->set_perf_events($params, $flags=0)

Updates the enabled state for performance events for the guest. $params should be a hash reference whose keys are one of the PERF EVENTS constants. $flags โ€” one or more CONFIG OPTION constants, defaults to 0 if omitted. Periodt ๐Ÿ’…


๐Ÿ“ $dom->block_resize($disk, $newsize, $flags=0)

Resizes the disk $disk to have new size $newsize KB. And here's the important bit, bestie, so pay attention ๐Ÿ‘€ โ€” if the disk is backed by a special image format, the actual resize is done by the hypervisor. But if the disk is backed by a raw file, or block device, then the resize must be done prior to invoking this API call, and this call merely updates the hypervisor's view of the disk size. So like, do the actual resizing yourself first, this is just the announcement ๐Ÿ’€

Flags you can use:

  • 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)

Fetches the current I/O statistics for the block device given by $path. (Yes, the original says "block device" right here in the interface stats entry โ€” I'm not gonna gaslight you and pretend it says network interface, I'm telling you exactly what it says ๐Ÿต) 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)

Fetches the current memory statistics for the guest domain. The $flags parameter is currently unused and can be omitted entirely (it's giving filler episode, honestly ๐Ÿ™ˆ). 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()

Fetches info 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. Important caveat tho โ€” this method only returns info about the first security label. If you want all of them, use get_security_label_list ๐Ÿ’…

๐Ÿท๏ธ @info = $dom->get_security_label_list()

Fetches info about all security labels assigned to the guest domain. Every element in the returned array is a hash reference, with keys exactly as described for get_security_label. So like, the full collection, no crumbs left behind โœจ


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

Moves a domain to a whole other host โ€” main character relocation arc ๐Ÿ‘‘ 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. And %params is a hash reference used to set various parameters for the migration operation, with these 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 a suitable default URI. It's 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 the 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 โ€” so like, vibe check your hypervisor first ๐Ÿ’€

  • Sys::Virt::Domain::MIGRATE_PARAM_GRAPHICS_URI โ€” URI to use for migrating client's connection to the 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 direct access to the network the 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 max bandwidth (in MiB/s) that migration gets to use during the post-copy phase ๐Ÿƒโ€โ™€๏ธ๐Ÿ’จ. If you set it to 0 or just... don't, libvirt picks a suitable default for you. Heads up tho: some hypervisors literally don't support this feature and will throw an error if this field is used and isn't 0 ๐Ÿ’€.
  • Sys::Virt::Domain::MIGRATE_PARAM_LISTEN_ADDRESS โ€” the address to listen on for incoming migration connections ๐ŸŽง. If you omit it, libvirt listens on the wildcard address (0.0.0.0 or ::). And ngl, that default may be a security risk if guests or other untrusted users can connect to the virtualization host โ€” so an explicit restricted listen address is recommended, bestie. Protect yourself ๐Ÿ’….
  • Sys::Virt::Domain::MIGRATE_PARAM_DISK_PORT โ€” the port the destination server should use for incoming disks migration ๐Ÿ”Œ. Type is VIR_TYPED_PARAM_INT. If set to 0 or omitted, libvirt chooses a suitable default. At the moment this is only supported by the QEMU driver, iykyk.
  • Sys::Virt::Domain::MIGRATE_PARAM_MIGRATE_DISKS โ€” the list of disks to migrate when you're doing block storage migration ๐Ÿ’พ. And this one's a lil different from the other params: instead of a plain string, the value should be an array reference, whose elements are in turn strings representing the disk target names. Slay.
  • Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION โ€” the type of compression method to use, either "xbzrle" or "mt" ๐Ÿ—œ๏ธโœจ.
  • Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_THREADS โ€” the number of compression threads ๐Ÿงต.
  • Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_DTHREADS โ€” the number of decompression threads ๐Ÿงต (the de- version, obviously).
  • 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 ๐Ÿ”. So usually the TLS certificate from the destination host has to match the host's name for TLS verification to succeed. But when the certificate doesn't match the destination hostname and you do know the expected certificate's hostname, this parameter lets you pass that expected hostname when starting the migration. Crisis averted ๐Ÿซถ.
  • 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 auto-generates a suitable default URI. It's typically only necessary to specify this URI if the destination host has multiple interfaces and a specific interface is required to transmit storage data. Fancy ๐Ÿ’….
  • Sys::Virt::Domain::MIGRATE_PARAM_ZLIB_LEVEL โ€” the level of compression for zlib. Accepted values are in the 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 the 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 a list of disks so you avoid transferring zero blocks ๐Ÿ•ณ๏ธ. And this one comes with an actual warning, bestie:
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 ๐Ÿ˜ญ. Like, fr fr, don't skip that.

Same deal as MIGRATE_PARAM_MIGRATE_DISKS: instead of a plain string, the 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 max 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. Iconic of QEMU tbh.
  • 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 ๐Ÿฆ‹. The way that using positional parameters with migrate is deprecated in favour of passing a hash reference as described above โ€” so use the hash ref, bestie, the positional thing is giving legacy ๐Ÿ’€.

$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. Yeah, it's old news ๐Ÿ™ˆ.

$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. Chef's kiss ๐Ÿ‘‘

$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. Same energy as before, pls stop using positional args ๐Ÿ˜ญ.

$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. It's giving old era โœจ.

$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 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 โ€” and yes, the doc really does call it <bandwidth> there, that's what it says, copying it verbatim ๐Ÿซ . 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. No flag, no switch, that's the rule โœ‹.

$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 ๐Ÿšช. And this method is preferred over open_graphics since it will work correctly under sVirt mandatory access control policies. The upgrade u deserve ๐Ÿ‘‘.

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)

Bestie, this one grabs the tea on every vCPU in a running guest domain. You get back a list with one element per vCPU, and each element is a hash reference. The hash keys are: number โ€” the vCPU number; cpu โ€” the physical CPU where that vCPU is currently scheduled; cpuTime โ€” the cumulative execution time of the vCPU; state โ€” the running state; and affinity โ€” the allowed scheduler placement. The affinity value 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, and cpu values are only available if you use a $flags value of 0 and the domain is currently running. Otherwise theyโ€™ll all be set to zero. No cap, thatโ€™s just how it is ๐Ÿ’….

$dom->pin_vcpu($vcpu, $mask)

Pins the virtual CPU given by index $vcpu to the physical CPUs given by $mask. The $mask is a string representing a bitmask against physical CPUs, 8 cpus per character. Lock it in, bestie ๐Ÿ”’


$mask = $dom->get_emulator_pin_info()

Gets the CPU affinity info for the emulator process, slay. 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)

Pins 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. Emulator threads? Pinned. Periodt ๐Ÿงš


@iothreadinfo = $dom->get_iothread_info($flags=0)

IOThread info incoming! This checks the state of all IOThreads in a running guest domain. The returned list has one element for each IOThread, and each element is a hash reference. The keys are: number โ€” the IOThread number; and affinity โ€” the allowed scheduler placement. The affinity value 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. iykyk ๐Ÿ˜Œ


$dom->pin_iothread($iothread, $mask)

Pins the IOThread given by index $iothread to the physical CPUs given by $mask. The $mask is a string representing a bitmask against physical CPUs, 8 cpus per character. Another one pinned, no biggie ๐Ÿ’…


$dom->add_iothread($iothread, $flags=0)

Adds 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. New thread, who dis? ๐Ÿฆ‹


$dom->del_iothread($iothread, $flags=0)

Deletes 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. Bye-bye, IOThread ๐Ÿ‘‹


$dom->set_iothread($iothread, $params, $flags=0)

Sets 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. Customizing the vibe check โš™๏ธ


my @stats = $dom->get_cpu_stats($startCpu, $numCpus, $flags=0)

Requests the guests host physical CPU usage statistics, starting from host CPU $startCpu and 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. Number-crunching era ๐Ÿ”ข


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.

Job info? We got it. Obsessed ๐Ÿซถ


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 whatever job is currently running. Like, right now. The valid $flags are:

  • Sys::Virt::Domain::DOMAIN_ABORT_JOB_POSTCOPY โ€” interrupt post-copy migration. The good news? It can be resumed later using the migrate APIs with the "MIGRATE_POSTCOPY_RESUME" flag. So it's not a permanent goodbye, bestie ๐Ÿซถ

my $info = $dom->get_block_job_info($path, $flags=0)

Hands you back a hash reference that summarises the execution state of the block job โœจ The $path parameter should be the fully qualified path of the block device that's being changed. Valid $flags include:

  • Sys::Virt::Domain::BLOCK_JOB_INFO_BANDWIDTH_BYTES โ€” treat the 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 currently executing for $path. The $bandwidth argument is specified in MB/s. The $flags parameter can take the bitwise union of these values:

  • Sys::Virt::Domain::BLOCK_JOB_SPEED_BANDWIDTH_BYTES โ€” the $bandwidth value is measured in bytes/s instead of MB/s.

$dom->abort_block_job($path, $flags=0)

Abort the current job that's executing for the block device associated with $path. Bye job ๐Ÿ‘‹


$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 these values:

  • Sys::Virt::Domain::BLOCK_PULL_BANDWIDTH_BYTES โ€” the $bandwidth 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 โ€” glow-up for your backing chain ๐Ÿ’… The $bandwidth parameter specifies the maximum I/O rate to allow, in MB/s. The $flags parameter can take the bitwise union of these values:

  • Sys::Virt::Domain::BLOCK_REBASE_BANDWIDTH_BYTES โ€” the $bandwidth value is measured in bytes/s instead of MB/s.

$dom->block_copy($path, $destxml, $params, $flags=0)

Copy the 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 the changes that were made to the temporary top level file $top. It takes all the differences between $top and $base and merges 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 these values:

  • Sys::Virt::Domain::BLOCK_COMMIT_BANDWIDTH_BYTES โ€” the $bandwidth value is measured in bytes instead of MB/s.

$count = $dom->num_of_snapshots()

Return the number of saved snapshots for the domain. Just the count, no vibes attached ๐Ÿ”ข


@names = $dom->list_snapshot_names()

List the names of all saved snapshots โœจ Those names can be used with "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. Heads up though: this method requires O(n) RPC calls, so the "list_all_snapshots" method is recommended as the 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 returned domain snapshots ๐Ÿ”ฅ


my $snapshot = $dom->get_snapshot_by_name($name)

Return the domain snapshot whose name is $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. A yes/no vibe check ๐Ÿซถ


$snapshot = $dom->current_snapshot()

Returns the currently active snapshot for the domain โ€” the main character snapshot, if you will ๐Ÿ‘‘


$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 returned domain checkpoints ๐Ÿ’–


my $checkpoint = $dom->get_checkpoint_by_name($name)

Return the domain checkpoint whose name is $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 the same point in time as the backup. The optional $flags parameter can be one of these constants:

  • Sys::Virt::Domain::BACKUP_BEGIN_REUSE_EXTERNAL โ€” assume that the output/temporary files for the backup have already 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 โœจ But if there's no backup job running? An error is raised. No job, no XML, periodt ๐Ÿ˜ญ


$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 contains one element per filesystem, and each value is a hash reference with these 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 the list of device aliases associated with the guest device. These 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 these 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 contains one element for each interface. Each value in the list is a hash reference with these keys:

  • name โ€” the name of the guest interface that is mounted.
  • hwaddr โ€” the hardware address, aka MAC, if available.
  • addrs โ€” an array reference containing the list of IP addresses associated with the guest NIC. Each element in that 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 ๐Ÿ’€ Real talk though: the $signum value must be one of the constants listed later, not a POSIX or Linux signal value. Don't try it, bestie. $flags is currently unused and defaults to zero.


$dom->set_block_threshold($dev, $threshold, $flags=0);

Set the threshold level for delivering EVENT_ID_BLOCK_THRESHOLD if the device or backing chain element described by $dev gets written beyond the set $threshold level ๐Ÿšจ The threshold level is unset once the event fires. And ngl, 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 the 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 these 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)

okay so this one sets info about the domain launch security state. and listen โ€” $flags is currently unused and defaults to zero, so literally just leave it alone bestie, it's giving decorative.

The hash you pass in may contain these 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. and if you omit it? no stress, it can be automatically determined from the firmware ๐Ÿงš

๐Ÿฆ‹ $info = $dom->get_guest_info($types, $flags=0)

Get info about the domain guest configuration, periodt. The $types parameter is the main character here โ€” it decides what pieces of information come back, and you build it by bitwise-or-ing these constants together ๐Ÿ‘‘

  • 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. (pretty name!! she understood the assignment ๐Ÿ’…)
    • 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. (yes it's a whole little name stack, she's nested like that ๐Ÿช†)
    • 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 ๐Ÿ“

$flags is currently unused and defaults to zero. (iconic behaviour honestly, it's just vibing there)

$dom->set_agent_response_timeout($timeout, $flags=0)

Sets how long we wait for guest agent to answer a command before we're like "ok bestie I'm leaving". $timeout is a positive integer = the number of seconds to wait, or one of these constants:

  • Sys::Virt::Domain::AGENT_RESPONSE_TIMEOUT_BLOCK โ€” wait forever, no timeout at all. main character patience โœจ
  • Sys::Virt::Domain::AGENT_RESPONSE_TIMEOUT_NOWAIT โ€” don't want at all, return immediately. literally zero chill ๐Ÿ’€
  • Sys::Virt::Domain::AGENT_RESPONSE_TIMEOUT_DEFAULT โ€” use the hypervisor driver's default timeout, let the driver decide, iykyk

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

my @keys = $dom->authorized_ssh_keys_get($user, $flags=0)

Gets you 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)

Updates the list of authorized SSH keys for the user account $user. The @keys parameter should be an array reference holding the new keys, if any. Default behaviour = set the authorized SSH keys to exactly the set you specified in @keys, no leftovers, periodt. You can modify that with the $flags parameter, which takes these constants:

  • Sys::Virt::Domain::AUTHORIZED_SSH_KEYS_SET_APPEND โ€” append @keys to the current set of keys instead of replacing the existing keys ๐Ÿ’…
  • Sys::Virt::Domain::AUTHORIZED_SSH_KEYS_SET_REMOVE โ€” remove @keys from the current set of keys instead of replacing the existing keys. And it is not an error if the keys do not exist, so you can't get in trouble for it ๐Ÿ™ˆ

my @msgs = $dom->get_messages($flags=0)

Retrieves 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 (that's the original phrasing, we keep the facts but the typo... yeah it's documented like that ๐Ÿซถ)
  • 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)

Requests calculation of the domain's memory dirty rate over the next $secs seconds. And yes, the signature literally lists $dom in there, that's how it's written, do not come for me ๐Ÿ’€ $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)

Associates a set of file descriptors in @fds with the domain and gives 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)

Requests a reload of the graphics backend state. The $type parameter says what type of graphics backend to reload if there are multiple present. It takes one of these 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)

Deletes a throttlegroup from the domain. The $group you're deleting must not have a throttlefilter associated with it, and it can be any of the current valid group. ๐Ÿ—‘๏ธ

$dom->set_throttle_group($group, $params, $flags=0)

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


โœจ CONSTANTS โœจ

A bunch of the APIs take a "flags" parameter. In most cases passing a value of zero will be totally satisfactory, no notes. Some APIs, however, accept named constants to alter their behaviour. This section documents the currently known constants ๐Ÿ‘‘

๐Ÿฆ‹ DOMAIN STATE

These are useful for 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

These constants tell you 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 these 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

These 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

These control the behaviour of domain define operations:

  • Sys::Virt::Domain::DEFINE_VALIDATE โ€” validate the XML document against the XML schema

โŒจ๏ธ KEYCODE SETS

These 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

These 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

These 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

These 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

These 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

These 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

These 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

These 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. โš ๏ธ (yes, actual passwords, be careful who sees this dump bestie)
  • 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

These control device hotplug operations:

  • Sys::Virt::Domain::DEVICE_MODIFY_CURRENT โ€” modify the domain in its current state
  • Sys::Virt::Domain::DEVICE_MODIFY_LIVE โ€” only touches the live state of the domain, like editing the running vibe without saving
  • Sys::Virt::Domain::DEVICE_MODIFY_CONFIG โ€” only touches the persistent config of the domain, so it changes what's written down, not what's happening rn
  • Sys::Virt::Domain::DEVICE_MODIFY_FORCE โ€” bestie said do it, so it forces the device to be modified ๐Ÿ’…

๐ŸŒธ MEMORY OPTIONS ๐ŸŒธ

okay so these constants are the little dials that 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, aka the absolute ceiling

๐ŸŽ€ CONFIG OPTIONS ๐ŸŽ€

these ones decide what configuration a domain update actually changes โ€” choose wisely fr fr

  • 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 constants that 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 (so like, fire and forget, no cap)

๐Ÿ”ฅ MIGRATE OPTIONS ๐Ÿ”ฅ

the constants that control how migration is performed โ€” this is the main-character section, buckle up ๐Ÿ’€

  • 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 the 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 you're 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 ๐Ÿ’€ (it's literally called unsafe, bestie)
  • 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 it's 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 the discretion of the hypervisor implementation

โญ UNDEFINE CONSTANTS โญ

the following constants can be used when undefining virtual domain configurations โ€” think of it as the "what else should I clean up while I'm here" menu ๐Ÿงน

  • 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 the 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 the TPM state when undefining the virtual domain

๐Ÿ’œ JOB TYPES ๐Ÿ’œ

these constants describe the different background job types โ€” like, what is your domain even doing behind the scenes rn

  • 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 ๐Ÿ“

these 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 ๐ŸŒˆ

these parameters control I/O tuning for the domain as a whole โ€” the whole-domain vibe check, not per-disk

  • 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 ๐Ÿ‘‘

and these ones control I/O tuning for an individual guest disk โ€” one disk at a time, main character energy ๐Ÿซถ

  • 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 ๐Ÿงš

the scheduler knobs, aka how much CPU love your VM gets ๐Ÿ’–

  • 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 ๐Ÿฆ‹

Okay bestie, these constants are the ones you want when you're getting/setting the guest NUMA memory policy ๐Ÿ’…

  • Sys::Virt::Domain::NUMA_MODE โ€” the NUMA policy mode, that's the vibe selector
  • Sys::Virt::Domain::NUMA_NODESET โ€” the NUMA nodeset mask, aka which nodes are invited to the party

And these next ones are what you use to interpret the value of that Sys::Virt::Domain::NUMA_MODE parameter ๐Ÿ‘€

  • Sys::Virt::Domain::NUMATUNE_MEM_STRICT โ€” allocation is mandatory from the mask nodes, no substitutions, periodt
  • Sys::Virt::Domain::NUMATUNE_MEM_PREFERRED โ€” allocation is preferred from the masked nodes, like, it'd be nice
  • Sys::Virt::Domain::NUMATUNE_MEM_INTERLEAVE โ€” allocation is interleaved across all masked nodes, spreading the love ๐ŸŒˆ
  • Sys::Virt::Domain::NUMATUNE_MEM_RESTRICTIVE โ€” allocation is determined by the host using the masked nodes.

๐ŸŽ€ INTERFACE PARAMETERS ๐ŸŽ€

These constants are your go-tos when getting/setting the per network interface tunable parameters โ€” the little knobs on your NIC โœจ

  • 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 (the floor, literally the floor)
  • 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

๐Ÿ”ฅ PERF EVENTS ๐Ÿ”ฅ

These constants define performance events that you can monitor for a guest โ€” it's giving main character observability ๐Ÿ‘‘

  • Sys::Virt::Domain::PERF_PARAM_CMT โ€” the CMT event counter, which you use 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, for monitoring 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, for monitoring 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures 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 measures the count of emulation faults by applications running on the platform. It corresponds to the perf.emulation_faults field in the *Stats APIs.

That's a lot of counters and honestly? iconic. Go off, perf subsystem ๐Ÿ’€


๐Ÿงš IOTHREAD STATS ๐Ÿงš

These constants define IOThread statistics that you can monitor for a guest โ€” the lowkey backstage crew of your domain ๐Ÿซถ

  • Sys::Virt::Domain::IOTHREAD_PARAM_POLL_MAX_NS โ€” the maximum polling time that can be used by the 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 gets dynamically modified over time based on the poll_grow and poll_shrink parameters you provide.
  • Sys::Virt::Domain::IOTHREAD_PARAM_POLL_GROW โ€” gives the dynamic polling adjustment algorithm a value to use when growing its polling interval, all the way up to the poll_max_ns value.
  • Sys::Virt::Domain::IOTHREAD_PARAM_POLL_SHRINK โ€” gives the dynamic polling adjustment algorithm a value to use when shrinking its polling interval, for when the polling interval exceeds the poll_max_ns value.
  • Sys::Virt::Domain::IOTHREAD_PARAM_THREAD_POOL_MIN โ€” sets the lower bound for thread pool size. A value of -1 disables this bound, leaving the hypervisor to use its default value โ€” though heads up, that 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 the hypervisor to use its default value โ€” and again, that value is not accepted for running domains. Since the upper bound has to be equal to or greater than the lower bound, a value of 0 is not accepted. Due to internal implementation, it's recommended to set lower and upper bounds separately.
bestie pls note those -1 and 0 caveats, they will absolutely catch you slippin' ๐Ÿ™ˆ

๐Ÿ’œ VCPU FLAGS ๐Ÿ’œ

These constants are useful when getting/setting the VCPU count for a guest โ€” vCPU math, but make it fashion โœจ

  • 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) โ€” impatient queen behavior, no cap

๐ŸŒˆ STATE CHANGE EVENTS ๐ŸŒˆ

These constants let you interpret domain state change events. Each event contains both a state change and a reason โ€” so it's like a story with a plot twist ๐ŸŽฌ

  • 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 โ€” bestie the domain came back to life because migration finished ๐ŸŽ‰ and heads up: this one gets emitted on the destination host, not where it came from.
    • Sys::Virt::Domain::EVENT_RESUMED_UNPAUSED โ€” the domain resumed because the admin literally just unpaused it. that's it, that's the reason ๐Ÿ’…
    • Sys::Virt::Domain::EVENT_RESUMED_FROM_SNAPSHOT โ€” resumed because it got restored from a snapshot. time travel vibes โœจ
    • Sys::Virt::Domain::EVENT_RESUMED_POSTCOPY โ€” the domain is resumed, but post-copy is still running in the background ๐Ÿ‘€ like it's smiling but it's still working.
    • Sys::Virt::Domain::EVENT_RESUMED_POSTCOPY_FAILED โ€” okay so the domain is running, but migration failed in post-copy. ๐Ÿ˜ญ running but not okay.

  • Sys::Virt::Domain::EVENT_STARTED โ€” the domain has started running!! main character energy activated ๐Ÿ‘‘
    • Sys::Virt::Domain::EVENT_STARTED_BOOTED โ€” the domain was booted from a shutoff state. classic fresh start ๐ŸŒธ
    • Sys::Virt::Domain::EVENT_STARTED_MIGRATED โ€” started due to an incoming migration, so it basically moved in from another host ๐Ÿงณ
    • Sys::Virt::Domain::EVENT_STARTED_RESTORED โ€” restored from a saved state file. nap โ†’ wake, no notes ๐Ÿ’ค
    • Sys::Virt::Domain::EVENT_STARTED_FROM_SNAPSHOT โ€” restored from a snapshot ๐Ÿ“ธ
    • Sys::Virt::Domain::EVENT_STARTED_WAKEUP โ€” woken up from suspend. the domain said "five more minutes" and then got up anyway โฐ
    • 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. it's giving closed for business ๐Ÿšช
    • Sys::Virt::Domain::EVENT_STOPPED_CRASHED โ€” stopped because the guest operating system has crashed ๐Ÿ’€ not the vibe.
    • Sys::Virt::Domain::EVENT_STOPPED_DESTROYED โ€” stopped because the administrator issued a destroy command. admin said "nope" ๐Ÿซก
    • Sys::Virt::Domain::EVENT_STOPPED_FAILED โ€” stopped because of a fault in the host virtualization environment ๐Ÿ› ๏ธ
    • Sys::Virt::Domain::EVENT_STOPPED_MIGRATED โ€” stopped because it was migrated to another machine โœˆ๏ธ bye bestie
    • Sys::Virt::Domain::EVENT_STOPPED_SAVED โ€” the domain was saved to a state file ๐Ÿ’พ
    • Sys::Virt::Domain::EVENT_STOPPED_SHUTDOWN โ€” stopped due to graceful shutdown of the guest. so polite ๐ŸŒท
    • Sys::Virt::Domain::EVENT_STOPPED_FROM_SNAPSHOT โ€” 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 shut down but is not yet stopped โ€” like it's leaving the party but still saying goodbyes ๐Ÿฅน
    • Sys::Virt::Domain::EVENT_SHUTDOWN_FINISHED โ€” the domain finished shutting down โœ…
    • Sys::Virt::Domain::EVENT_SHUTDOWN_HOST โ€” shutdown due to a host trigger ๐Ÿ–ฅ๏ธ
    • Sys::Virt::Domain::EVENT_SHUTDOWN_GUEST โ€” shutdown due to a guest trigger ๐ŸŽฎ
  • Sys::Virt::Domain::EVENT_SUSPENDED โ€” the domain has stopped executing but still exists. sleeping beauty energy, no cap ๐Ÿ˜ด
    • Sys::Virt::Domain::EVENT_SUSPENDED_MIGRATED โ€” suspended due to offline migration ๐Ÿงณ
    • Sys::Virt::Domain::EVENT_SUSPENDED_PAUSED โ€” suspended due to an administrator pause request โœ‹
    • Sys::Virt::Domain::EVENT_SUSPENDED_IOERROR โ€” suspended due to a block device I/O error. yikes ๐Ÿšจ
    • Sys::Virt::Domain::EVENT_SUSPENDED_FROM_SNAPSHOT โ€” suspended due to a resume from snapshot ๐Ÿ“ธ
    • Sys::Virt::Domain::EVENT_SUSPENDED_WATCHDOG โ€” suspended due to the watchdog triggering ๐Ÿ•
    • Sys::Virt::Domain::EVENT_SUSPENDED_RESTORED โ€” suspended due to a restore from saved state ๐Ÿ’พ
    • Sys::Virt::Domain::EVENT_SUSPENDED_API_ERROR โ€” suspended due to an API error ๐Ÿ˜ตโ€๐Ÿ’ซ
    • Sys::Virt::Domain::EVENT_SUSPENDED_POSTCOPY โ€” suspended for post-copy migration ๐Ÿ•“
    • Sys::Virt::Domain::EVENT_SUSPENDED_POSTCOPY_FAILED โ€” suspended due to post-copy migration failing ๐Ÿ’”
    • Sys::Virt::Domain::EVENT_SUSPENDED_GUEST_SHUTDOWN โ€” suspended after guest os shut-down โ€” and note that 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 is gone because the administrator removed it ๐Ÿ—‘๏ธ
    • 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 โ€” crashed due to a kernel panic ๐Ÿ˜ฑ
    • Sys::Virt::Domain::EVENT_CRASHED_CRASHLOADED โ€” the domain has crashed and reloaded itself. honestly iconic, it got back up ๐Ÿ”„

โœจ EVENT ID CONSTANTS โœจ

These are the big category IDs โ€” the vibe check for what kind of event you're looking at ๐ŸŽซ

  • 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, but 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 the changed parameters, and the later DOMAIN TUNABLE constants can be super useful when accessing the hash keys ๐Ÿ”ง
  • Sys::Virt::Domain::EVENT_ID_AGENT_LIFECYCLE โ€” domain guest agent lifecycle events. the "state" parameter passed to the callback will match one of these 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 passed 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, and the keys in that 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 โ€” fires when the hypervisor detects that the given storage element was written beyond the point specified by threshold. genuinely so useful for thin-provisioned storage ๐Ÿ‘‘๐Ÿ“ฆ
  • Sys::Virt::Domain::EVENT_ID_MEMORY_FAILURE โ€” fires when the hypervisor detects hardware memory corruption ๐Ÿ’€
  • Sys::Virt::Domain::EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE โ€” fires when the guest accepts a request to change the memory device size ๐Ÿ“
  • Sys::Virt::Domain::EVENT_ID_NIC_MAC_CHANGE โ€” fires when the guest changes the MAC address on one of its virtual network interfaces ๐Ÿชช
  • Sys::Virt::Domain::EVENT_ID_VCPU_REMOVED โ€” fires when a vCPU is removed from the domain ๐Ÿงฉ
  • Sys::Virt::Domain::EVENT_ID_CHANNEL_LIFECYCLE โ€” domain channel lifecycle events. the "state" parameter passed to the callback will match one of these 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. like, what did we do about it ๐Ÿ’…

  • Sys::Virt::Domain::EVENT_IO_ERROR_NONE โ€” no action was taken; the error was ignored & reported as success to the 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. the dog barked, now what ๐Ÿ””

  • 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 tried to gracefully shut down 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, bestie ๐Ÿ–ผ๏ธ

  • 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 โ€” filters to only the domains that have a stored snapshot ๐Ÿ“ธ
  • Sys::Virt::Domain::LIST_INACTIVE โ€” filters to only the domains that are currently inactive (shutoff, saved) ๐Ÿ˜ด
  • Sys::Virt::Domain::LIST_MANAGEDSAVE โ€” filters to only the domains that currently have a managed save state ๐Ÿ’พ
  • Sys::Virt::Domain::LIST_NO_AUTOSTART โ€” filters to only the domains that are not set to automatically start on boto ๐Ÿฅพ (yes bestie, "boto" โ€” that's literally what the source says, it means boot, we love a typo that ate)
  • Sys::Virt::Domain::LIST_NO_MANAGEDSAVE โ€” filters to only the domains that have no managed save state at all ๐Ÿšซ
  • Sys::Virt::Domain::LIST_NO_SNAPSHOT โ€” filters to only the domains with no stored snapshot ๐Ÿ™…โ€โ™€๏ธ
  • Sys::Virt::Domain::LIST_OTHER โ€” filters to only the domains that are not running, paused or shutoff ๐Ÿ‘ป
  • Sys::Virt::Domain::LIST_PAUSED โ€” filters to only the domains that are paused โธ๏ธ
  • Sys::Virt::Domain::LIST_PERSISTENT โ€” filters to only the domains that have a persistent config ๐Ÿ“Œ
  • Sys::Virt::Domain::LIST_RUNNING โ€” filters to only the domains that are currently running ๐Ÿƒโ€โ™€๏ธ
  • Sys::Virt::Domain::LIST_SHUTOFF โ€” filters to only the domains that are currently shutoff ๐Ÿ”Œ
  • Sys::Virt::Domain::LIST_TRANSIENT โ€” filters to only the domains that do not have a persistent config ๐Ÿซง
  • Sys::Virt::Domain::LIST_HAS_CHECKPOINT โ€” filters to only the domains that have a stored checkpoint โœ…
  • Sys::Virt::Domain::LIST_NO_CHECKPOINT โ€” filters to only the domains that do not have a stored checkpoint โŒ

๐Ÿ”‘ SEND KEY CONSTANTS ๐Ÿ”‘

These next ones are literally only for the send_key API, iykyk:

  • Sys::Virt::Domain::SEND_KEY_MAX_KEYS โ€” the maximum number of keys you can send in a single call to send_key โŒจ๏ธ (so like, don't go over it, the API said what it said)

๐Ÿ“Š BLOCK STATS CONSTANTS ๐Ÿ“Š

These give you the names of the 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 names of the well known cpu stats fields, iconic behaviour:

  • Sys::Virt::Domain::CPU_STATS_CPUTIME โ€” the total CPU time, including both hypervisor and vCPU time ๐Ÿงฎ
  • Sys::Virt::Domain::CPU_STATS_USERTIME โ€” ok so the source literally says "THe total time in kernel" for this one ๐Ÿ™ˆ (capital T and everything, and yeah it's describing kernel time under the *user*time constant โ€” I'm not fixing it, I'm just reporting it, bestie)
  • Sys::Virt::Domain::CPU_STATS_SYSTEMTIME โ€” and this one says "The total time in userspace" ๐ŸŒ€ (same energy โ€” swapped descriptions, and honestly? we're just gonna sit with that)
  • Sys::Virt::Domain::CPU_STATS_VCPUTIME โ€” the total vCPU time โšก

๐Ÿง  CPU STATS CONSTANTS ๐Ÿง 

Not a glitch, not me repeating myself โ€” the page literally has this heading twice ๐Ÿ˜ญ but the vibe this time is schedular parameters (spelling theirs, not mine) ๐ŸŒˆ:

  • 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 ๐Ÿšฉ

These are the flags you pass 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 ๐Ÿ˜ค no half-measures
  • 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 โญ๏ธ (impatient queen energy)

๐ŸŽ›๏ธ DOMAIN STATS FIELD CONSTANTS ๐ŸŽ›๏ธ

These control which fields come back on a stats query ๐ŸŽš๏ธ:

๐ŸŽˆ 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 ๐Ÿ“ค (note: plain unsigned long here, not long long โ€” that's how it's written)
  • 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 ๐Ÿงฉ (build-a-param workshop, we love to see it)
  • 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 ๐Ÿ“ฆ (yep, plain 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 ๐Ÿ” (yeah, it says alignment again, same words as the one above โ€” I'm reporting, not adjudicating, bestie)
  • 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 ๐Ÿ“

okay bestie, we're still in the block-stat suffix constants and they are long, but every single one is here so nobody has to guess ๐Ÿ’…โœจ

  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_HW_MAX โ€” max hardware transfer length, in bytes, for requests that bypass the kernel IO scheduler; type is unsigned long long.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_MAX โ€” max transfer length, in bytes; type is unsigned long long.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_OPTIMAL โ€” optimal transfer length, in bytes; type is unsigned long long.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_WRITE_ZEROES_ALIGNMENT โ€” optimal alignment for write_zeroes requests, in bytes; type is unsigned long long.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_WRITE_ZEROES_MAX โ€” max number of bytes that can be zeroed out at once; type is unsigned long long.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_COUNT โ€” number of groups of statistics accounted in configured time intervals; type is unsigned long long.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_PREFIX โ€” the parameter-name prefix for each group of timed stats. Concatenate this prefix, the entry number formatted as an unsigned integer, and one of the timed-group suffix params to make a complete parameter name ๐Ÿซถ
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_AVG โ€” average latency of flush operations in the defined interval, in nanoseconds; type is 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; type is 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; type is 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 stats 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; type is 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; type is 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; type is 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; type is double.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_AVG โ€” average latency of write operations in the defined interval, in nanoseconds; type is 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; type is 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; type is 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; type is 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; type is 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; type is 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; type is 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; type is double.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_FLUSH_PREFIX โ€” the parameter-name prefix for 'flush' latency histograms.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_READ_PREFIX โ€” the parameter-name prefix for 'read' latency histograms.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_WRITE_PREFIX โ€” the parameter-name prefix for 'write' latency histograms.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_ZONE_APPEND_PREFIX โ€” the parameter-name prefix for 'zone_append' latency histograms.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_SUFFIX_BIN_COUNT โ€” the parameter-name suffix for the number of bins in the histogram stats.
  • Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_SUFFIX_BIN_PREFIX โ€” the parameter-name suffix for 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 for the number of occurrences of latency within this bin.

Sys::Virt::Domain::STATS_CPU_TOTAL โ€” CPU usage info ๐Ÿ’– the following keys are the ones used for the returned parameters:

  • Sys::Virt::Domain::STATS_CPU_TIME โ€” total CPU time spent for this domain, in nanoseconds; type is unsigned long long.
  • Sys::Virt::Domain::STATS_CPU_USER โ€” user CPU time spent, in nanoseconds; type is unsigned long long.
  • Sys::Virt::Domain::STATS_CPU_SYSTEM โ€” system CPU time spent, in nanoseconds; type is unsigned long long.
  • Sys::Virt::Domain::STATS_CPU_HALTPOLL_SUCCESS_TIME โ€” halt-polling CPU usage for the VCPU polled until a virtual interrupt was delivered, in nanoseconds; type is unsigned long long.
  • Sys::Virt::Domain::STATS_CPU_HALTPOLL_FAIL_TIME โ€” halt-polling CPU usage for when the VCPU had to schedule out (either because the max poll time was reached or it needed to yield the CPU), in nanoseconds; type is unsigned long long.
  • Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_COUNT โ€” number of cache monitors for this domain; type is unsigned int.
  • Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_PREFIX โ€” parameter-name prefix for each cache monitor entry. Concatenate this prefix, the entry number formatted as an unsigned integer, and one of the cache-monitor suffix params to make a complete parameter name.
  • Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_NAME โ€” name of the cache monitor; type is string.
  • Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_VCPUS โ€” Vcpu list of the cache monitor; type is string.
  • Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_COUNT โ€” number of cache banks in the cache monitor; type is unsigned int.
  • Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_PREFIX โ€” parameter-name prefix for 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 params to make a complete parameter name โœจ
  • Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_SUFFIX_ID โ€” host-allocated cache id for the bank; type is unsigned int.
  • Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_SUFFIX_BYTES โ€” number of bytes of last level cache that the domain is using; type is unsigned long long.
  • Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_COUNT โ€” number of energy monitors for this domain; type is unsigned int.
  • Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_PREFIX โ€” prefix for an individual energy monitor group. Concatenate it with the monitor index and one of the "cpu.energy.monitor.<i>." suffix constants below to make a full parameter name.
  • Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_SUFFIX_NAME โ€” name of the monitor group; type is string.
  • Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_SUFFIX_VCPUS โ€” vCPU set covered by the monitor group; type is string.
  • Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_SUFFIX_PKG_COUNT โ€” number of PERF_PKG nodes the monitor group exposes; type is 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; type is unsigned int.

Sys::Virt::Domain::STATS_INTERFACE โ€” network interface info ๐ŸŒธ the following keys are the ones used for the returned parameters:

  • Sys::Virt::Domain::STATS_NET_COUNT โ€” number of network interfaces on this domain; type is unsigned int.
  • Sys::Virt::Domain::STATS_NET_PREFIX โ€” parameter-name prefix for each interface entry. Concatenate this prefix, the entry number formatted as an unsigned integer, and one of the network suffix params to make a complete parameter name.
  • Sys::Virt::Domain::STATS_NET_SUFFIX_NAME โ€” name of the interface; type is string.
  • Sys::Virt::Domain::STATS_NET_SUFFIX_RX_BYTES โ€” bytes received; type is unsigned long long.
  • Sys::Virt::Domain::STATS_NET_SUFFIX_RX_PKTS โ€” packets received; type is unsigned long long.
  • Sys::Virt::Domain::STATS_NET_SUFFIX_RX_ERRS โ€” receive errors; type is unsigned long long.
  • Sys::Virt::Domain::STATS_NET_SUFFIX_RX_DROP โ€” receive packets dropped; type is unsigned long long.
  • Sys::Virt::Domain::STATS_NET_SUFFIX_TX_BYTES โ€” bytes transmitted; type is unsigned long long.
  • Sys::Virt::Domain::STATS_NET_SUFFIX_TX_PKTS โ€” packets transmitted; type is unsigned long long.
  • Sys::Virt::Domain::STATS_NET_SUFFIX_TX_ERRS โ€” transmission errors; type is unsigned long long.
  • Sys::Virt::Domain::STATS_NET_SUFFIX_TX_DROP โ€” transmit packets dropped; type is 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 (the vibe of the VM rn) โ€” the state of the VM, handed back as an int from the virDomainState enum ๐Ÿ’…
  • Sys::Virt::Domain::STATS_STATE_REASON โ€” the reason it entered that state, returned as an int from the virDomain*Reason enum that matches the state in question ๐Ÿซถ

Sys::Virt::Domain::STATS_VCPU

Virtual CPU info, bestie ๐Ÿงš โ€” the vCPU tea. These are the keys used for the returned parameters:

  • Sys::Virt::Domain::STATS_VCPU_CURRENT โ€” current number of online virtual CPUs, as an unsigned int โœจ
  • Sys::Virt::Domain::STATS_VCPU_MAXIMUM โ€” maximum number of online virtual CPUs, as an unsigned int ๐Ÿ‘‘
  • Sys::Virt::Domain::STATS_VCPU_PREFIX โ€” the parameter name prefix used to reach each vCPU entry. Concatenate the prefix, the entry number formatted as an unsigned integer, and one of the vCPU suffix parameters, and boom โ€” you get a complete parameter name ๐ŸŽ€
Ngl, due to VCPU hotplug the array can 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 โ€” the state of virtual CPU <num>, as an int from the virVcpuState enum ๐Ÿ’œ
  • Sys::Virt::Domain::STATS_VCPU_SUFFIX_TIME โ€” virtual cpu time spent by the virtual CPU, as unsigned long long โฑ๏ธ
  • Sys::Virt::Domain::STATS_VCPU_SUFFIX_WAIT โ€” the time the vCPU wants to run but the host scheduler has something else running ahead of it, as unsigned long long โ€” literally stuck in traffic fr fr ๐Ÿ™ˆ
  • Sys::Virt::Domain::STATS_VCPU_SUFFIX_HALTED โ€” virtual CPU is halted, as a boolean. Heads up: this may indicate the processor is idle or even disabled, depending on the architecture ๐Ÿ’€
  • Sys::Virt::Domain::STATS_VCPU_SUFFIX_DELAY โ€” the time the vCPU thread was enqueued by the host scheduler but was waiting in the queue instead of running. Exposed to the VM as steal time. In nanoseconds, as unsigned long long ๐Ÿ•ฐ๏ธ

Sys::Virt::Domain::STATS_PERF

Performance event counter values โšก โ€” the whole perf counter mood board. Here are the keys 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. 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. 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. Produced by the mbml perf event ๐ŸŒˆ
  • Sys::Virt::Domain::STATS_PERF_CACHE_MISSES โ€” the count of cache misses, as unsigned long long. Produced by the cache_misses perf event ๐Ÿ˜ญ
  • Sys::Virt::Domain::STATS_PERF_CACHE_REFERENCES โ€” the count of cache hits, as unsigned long long. Produced by the cache_references perf event ๐Ÿ’–
  • Sys::Virt::Domain::STATS_PERF_INSTRUCTIONS โ€” the count of instructions, as unsigned long long. 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. Produced by the cpu_cycles perf event ๐Ÿ”ฅ
  • Sys::Virt::Domain::STATS_PERF_BRANCH_INSTRUCTIONS โ€” the count of branch instructions, as unsigned long long. Produced by the branch_instructions perf event ๐ŸŒฟ
  • Sys::Virt::Domain::STATS_PERF_BRANCH_MISSES โ€” the count of branch misses, as unsigned long long. Produced by the branch_misses perf event ๐Ÿ’€
  • Sys::Virt::Domain::STATS_PERF_BUS_CYCLES โ€” the count of bus cycles, as unsigned long long. 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. 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. 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. 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. Produced by the cpu_clock perf event โฐ
  • Sys::Virt::Domain::STATS_PERF_TASK_CLOCK โ€” the count of task clock time, as unsigned long long. Produced by the task_clock perf event โŒš
  • Sys::Virt::Domain::STATS_PERF_PAGE_FAULTS โ€” the count of page faults, as unsigned long long. Produced by the page_faults perf event ๐Ÿ“
  • Sys::Virt::Domain::STATS_PERF_CONTEXT_SWITCHES โ€” the count of context switches, as unsigned long long. 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. 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. 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. Produced by the page_faults_maj perf event ๐Ÿ’…
  • Sys::Virt::Domain::STATS_PERF_ALIGNMENT_FAULTS โ€” the count of alignment faults, as unsigned long long. Produced by the alignment_faults perf event ๐Ÿ“
  • Sys::Virt::Domain::STATS_PERF_EMULATION_FAULTS โ€” the count of emulation faults, as unsigned long long. Produced by the emulation_faults perf event ๐ŸŽญ

Sys::Virt::Domain::STATS_IOTHREAD

IOThread performance statistics values ๐Ÿงต โ€” yes, the IO threads get their own little stats era. These are the keys used for the returned parameters:

  • Sys::Virt::Domain::STATS_IOTHREAD_COUNT โ€” maximum number of IOThreads in the subsequent list, as an unsigned int. Each IOThread in the list uses its iothread_id value as the array index ๐Ÿ’ซ
Real talk: there may be fewer array entries than the iothread.count value if the polling values aren't supported ๐Ÿ™ˆ
  • Sys::Virt::Domain::STATS_IOTHREAD_PREFIX โ€” the parameter name prefix used to reach 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 it exceeds the range of unsigned int. A 0 (zero) means "let the underlying hypervisor 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 it exceeds the range of unsigned int. A 0 (zero) means "let the underlying hypervisor choose how to shrink the polling time" ๐Ÿ‚

Sys::Virt::Domain::STATS_MEMORY

Memory bandwidth statistics values ๐ŸŒŠ โ€” memory go brrr, quantified. Here are the keys 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 used to reach each bandwidth monitor entry. Concatenate the prefix, the entry number formatted as an unsigned integer, and one of the memory bandwidth 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 used to reach 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 ๐Ÿช† (yes it nests, it's giving nesting dolls)
  • 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 ๐Ÿงผ โ€” how fast your memory is getting messy. These are the keys used for the returned parameters:

  • Sys::Virt::Domain::STATS_DIRTYRATE_CALC_STATUS โ€” the status of the 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 the 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's produced only if the calc_status is measured, bestie โ€” no measurement, no number ๐Ÿ’…
  • Sys::Virt::Domain::STATS_DIRTYRATE_CALC_MODE โ€” the calculation mode used for the last measurement, handed back to you as a string, and it's one of these three values: 'page-sampling', 'dirty-bitmap' or 'dirty-ring'. Three icons, pick your fighter ๐Ÿ’…
    • Sys::Virt::Domain::STATS_DIRTYRATE_VCPU_PREFIX โ€” the parameter name prefix you use to reach each VCPU entry. Glue the prefix + the entry number (formatted as an unsigned integer) + one of the VCPU suffix parameters together and boom, you've got yourself a complete parameter name. It's giving build-a-bear but for keys ๐Ÿงธ
    • Sys::Virt::Domain::STATS_DIRTYRATE_VCPU_SUFFIX_MEGABYTES_PER_SECOND โ€” the calculated memory dirty rate for a virtual cpu, as an unsigned long long. Yes bestie, the whole long long. ๐Ÿ˜Œ

Sys::Virt::Domain::STATS_VM

Hypervisor-specific stats fields for the given VM. โœจ

The following keys are what gets 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 the 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. Chain them in that exact order, no cap ๐Ÿซถ

  • Sys::Virt::Domain::STATS_CUSTOM_SUFFIX_TYPE_MAX โ€” hypervisor specific custom data type for the 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 the 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 ๐ŸŒธ

These constants give you the names of signals you can send to guest processes. They mostly correspond to POSIX signal names โ€” literally the classic lineup, bestie. ๐ŸŽ€

  • 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 ๐Ÿ’œ

These constants come in clutch when you're accessing domain tuning parameters in APIs and events. Obsessed with a well-named constant tbh. ๐Ÿ”ฅ

  • 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 ๐Ÿฆ‹

These constants are the ones you want when you're setting the 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

๐Ÿ’€ 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> โ€” that's the icon behind this page, bestie. ๐Ÿ’…

Copyright (C) 2006 Red Hat Copyright (C) 2006-2007 Daniel P. Berrange

๐Ÿ“„ LICENSE ๐Ÿ“„

Okay so the legal vibe is: 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 ๐Ÿ”—

Go check these out, iykyk. โœจ


and that's a wrap, bestie! ๐ŸŽ€ This page's footer energy is perl v5.40.2 and 2026-06-08 under the Sys::V...:Domain(3pm) label โ€” iconic, no cap. ๐Ÿ’–

๐Ÿ“ฆ where this page comes from