  | 
 
 
 
 |  
 |  | 
 
  
    | Sys::Virt::Domain(3) | 
    User Contributed Perl Documentation | 
    Sys::Virt::Domain(3) | 
   
 
Sys::Virt::Domain - Represent & manage a libvirt guest
  domain 
The "Sys::Virt::Domain" module
    represents a guest domain managed by the virtual machine monitor. 
  - my $id =
    $dom->get_id()
 
  - Returns an integer with a locally unique identifier for the domain.
 
  - my $uuid =
    $dom->get_uuid()
 
  - Returns a 16 byte long string containing the raw globally unique
      identifier (UUID) for the domain.
 
  - my $uuid =
    $dom->get_uuid_string()
 
  - Returns a printable string representation of the raw UUID, in the format
      'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'.
 
  - my $name =
    $dom->get_name()
 
  - Returns a string with a locally unique name of the domain
 
  - my $hostname =
    $dom->get_hostname($flags=0)
 
  - Returns a string representing the hostname of the guest.
      $flags can be zero or more of
 
 
  - my $str =
    $dom->get_metadata($type, $uri, $flags =0)
 
  - Returns the metadata element of type $type
      associated with the domain. If $type is
      "Sys::Virt::Domain::METADATA_ELEMENT"
      then the $uri parameter specifies the XML
      namespace to retrieve, otherwise $uri should be
      "undef". The optional
      $flags parameter defaults to zero.
 
  - $dom->set_metadata($type, $val, $key, $uri, $flags=0)
 
  - Sets the metadata element of type $type to hold
      the value $val. If $type
      is "Sys::Virt::Domain::METADATA_ELEMENT"
      then the $key and $uri
      elements specify an XML namespace to use, otherwise they should both be
      "undef". The optional
      $flags parameter defaults to zero.
 
  - $dom->is_active()
 
  - Returns a true value if the domain is currently running
 
  - $dom->is_persistent()
 
  - Returns a true value if the domain has a persistent configuration file
      defined
 
  - $dom->is_updated()
 
  - Returns a true value if the domain is running and has a persistent
      configuration file defined that is out of date compared to the current
      live config.
 
  - my $xml =
    $dom->get_xml_description($flags=0)
 
  - Returns an XML document containing a complete description of the domain's
      configuration. The optional $flags parameter
      controls generation of the XML document, defaulting to 0 if omitted. It
      can be one or more of the XML DUMP constants listed later in this
      document.
 
  - my $type =
    $dom->get_os_type()
 
  - Returns a string containing the name of the OS type running within the
      domain.
 
  - $dom->create($flags)
 
  - Start a domain whose configuration was previously defined using the
      "define_domain" method in Sys::Virt. The
      $flags parameter accepts one of the DOMAIN
      CREATION constants documented later, and defaults to 0 if omitted.
 
  - $dom->create_with_files($fds, $flags)
 
  - Start a domain whose configuration was previously defined using the
      "define_domain" method in Sys::Virt. The
      $fds parameter is an array of UNIX file
      descriptors which will be passed to the init process of the container.
      This is only supported with container based virtualization.The
      $flags parameter accepts one of the DOMAIN
      CREATION constants documented later, and defaults to 0 if omitted.
 
  - $dom->undefine()
 
  - Remove the configuration associated with a domain previously defined with
      the "define_domain" method in Sys::Virt.
      If the domain is running, you probably want to use the
      "shutdown" or
      "destroy" methods instead.
 
  - $dom->suspend()
 
  - Temporarily stop execution of the domain, allowing later continuation by
      calling the "resume" method.
 
  - $dom->resume()
 
  - Resume execution of a domain previously halted with the
      "suspend" method.
 
  - $dom->pm_wakeup()
 
  - Wakeup the guest from power management suspend state
 
  - $dom->pm_suspend_for_duration($target, $duration, $flags=0)
 
  - Tells the guest OS to enter the power management suspend state identified
      by $target. The $target
      parameter should be one of the NODE SUSPEND CONSTANTS listed in
      "Sys::Virt". The
      $duration specifies when the guest should
      automatically wakeup. The $flags parameter is
      optional and defaults to zero.
 
  - $dom->save($filename, $dxml=undef, $params=undef, $flags=0)
 
  - Take a snapshot of the domain's state and save the information to the file
      named in the $filename parameter. The domain can
      later be restored from this file with the
      "restore_domain" method on the Sys::Virt
      object. The optional $dxml parameter can be used
      to alter portions of the domain XML that will be used when performing
      restore. The $params parameter is a hash reference
      whose keys is a subset of the SAVE / RESTORE PARAMETER CONSTANTS. The
      $flags parameter accepts one of the SAVE / RESTORE
      FLAG CONSTANTS described later and defaults to zero.
 
  - $dom->managed_save($flags=0)
 
  - Take a snapshot of the domain's state and save the information to a
      managed save location. The domain will be automatically restored with this
      state when it is next started. The $flags
      parameter is unused and defaults to zero.
 
  - $bool = $dom->has_managed_save_image($flags=0)
 
  - Return a non-zero value if the domain has a managed save image that will
      be used at next start. The $flags parameter is
      unused and defaults to zero.
 
  - $dom->managed_save_remove($flags=0)
 
  - Remove the current managed save image, causing the guest to perform a full
      boot next time it is started. The $flags parameter
      is unused and defaults to zero.
 
  - $dom->managed_save_define_xml($xml, $flags=0)
 
  - Update the XML of the managed save image to $xml.
      The $flags parameter is unused and defaults to
      zero.
 
  - $xml = $dom->managed_save_get_xml_description($flags=0)
 
  - Get the XML in the managed save image. The $flags
      parameter accepts the following constants
 
 
  - $dom->core_dump($filename[, $flags])
 
  - Trigger a core dump of the guest virtual machine, saving its memory image
      to $filename so it can be analysed by tools such
      as "crash". The optional
      $flags flags parameter is currently unused and if
      omitted will default to 0.
 
  - $dom->core_dump_format($filename, $format, [, $flags])
 
  - Trigger a core dump of the guest virtual machine, saving its memory image
      to $filename so it can be analysed by tools such
      as "crash". The
      $format parameter is one of the core dump format
      constants. The optional $flags flags parameter is
      currently unused and if omitted will default to 0.
 
 
  - $dom->destroy()
 
  - Immediately poweroff the machine. This is equivalent to removing the power
      plug. The guest OS is given no time to cleanup / save state. For a clean
      poweroff sequence, use the "shutdown"
      method instead.
 
  - my $info =
    $dom->get_info()
 
  - Returns a hash reference summarising the execution state of the domain.
      The elements of the hash are as follows:
 
 
  - maxMem
 
  - The maximum memory allowed for this domain, in kilobytes
 
  - memory
 
  - The current memory allocated to the domain in kilobytes
 
  - cpuTime
 
  - The amount of CPU time used by the domain
 
  - nrVirtCpu
 
  - The current number of virtual CPUs enabled in the domain
 
  - state
 
  - The execution state of the machine, which will be one of the constants
      &Sys::Virt::Domain::STATE_*.
 
 
 
  - my ($state, $reason) =
    $dom->get_state()
 
  - Returns an array whose values specify the current state of the guest, and
      the reason for it being in that state. The $state
      values are the same as for the
      "get_info" API, and the
      $reason values come from:
 
 
  - my $info =
    $dom->get_control_info($flags=0)
 
  - Returns a hash reference providing information about the control channel.
      The returned keys in the hash are
 
 
  - "state"
 
  - One of the CONTROL INFO constants listed later
 
  - "details"
 
  - Currently unused, always 0.
 
  - "stateTime"
 
  - The elapsed time since the control channel entered the current state.
 
 
 
  - my $time =
    $dom->get_time($flags=0);
 
  - Get the current time of the guest, in seconds and nanoseconds. The
      $flags parameter is currently unused and defaults
      to zero. The return value is an array ref with two elements, the first
      contains the time in seconds, the second contains the remaining
      nanoseconds.
 
  - $dom->set_time($secs, $nsecs, $flags=0);
 
  - Set the current time of the guest, in seconds and nanoseconds. The
      $flags parameter accepts one of
 
 
  - "Sys::Virt::Domain::TIME_SYNC"
 
  - Re-sync domain time from domain's RTC.
 
 
 
  - $dom->set_user_password($username, $password, $flags=0);
 
  - Update the password for account $username to be
      $password. $password is
      the clear-text password string unless the PASSWORD_ENCRYPTED flag is
    set.
 
 
  - "Sys::Virt::Domain::PASSWORD_ENCRYPTED"
 
  - The $password is encrypted with the password
      scheme required by the guest OS.
 
 
 
  - $dom->rename($newname, $flags=0)
 
  - Change the name of an inactive guest to be
      $newname. The $flags
      parameter is currently unused and defaults to zero.
 
  - my @errs =
    $dom->get_disk_errors($flags=0)
 
  - Returns a list of all disk errors that have occurred on the backing store
      for the guest's virtual disks. The returned array elements are hash
      references, containing two keys
 
 
  - "path"
 
  - The path of the disk with an error
 
  - "error"
 
  - The error type
 
 
 
  - $dom->send_key($keycodeset, $holdtime, \@keycodes, $flags=0)
 
  - Sends a sequence of keycodes to the guest domain. The
      $keycodeset should be one of the constants listed
      later in the KEYCODE SET section. $holdtiem is the
      duration, in milliseconds, to keep the key pressed before releasing it and
      sending the next keycode. @keycodes is an array
      reference containing the list of keycodes to send to the guest. The
      elements in the array should be keycode values from the specified keycode
      set. $flags is currently unused.
 
  - my $info =
    $dom->get_block_info($dev, $flags=0)
 
  - Returns a hash reference summarising the disk usage of the host backing
      store for a guest block device. The $dev parameter
      should be the path to the backing store on the host.
      $flags is currently unused and defaults to 0 if
      omitted. The returned hash contains the following elements
 
 
  - capacity
 
  - Logical size in bytes of the block device backing image *
 
  - allocation
 
  - Highest allocated extent in bytes of the block device backing image
 
  - physical
 
  - Physical size in bytes of the container of the backing image
 
 
 
  - $dom->set_max_memory($mem)
 
  - Set the maximum memory for the domain to the value
      $mem. The value of the
      $mem parameter is specified in kilobytes.
 
  - $mem = $dom->get_max_memory()
 
  - Returns the current maximum memory allowed for this domain in
    kilobytes.
 
  - $dom->set_memory($mem, $flags)
 
  - Set the current memory for the domain to the value
      $mem. The value of the
      $mem parameter is specified in kilobytes. This
      must be less than, or equal to the domain's max memory limit. The
      $flags parameter can control whether the update
      affects the live guest, or inactive config, defaulting to modifying the
      current state.
 
  - $dom->set_memory_stats_period($period, $flags)
 
  - Set the period on which guests memory stats are refreshed, with
      $period being a value in seconds. The
      $flags parameter is currently unused.
 
  - $dom->shutdown()
 
  - Request that the guest OS perform a graceful shutdown and poweroff. This
      usually requires some form of cooperation from the guest operating system,
      such as responding to an ACPI signal, or a guest agent process. For an
      immediate, forceful poweroff, use the
      "destroy" method instead.
 
  - $dom->reboot([$flags])
 
  - Request 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])
 
  - Perform a hardware reset of the virtual machine. The guest OS is given no
      opportunity to shutdown gracefully. The optional
      $flags parameter is currently unused and if
      omitted defaults to zero.
 
  - $dom->get_max_vcpus()
 
  - Return the maximum number of vcpus that are configured for the domain
 
  - $dom->attach_device($xml[, $flags])
 
  - Hotplug a new device whose configuration is given by
      $xml, to the running guest. The optional
      <$flags> parameter defaults to 0, but can accept one of the device
      hotplug flags described later.
 
  - $dom->detach_device($xml[, $flags])
 
  - Hotunplug an existing device whose configuration is given by
      $xml, from the running guest. The optional
      <$flags> parameter defaults to 0, but can accept one of the device
      hotplug flags described later.
 
  - $dom->detach_device_alias($alias[, $flags])
 
  - Hotunplug an existing device which is identified by
      $alias. The optional <$flags> parameter
      defaults to 0, but can accept one of the device hotplug flags described
      later.
 
  - $dom->update_device($xml[, $flags])
 
  - Update the configuration of an existing device. The new configuration is
      given by $xml. The optional <$flags>
      parameter defaults to 0 but can accept one of the device hotplug flags
      described later.
 
  - $data = $dom->block_peek($path, $offset, $size[, $flags])
 
  - Peek into the guest disk $path, at byte
      $offset capturing $size
      bytes of data. The returned scalar may contain embedded NULLs. The
      optional $flags parameter is currently unused and
      if omitted defaults to zero.
 
  - $data = $dom->memory_peek($offset, $size[, $flags])
 
  - Peek into the guest memory at byte $offset virtual
      address, capturing $size bytes of memory. The
      return scalar may contain embedded NULLs. The optional
      $flags parameter is currently unused and if
      omitted defaults to zero.
 
  - $flag = $dom->get_autostart();
 
  - Return a true value if the guest domain is configured to automatically
      start upon boot. Return false, otherwise
 
  - $dom->set_autostart($flag)
 
  - Set the state of the autostart flag, which determines whether the guest
      will automatically start upon boot of the host OS
 
  - $dom->set_vcpus($count, [$flags])
 
  - Set the number of virtual CPUs in the guest VM to
      $count. The optional
      $flags parameter can be used to control whether
      the setting changes the live config or inactive config.
 
  - $dom->set_vcpu($cpumap, $state, [$flags])
 
  - Set the state of the CPUs in $cpumap to
      $state. The $flags
      parameter defaults to zero if not present.
 
  - $count = $dom->get_vcpus([$flags])
 
  - Get the number of virtual CPUs in the guest VM. The optional
      $flags parameter can be used to control whether to
      query the setting of the live config or inactive config.
 
  - $dom->set_guest_vcpus($cpumap, $state, [$flags=0])
 
  - Set the online status of the guest OS CPUs. The
      $cpumap parameter describes the set of CPUs to
      modify (e.g. "0-3,^1"). $state is either
      1 to set the CPUs online, or 0 to set them offline. The
      $flags parameter is currently unused and defaults
      to 0.
 
  - $info $dom->get_guest_vcpus([$flags=0])
 
  - Query information about the guest OS CPUs. The returned data is a hash
      reference with the following keys.
 
 
  - vcpus
 
  - String containing bitmap representing CPU ids reported currently known to
      the guest.
 
  - online
 
  - String containing bitmap representing CPU ids that are currently online in
      the guest.
 
  - offlinable
 
  - String containing bitmap representing CPU ids that can be offlined in the
      guest.
 
 
 
The $flags parameter is currently unused
    and defaults to 0. 
 
  - $type = $dom->get_scheduler_type()
 
  - Return the scheduler type for the guest domain
 
  - $stats = $dom->block_stats($path)
 
  - Fetch the current I/O statistics for the block device given by
      $path. The returned hash reference contains keys
      for
 
 
  - "rd_req"
 
  - Number of read requests
 
  - "rd_bytes"
 
  - Number of bytes read
 
  - "wr_req"
 
  - Number of write requests
 
  - "wr_bytes"
 
  - Number of bytes written
 
  - "errs"
 
  - Some kind of error count
 
 
 
  - my $params =
    $dom->get_scheduler_parameters($flags=0)
 
  - Return the set of scheduler tunable parameters for the guest, as a hash
      reference. The precise set of keys in the hash are specific to the
      hypervisor.
 
  - $dom->set_scheduler_parameters($params, $flags=0)
 
  - Update the set of scheduler tunable parameters. The value names for
      tunables vary, and can be discovered using the
      "get_scheduler_params" call
 
  - my $params =
    $dom->get_memory_parameters($flags=0)
 
  - Return a hash reference containing the set of memory tunable parameters
      for the guest. The keys in the hash are one of the constants MEMORY
      PARAMETERS described later. The $flags parameter
      accepts one or more the CONFIG OPTION constants documented later, and
      defaults to 0 if omitted.
 
  - $dom->set_memory_parameters($params, $flags=0)
 
  - Update the memory tunable parameters for the guest. The
      $params should be a hash reference whose keys are
      one of the MEMORY PARAMETERS constants. The $flags
      parameter accepts one or more the CONFIG OPTION constants documented
      later, and defaults to 0 if omitted.
 
  - my $params =
    $dom->get_blkio_parameters($flags=0)
 
  - Return a hash reference containing the set of blkio tunable parameters for
      the guest. The keys in the hash are one of the constants BLKIO PARAMETERS
      described later. The $flags parameter accepts one
      or more the CONFIG OPTION constants documented later, and defaults to 0 if
      omitted.
 
  - $dom->set_blkio_parameters($params, $flags=0)
 
  - Update the blkio tunable parameters for the guest. The
      $params should be a hash reference whose keys are
      one of the BLKIO PARAMETERS constants. The $flags
      parameter accepts one or more the CONFIG OPTION constants documented
      later, and defaults to 0 if omitted.
 
  - $stats = $dom->get_block_iotune($disk, $flags=0)
 
  - Return a hash reference containing the set of blkio tunable parameters for
      the guest disk $disk. The keys in the hash are one
      of the constants BLOCK IOTUNE PARAMETERS described later.
 
  - $dom->set_block_iotune($disk, $params, $flags=0);
 
  - Update the blkio tunable parameters for the guest disk
      $disk. The $params should
      be a hash reference whose keys are one of the BLOCK IOTUNE PARAMETERS
      constants.
 
  - my $params =
    $dom->get_interface_parameters($intf, $flags=0)
 
  - Return a hash reference containing the set of interface tunable parameters
      for the guest. The keys in the hash are one of the constants INTERFACE
      PARAMETERS described later.
 
  - $dom->set_interface_parameters($intf, $params, $flags=0)
 
  - Update the interface tunable parameters for the guest. The
      $params should be a hash reference whose keys are
      one of the INTERFACE PARAMETERS constants.
 
  - my $params =
    $dom->get_numa_parameters($flags=0)
 
  - Return a hash reference containing the set of numa tunable parameters for
      the guest. The keys in the hash are one of the constants NUMA PARAMETERS
      described later. The $flags parameter accepts one
      or more the CONFIG OPTION constants documented later, and defaults to 0 if
      omitted.
 
  - $dom->set_numa_parameters($params, $flags=0)
 
  - Update the numa tunable parameters for the guest. The
      $params should be a hash reference whose keys are
      one of the NUMA PARAMETERS constants. The $flags
      parameter accepts one or more the CONFIG OPTION constants documented
      later, and defaults to 0 if omitted.
 
  - my $params =
    $dom->get_perf_events($flags=0)
 
  - Return a hash reference containing the set of performance events that are
      available for the guest. The keys in the hash are one of the constants
      PERF EVENTS described later. The $flags parameter
      accepts one or more the CONFIG OPTION constants documented later, and
      defaults to 0 if omitted.
 
  - $dom->set_perf_events($params, $flags=0)
 
  - Update the enabled state for performance events for the guest. The
      $params should be a hash reference whose keys are
      one of the PERF EVENTS constants. The $flags
      parameter accepts one or more the CONFIG OPTION constants documented
      later, and defaults to 0 if omitted.
 
  - $dom->block_resize($disk, $newsize, $flags=0)
 
  - Resize the disk $disk to have new size
      $newsize KB. If the disk is backed by a special
      image format, the actual resize is done by the hypervisor. If the disk is
      backed by a raw file, or block device, the resize must be done prior to
      invoking this API call, and it merely updates the hypervisor's view of the
      disk size. The following flags may be used
 
 
  - $dom->interface_stats($path)
 
  - Fetch the current I/O statistics for the block device given by
      $path. The returned hash contains keys for
 
 
  - "rx_bytes"
 
  - Total bytes received
 
  - "rx_packets"
 
  - Total packets received
 
  - "rx_errs"
 
  - Total packets received with errors
 
  - "rx_drop"
 
  - Total packets drop at reception
 
  - "tx_bytes"
 
  - Total bytes transmitted
 
  - "tx_packets"
 
  - Total packets transmitted
 
  - "tx_errs"
 
  - Total packets transmitted with errors
 
  - "tx_drop"
 
  - Total packets dropped at transmission.
 
 
 
  - $dom->memory_stats($flags=0)
 
  - Fetch the current memory statistics for the guest domain. The
      $flags parameter is currently unused and can be
      omitted. The returned hash contains keys for
 
 
  - "swap_in"
 
  - Data read from swap space
 
  - "swap_out"
 
  - Data written to swap space
 
  - "major_fault"
 
  - Page fault involving disk I/O
 
  - "minor_fault"
 
  - Page fault not involving disk I/O
 
  - "unused"
 
  - Memory not used by the system
 
  - "available"
 
  - Total memory seen by guest
 
  - "rss"
 
  - Resident set size. Size of memory resident in host RAM.
 
 
 
  - $info = $dom->get_security_label()
 
  - Fetch information about the security label assigned to the guest domain.
      The returned hash reference has two keys,
      "model" gives the name of the security
      model in effect (e.g. "selinux"), while
      "label" provides the name of the
      security label applied to the domain. This method only returns information
      about the first security label. To retrieve all labels, use
      "get_security_label_list".
 
  - @info = $dom->get_security_label_list()
 
  - Fetches information about all security labels assigned to the guest
      domain. The elements in the returned array are all hash references, whose
      keys are as described for
      "get_security_label".
 
  - $ddom = $dom->migrate(destcon, \%params, flags=0)
 
  - Migrate a domain to an alternative host. The
      "destcon" parameter should be a
      "Sys::Virt" connection to the remote
      target host. The "flags" parameter takes
      one or more of the
      "Sys::Virt::Domain::MIGRATE_XXX"
      constants described later in this document. The
      %params parameter is a hash reference used to set
      various parameters for the migration operation, with the following valid
      keys.
 
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_URI"
 
  - The URI to use for initializing the domain migration. It takes a
      hypervisor specific format. The uri_transports element of the hypervisor
      capabilities XML includes details of the supported URI schemes. When
      omitted libvirt will auto-generate suitable default URI. It is typically
      only necessary to specify this URI if the destination host has multiple
      interfaces and a specific interface is required to transmit migration
      data.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME"
 
  - The name to be used for the domain on the destination host. Omitting this
      parameter keeps the domain name the same. This field is only allowed to be
      used with hypervisors that support domain renaming during migration.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_DEST_XML"
 
  - The new configuration to be used for the domain on the destination host.
      The configuration must include an identical set of virtual devices, to
      ensure a stable guest ABI across migration. Only parameters related to
      host side configuration can be changed in the XML. Hypervisors which
      support this field will forbid migration if the provided XML would cause a
      change in the guest ABI. This field cannot be used to rename the domain
      during migration (use VIR_MIGRATE_PARAM_DEST_NAME field for that purpose).
      Domain name in the destination XML must match the original domain name.
    
Omitting this parameter keeps the original domain
        configuration. Using this field with hypervisors that do not support
        changing domain configuration during migration will result in a
      failure. 
   
  - "Sys::Virt::Domain::MIGRATE_PARAM_GRAPHICS_URI"
 
  - URI to use for migrating client's connection to domain's graphical console
      as VIR_TYPED_PARAM_STRING. If specified, the client will be asked to
      automatically reconnect using these parameters instead of the
      automatically computed ones. This can be useful if, e.g., the client does
      not have a direct access to the network virtualization hosts are connected
      to and needs to connect through a proxy. The URI is formed as follows:
    
    
      protocol://hostname[:port]/[?parameters]
    
    where protocol is either "spice" or "vnc"
        and parameters is a list of protocol specific parameters separated by
        '&'. Currently recognized parameters are "tlsPort" and
        "tlsSubject". For example, 
    
          spice://target.host.com:1234/?tlsPort=4567
    
   
  - "Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH"
 
  - The maximum bandwidth (in MiB/s) that will be used for migration. If set
      to 0 or omitted, libvirt will choose a suitable default. Some hypervisors
      do not support this feature and will return an error if this field is used
      and is not 0.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH_POSTCOPY"
 
  - The maximum bandwidth (in MiB/s) that will be used for migration during
      post-copy phase. If set to 0 or omitted, libvirt will choose a suitable
      default. Some hypervisors do not support this feature and return an error
      if this field is used and is not 0.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_LISTEN_ADDRESS"
 
  - The address on which to listen for incoming migration connections. If
      omitted, libvirt will listen on the wildcard address (0.0.0.0 or ::). This
      default may be a security risk if guests, or other untrusted users have
      the ability to connect to the virtualization host, thus use of an explicit
      restricted listen address is recommended.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_DISK_PORT"
 
  - Port that destination server should use for incoming disks migration. Type
      is VIR_TYPED_PARAM_INT. If set to 0 or omitted, libvirt will choose a
      suitable default. At the moment this is only supported by the QEMU
    driver.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_MIGRATE_DISKS"
 
  - The list of disks to migrate when doing block storage migration. In
      contrast to other parameters whose values are plain strings, the parameter
      value should be an array reference, whose elements are in turn strings
      representing the disk target names.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION"
 
  - The type of compression method use use, either
      "xbzrle" or
      "mt".
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_THREADS"
 
  - The number of compression threads to use
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_DTHREADS"
 
  - The number of decompression threads
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_LEVEL"
 
  - The compression level from 0 (no compression) to 9 (maximum
    compression)
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE"
 
  - The size of the cache for xbzrle compression
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_PERSIST_XML"
 
  - The alternative persistent XML config to copy
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_AUTO_CONVERGE_INITIAL"
 
  - The initial percentage to throttle guest vCPUs
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT"
 
  - The additional percentage step size to throttle guest vCPUs if progress is
      not made
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_PARALLEL_CONNECTIONS"
 
  - The number of connections used during parallel migration.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_TLS_DESTINATION"
 
  - Override the destination host name used for TLS verification. Normally the
      TLS certificate from the destination host must match the host's name for
      TLS verification to succeed. When the certificate does not match the
      destination hostname and the expected certificate's hostname is known,
      this parameter can be used to pass this expected hostname when starting
      the migration.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_DISKS_URI"
 
  - The URI to use for initializing the domain migration for storage. It takes
      a hypervisor specific format. The uri_transports element of the hypervisor
      capabilities XML includes details of the supported URI schemes. When
      omitted libvirt will auto-generate suitable default URI. It is typically
      only necessary to specify this URI if the destination host has multiple
      interfaces and a specific interface is required to transmit storage
    data.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_ZLIB_LEVEL"
 
  - The level of compression for zlib. Accepted values are in range 0-9. 0 is
      no compression, 1 is maximum speed and 9 is maximum compression.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_ZSTD_LEVEL"
 
  - The level of compression for zstd. Accepted values are in range 0-20. 0 is
      no compression, 1 is maximum speed and 20 is maximum compression.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_DISKS_DETECT_ZEROES"
 
  - Enable zero detection on list of disks to avoid transferring zero blocks.
      Users must ensure that any pre-created storage source on the destination
      will be cleared and thus read all-zeroes before using this feature,
      otherwise the destination image may become corrupted. In contrast to other
      parameters whose values are plain strings, the parameter value should be
      an array reference, whose elements are in turn strings representing the
      disk target names.
 
  - "Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH_AVAIL_SWITCHOVER"
 
  - The maximum bandwidth (in MiB/s) that will be used for migration during
      the switchover phase. If set to 0 or omitted, QEMU will estimate a
      suitable default.
 
 
 
  - $ddom = $dom->migrate(destcon, flags=0, dname=undef, uri=undef,
    bandwidth=0)
 
  - Migrate a domain to an alternative host. Use of positional parameters with
      "migrate" is deprecated in favour of
      passing a hash reference as described above.
 
  - $ddom = $dom->migrate2(destcon, dxml, flags, dname, uri,
    bandwidth)
 
  - Migrate a domain to an alternative host. This method is deprecated in
      favour of passing a hash ref to
      "migrate".
 
  - $ddom = $dom->migrate_to_uri(desturi, \%params, flags=0)
 
  - Migrate a domain to an alternative host. The
      "desturi" parameter should be a valid
      libvirt connection URI for the remote target host. The
      "flags" parameter takes one or more of
      the "Sys::Virt::Domain::MIGRATE_XXX"
      constants described later in this document. The
      %params parameter is a hash reference used to set
      various parameters for the migration operation, with the same keys
      described for the "migrate" API.
 
  - $dom->migrate_to_uri(desturi, flags, dname, bandwidth)
 
  - Migrate a domain to an alternative host. Use of positional parameters with
      "migrate_to_uri" is deprecated in favour
      of passing a hash reference as described above.
 
  - $dom->migrate_to_uri2(dconnuri, miguri, dxml, flags, dname,
    bandwidth)
 
  - Migrate a domain to an alternative host. This method is deprecated in
      favour of passing a hash ref to
      "migrate_to_uri".
 
  - $dom->migrate_set_max_downtime($downtime, $flags=0)
 
  - Set the maximum allowed downtime during migration of the guest. A longer
      downtime makes it more likely that migration will complete, at the cost of
      longer time blackout for the guest OS at the switch over point. The
      "downtime" parameter is measured in
      milliseconds. The $flags parameter is currently
      unused and defaults to zero.
 
  - $downtime = $dom->migrate_get_max_downtime($flags=0)
 
  - Get the current value of the maximum downtime allowed during a migration
      of a guest. The returned <downtime> value is measured in
      milliseconds. The $flags parameter is currently
      unused and defaults to zero.
 
  - $dom->migrate_set_max_speed($bandwidth, $flags=0)
 
  - Set the maximum allowed bandwidth during migration of the guest. The
      "bandwidth" parameter is measured in
      MB/second. The $flags parameter takes zero or more
      of the constants:
 
 
  - $Sys::Virt::Domain::MIGRATE_MAX_SPEED_POSTCOPY
 
  - Set the post-copy speed instead of the pre-copy speed.
 
 
 
  - $bandwidth = $dom->migrate_get_max_speed($flags=0)
 
  - Get the maximum allowed bandwidth during migration of the guest. The
      returned <bandwidth> value is measured in MB/second. The
      $flags parameter is accepts the same constants as
      "migrate_set_max_speed".
 
  - $dom->migrate_set_compression_cache($cacheSize, $flags=0)
 
  - Set the maximum allowed compression cache size during migration of the
      guest. The "cacheSize" parameter is
      measured in bytes. The $flags parameter is
      currently unused and defaults to zero.
 
  - $cacheSize = $dom->migrate_get_compression_cache($flags=0)
 
  - Get the maximum allowed compression cache size during migration of the
      guest. The returned <bandwidth> value is measured in bytes. The
      $flags parameter is currently unused and defaults
      to zero.
 
  - $dom->migrate_start_post_copy($flags=0)
 
  - Switch the domain from pre-copy to post-copy mode. This requires that the
      original migrate command had the
      "Sys::Virt::Domain::MIGRATE_POST_COPY"
      flag specified.
 
  - $dom->inject_nmi($flags)
 
  - Trigger an NMI in the guest virtual machine. The
      $flags parameter is currently unused and defaults
      to 0.
 
  - $dom->open_console($st, $devname, $flags)
 
  - Open the text console for a serial, parallel or paravirt console device
      identified by $devname, connecting it to the
      stream $st. If $devname is
      undefined, the default console will be opened. $st
      must be a "Sys::Virt::Stream" object
      used for bi-directional communication with the console.
      $flags is currently unused, defaulting to 0.
 
  - $dom->open_channel($st, $devname, $flags)
 
  - Open the text console for a data channel device identified by
      $devname, connecting it to the stream
      $st. $st must be a
      "Sys::Virt::Stream" object used for
      bi-directional communication with the channel.
      $flags is currently unused, defaulting to 0.
 
  - $dom->open_graphics($idx, $fd, $flags)
 
  - Open the graphics console for a guest, identified by
      $idx, counting from 0. The
      $fd should be a file descriptor for an anonymous
      socket pair. The $flags argument should be one of
      the constants listed at the end of this document, and defaults to 0.
 
  - $fd = $dom->open_graphics_fd($idx, $flags)
 
  - Open the graphics console for a guest, identified by
      $idx, counting from 0. The
      $flags argument should be one of the constants
      listed at the end of this document, and defaults to 0. The return value
      will be a file descriptor connected to the console which must be closed
      when no longer needed. This method is preferred over
      "open_graphics" since it will work
      correctly under sVirt mandatory access control policies.
 
  - my $mimetype =
    $dom->screenshot($st, $screen, $flags)
 
  - Capture a screenshot of the virtual machine's monitor. The
      $screen parameter controls which monitor is
      captured when using a multi-head or multi-card configuration.
      $st must be a
      "Sys::Virt::Stream" object from which
      the data can be read. $flags is currently unused
      and defaults to 0. The mimetype of the screenshot is returned
 
  - @vcpuinfo = $dom->get_vcpu_info($flags=0)
 
  - Obtain information about the state of all virtual CPUs in a running guest
      domain. The returned list will have one element for each vCPU, where each
      elements contains a hash reference. The keys in the hash are,
      "number" the vCPU number,
      "cpu" the physical CPU on which the vCPU
      is currently scheduled, "cpuTime" the
      cumulative execution time of the vCPU,
      "state" the running state and
      "affinity" giving the allowed scheduler
      placement. The value for "affinity" is a
      string representing a bitmask against physical CPUs, 8 cpus per character.
      To extract the bits use the "unpack"
      function with the "b*" template. NB The
      "state",
      "cpuTime",
      "cpu" values are only available if using
      $flags value of 0, and the domain is currently
      running; otherwise they will all be set to zero.
 
  - $dom->pin_vcpu($vcpu, $mask)
 
  - Pin the virtual CPU given by index $vcpu to
      physical CPUs given by $mask. The
      $mask is a string representing a bitmask against
      physical CPUs, 8 cpus per character.
 
  - $mask = $dom->get_emulator_pin_info()
 
  - Obtain information about the CPU affinity of the emulator process. The
      returned $mask is a bitstring against physical
      CPUs, 8 cpus per character. To extract the bits use the
      "unpack" function with the
      "b*" template.
 
  - $dom->pin_emulator($newmask, $flags=0)
 
  - Pin the emulator threads to the physical CPUs identified by the affinity
      in $newmask. The $newmask
      is a bitstring against the physical CPUa, 8 cpus per character. To create
      a suitable bitstring, use the "vec"
      function with a value of 1 for the
      "BITS" parameter.
 
  - @iothreadinfo = $dom->get_iothread_info($flags=0)
 
  - Obtain information about the state of all IOThreads in a running guest
      domain. The returned list will have one element for each IOThread, where
      each elements contains a hash reference. The keys in the hash are,
      "number" the IOThread number and
      "affinity" giving the allowed scheduler
      placement. The value for "affinity" is a
      string representing a bitmask against physical CPUs, 8 cpus per character.
      To extract the bits use the "unpack"
      function with the "b*" template.
 
  - $dom->pin_iothread($iothread, $mask)
 
  - Pin the IOThread given by index $iothread to
      physical CPUs given by $mask. The
      $mask is a string representing a bitmask against
      physical CPUs, 8 cpus per character.
 
  - $dom->add_iothread($iothread, $flags=0)
 
  - Add a new IOThread by the $iothread value to the
      guest domain. The $flags parameter accepts one or
      more the CONFIG OPTION constants documented later, and defaults to 0 if
      omitted.
 
  - $dom->del_iothread($iothread, $flags=0)
 
  - Delete an existing IOThread by the $iothread value
      from the guest domain. The $flags parameter
      accepts one or more the CONFIG OPTION constants documented later, and
      defaults to 0 if omitted.
 
  - $dom->set_iothread($iothread, $params, $flags=0)
 
  - Set parameters for the IOThread by the $iothread
      value on the guest domain. The $params parameter
      is a hash reference whose keys are the "IOTHREAD
      STATS" constants documented later. The
      $flags parameter accepts one or more the CONFIG
      OPTION constants documented later, and defaults to 0 if omitted.
 
  - my @stats =
    $dom->get_cpu_stats($startCpu, $numCpus, $flags=0)
 
  - Requests the guests host physical CPU usage statistics, starting from host
      CPU <$startCpu> counting up to $numCpus. If
      $startCpu is -1 and
      $numCpus is 1, then the utilization across all
      CPUs is returned. Returns an array of hash references, each element
      containing stats for one CPU.
 
  - my $info =
    $dom->get_job_info()
 
  - Returns a hash reference summarising the execution state of the background
      job. The elements of the hash are as follows:
 
 
  - type
 
  - The type of job, one of the JOB TYPE constants listed later in this
      document.
 
  - timeElapsed
 
  - The elapsed time in milliseconds
 
  - timeRemaining
 
  - The expected remaining time in milliseconds. Only set if the
      "type" is JOB_UNBOUNDED.
 
  - dataTotal
 
  - The total amount of data expected to be processed by the job, in
    bytes.
 
  - dataProcessed
 
  - The current amount of data processed by the job, in bytes.
 
  - dataRemaining
 
  - The expected amount of data remaining to be processed by the job, in
      bytes.
 
  - memTotal
 
  - The total amount of memory expected to be processed by the job, in
    bytes.
 
  - memProcessed
 
  - The current amount of memory processed by the job, in bytes.
 
  - memRemaining
 
  - The expected amount of memory remaining to be processed by the job, in
      bytes.
 
  - fileTotal
 
  - The total amount of file expected to be processed by the job, in
    bytes.
 
  - fileProcessed
 
  - The current amount of file processed by the job, in bytes.
 
  - fileRemaining
 
  - The expected amount of file remaining to be processed by the job, in
      bytes.
 
 
 
  - my ($type, $stats) =
    $dom->get_job_stats($flags=0)
 
  - Returns an array summarising the execution state of the background job.
      The $type value is one of the JOB TYPE constants
      listed later in this document. The $stats value is
      a hash reference, whose elements are one of the following constants.
 
 
  - type
 
  - The type of job, one of the JOB TYPE constants listed later in this
      document.
    
The $flags parameter defaults to zero
        and can take one of the following constants. 
   
 
  - Sys::Virt::Domain::JOB_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
 
 
 
  - $dom->abort_job($flags=0)
 
  - Aborts the currently executing job. Valid $flags
      include:
 
 
  - my $info =
    $dom->get_block_job_info($path, $flags=0)
 
  - Returns a hash reference summarising the execution state of the block job.
      The $path parameter should be the fully qualified
      path of the block device being changed. Valid
      $flags include:
 
 
  - $dom->set_block_job_speed($path, $bandwidth, $flags=0)
 
  - Change the maximum I/O bandwidth used by the block job that is currently
      executing for $path. The
      $bandwidth argument is specified in MB/s. The
      $flags parameter can take the bitwise union of the
      values:
 
 
  - $dom->abort_block_job($path, $flags=0)
 
  - Abort the current job that is executing for the block device associated
      with $path
 
  - $dom->block_pull($path, $bandwidth, $flags=0)
 
  - Merge the backing files associated with $path into
      the top level file. The $bandwidth parameter
      specifies the maximum I/O rate to allow in MB/s. The
      $flags parameter can take the bitwise union of the
      values:
 
 
  - $dom->block_rebase($path, $base, $bandwidth, $flags=0)
 
  - Switch the backing path associated with $path to
      instead use $base. The
      $bandwidth parameter specifies the maximum I/O
      rate to allow in MB/s. The $flags parameter can
      take the bitwise union of the values:
 
 
  - $dom->block_copy($path, $destxml, $params, $flags=0)
 
  - Copy contents of a disk image <$path> into the target volume
      described by $destxml which follows the schema of
      the <disk> element in the domain XML. The
      $params parameter is a hash of optional parameters
      to control the process
 
 
  - $dom->block_commit($path, $base, $top, $bandwidth, $flags=0)
 
  - Commit changes there were made to the temporary top level file
      $top. Takes all the differences between
      $top and $base and merge
      them into $base. The
      $bandwidth parameter specifies the maximum I/O
      rate to allow in MB/s. The $flags parameter can
      take the bitwise union of the values:
 
 
  - $count = $dom->num_of_snapshots()
 
  - Return the number of saved snapshots of the domain
 
  - @names = $dom->list_snapshot_names()
 
  - List the names of all saved snapshots. The names can be used with the
      "lookup_snapshot_by_name"
 
  - @snapshots = $dom->list_snapshots()
 
  - Return a list of all snapshots currently known to the domain. The elements
      in the returned list are instances of the Sys::Virt::DomainSnapshot class.
      This method requires O(n) RPC calls, so the
      "list_all_snapshots" method is
      recommended as a more efficient alternative.
 
  - my @snapshots =
    $dom->list_all_snapshots($flags)
 
  - Return a list of all domain snapshots associated with this domain. The
      elements in the returned list are instances of the
      Sys::Virt::DomainSnapshot class. The $flags
      parameter can be used to filter the list of return domain snapshots.
 
  - my $snapshot =
    $dom->get_snapshot_by_name($name)
 
  - Return the domain snapshot with a name of $name.
      The returned object is an instance of the Sys::Virt::DomainSnapshot
    class.
 
  - $dom->has_current_snapshot()
 
  - Returns a true value if the domain has a currently active snapshot
 
  - $snapshot = $dom->current_snapshot()
 
  - Returns the currently active snapshot for the domain.
 
  - $snapshot = $dom->create_snapshot($xml[, $flags])
 
  - Create a new snapshot from the $xml. The
      $flags parameter accepts the SNAPSHOT
      CREATION constants listed in
      "Sys::Virt::DomainSnapshots".
 
  - my @checkpoints =
    $dom->list_all_checkpoints($flags)
 
  - Return a list of all domain checkpoints associated with this domain. The
      elements in the returned list are instances of the
      Sys::Virt::DomainCheckpoint class. The $flags
      parameter can be used to filter the list of return domain
    checkpoints.
 
  - my $checkpoint =
    $dom->get_checkpoint_by_name($name)
 
  - Return the domain checkpoint with a name of $name.
      The returned object is an instance of the Sys::Virt::DomainCheckpoint
      class.
 
  - $checkpoint = $dom->create_checkpoint($xml[, $flags])
 
  - Create a new checkpoint from the $xml. The
      $flags parameter accepts the CHECKPOINT
      CREATION constants listed in
      "Sys::Virt::DomainCheckpoints".
 
  - $dom->backup_begin($backupxml, $checkpointxml=undef, $flags=0);
 
  - Start a point-in-time backup job for the specified disks of a running
      domain. The $backupxml parameter describes the
      backup operation, including which disks to use. The optional
      $checkpointxml parameter can be used to create a
      checkpoint covering to the same point in time as the backup. The optional
      $flags parameter can be one of the following
      constants:
 
 
  - $xml = $dom->backup_get_xml_description($flags=0);
 
  - Get the XML description of the currently executing backup job. If there is
      no backup job then an error is raised.
 
  - $dom->fs_trim($mountPoint, $minimum, $flags=0);
 
  - Issue an FS_TRIM command to the device at
      $mountPoint to remove chunks of unused space that
      are at least $minimum bytes in length.
      $flags is currently unused and defaults to
    zero.
 
  - $dom->fs_freeze(\@mountPoints, $flags=0);
 
  - Freeze all the filesystems associated with the
      @mountPoints array reference. If
      <@mountPoints> is an empty list, then all filesystems will be
      frozen. $flags is currently unused and defaults to
      zero.
 
  - $dom->fs_thaw(\@mountPoints, $flags=0);
 
  - Thaw all the filesystems associated with the
      @mountPoints array reference. If
      <@mountPoints> is an empty list, then all filesystems will be
      thawed. $flags is currently unused and defaults to
      zero.
 
  - @fslist = $dom->get_fs_info($flags=0);
 
  - Obtain a list of all guest filesystems. The returned list will contain one
      element for each filesystem, whose value will be a hash reference with the
      following keys
 
 
  - name
 
  - The name of the guest device that is mounted
 
  - fstype
 
  - The filesystem type (e.g. 'ext4', 'fat', 'ntfs', etc)
 
  - mountpoint
 
  - The location in the filesystem tree of the mount
 
  - devalias
 
  - An array reference containing list of device aliases associated with the
      guest device. The device aliases correspond to disk target names in the
      guest XML configuration
 
 
 
  - @nics = $dom->get_interface_addresses($src, $flags=0);
 
  - Obtain a list of all guest network interfaces. The
      $src parameter is one of the constants
 
 
The returned list will contain one element for each interface. The
    values in the list will be a hash reference with the following keys 
  - name
 
  - The name of the guest interface that is mounted
 
  - hwaddr
 
  - The hardware address, aka MAC, if available.
 
  - addrs
 
  - An array reference containing list of IP addresses associated with the
      guest NIC. Each element in the array is a further hash containing
 
 
  - addr
 
  - The IP address string
 
  - prefix
 
  - The IP address network prefix
 
  - type
 
  - The IP address type (IPv4 vs IPv6)
 
 
 
 
  - $dom->send_process_signal($pid, $signum, $flags=0);
 
  - Send the process $pid the signal
      $signum. The $signum value
      must be one of the constants listed later, not a POSIX or Linux signal
      value. $flags is currently unused and defaults to
      zero.
 
  - $dom->set_block_threshold($dev, $threshold, $flags=0);
 
  - Set the threshold level for delivering the EVENT_ID_BLOCK_THRESHOLD if the
      device or backing chain element described by $dev
      is written beyond the set $threshold level. The
      threshold level is unset once the event fires. The event might not be
      delivered at all if libvirtd was not running at the moment when the
      threshold was reached.
 
  - $dom->set_lifecycle_action($type, $action, $flags=0)
 
  - Changes the actions of lifecycle events for domain represented as
      <on_$type>$action</on_$type> in the domain XML.
 
  - $info = $dom->get_launch_security_info($flags=0)
 
  - Get information about the domain launch security policy.
      $flags is currently unused and defaults to zero.
      The returned hash may contain the following keys
 
 
  - $dom->set_launch_security_state(\%params, $flags=0)
 
  - Set information about the domain launch security state.
      $flags is currently unused and defaults to zero.
      The provided hash may contain the following keys
 
 
  - $info = $dom->get_guest_info($types, $flags=0)
 
  - Get information about the domain guest configuration. The
      $types parameter determines what pieces of
      information are returned and should be the bitwise or of the following
      constants:
 
 
$flags is currently unused and defaults to
    zero. 
 
  - $dom->set_agent_response_timeout($timeout, $flags=0)
 
  - Set the amount of time to wait for the agent to respond to a command.
      $timeout is a positive integer representing the
      number of seconds to wait, or one of the constants:
 
 
The $flags parameter is currently unused
    and defaults to zero. 
 
  - my @keys =
    $dom->authorized_ssh_keys_get($user, $flags=0)
 
  - Retrieve the list of authorized SSH keys for the user account
      $user. The $flags
      parameter is currently unused and defaults to zero.
 
  - $dom->authorized_ssh_keys_set($user, \@keys, $flags=0)
 
  - Update the list of authorized SSH keys for the user account
      $user. The @keys parameter
      should be an array reference containing the new keys, if any. The default
      behaviour is to set the authorized SSH keys to the exact set specified in
      @keys. This can be modified via the
      $flags parameter which takes the following
      constants
 
 
  - my @msgs =
    $dom->get_messages($flags=0)
 
  - Retrieve a list of messages associated with the domain. The optional
      $flags parameter can accept zero or more of
 
 
  - $dom->start_dirty_rate_calc($dom, $secs, $flags=0)
 
  - Request calculation of the domain's memory dirty rate over the next
      $secs seconds. $flags
      accepts one or more of
 
 
  - $dom->fd_associate($name, \@fds, $flags=0)
 
  - Associate a set of file descriptors in @fds with
      the domain, giving them the name $name. If
      $flags is non-zero, it can take one or more
    of:
 
 
  - $dom->graphics_reload($type, $flags=0)
 
  - Request a reload of graphics backend state. The
      $type parameter specifies what type of graphics
      backend to reload if there are multiple present. It takes one of the
      constants:
 
 
The $flags parameter is currently unused
    and defaults to zero. 
 
A number of the APIs take a
    "flags" parameter. In most cases passing a
    value of zero will be satisfactory. Some APIs, however, accept named
    constants to alter their behaviour. This section documents the current known
    constants. 
The following constants can be used to control the behaviour of
    domain define operations 
  - Sys::Virt::Domain::DEFINE_VALIDATE
 
  - Validate the XML document against the XML schema
 
 
The following constants defined performance events which can be
    monitored for a guest 
  - Sys::Virt::Domain::PERF_PARAM_CMT
 
  - The CMT event counter which can be used to measure the usage of cache
      (bytes) by applications running on the platform. It corresponds to the
      "perf.cmt" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_MBML
 
  - The MBML event counter which can be used to monitor the amount of data
      (bytes/s) sent through the memory controller on the socket. It corresponds
      to the "perf.mbml" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_MBMT
 
  - The MBMT event counter which can be used to monitor total system bandwidth
      (bytes/s) from one level of cache to another. It corresponds to the
      "perf.mbmt" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_CACHE_MISSES
 
  - The cache_misses perf event counter which can be used to measure the count
      of cache misses by applications running on the platform. It corresponds to
      the "perf.cache_misses" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_CACHE_REFERENCES
 
  - The cache_references perf event counter which can be used to measure the
      count of cache hits by applications running on the platform. It
      corresponds to the "perf.cache_references" field in the *Stats
      APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_CPU_CYCLES
 
  - The cpu_cycles perf event counter which can be used to measure how many
      cpu cycles one instruction needs. It corresponds to the
      "perf.cpu_cycles" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_INSTRUCTIONS
 
  - The instructions perf event counter which can be used to measure the count
      of instructions by applications running on the platform. It corresponds to
      the "perf.instructions" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_BRANCH_INSTRUCTIONS
 
  - The branch_instructions perf event counter which can be used to measure
      the count of instructions by applications running on the platform. It
      corresponds to the "perf.branch_instructions" field in the
      *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_BRANCH_MISSES
 
  - The branch_misses perf event which can be used to measure the count of
      branch misses by applications running on the platform. It corresponds to
      the "perf.branch_misses" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_BUS_CYCLES
 
  - The bus_cycles perf event counter which can be used to measure the count
      of bus cycles by applications running on the platform. It corresponds to
      the "perf.bus_cycles" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_STALLED_CYCLES_FRONTEND
 
  - The stalled_cycles_frontend perf event counter which can be used to
      measure the count of stalled cpu cycles in the frontend of the instruction
      processor pipeline by applications running on the platform. It corresponds
      to the "perf.stalled_cycles_frontend" field in the *Stats
    APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_STALLED_CYCLES_BACKEND
 
  - The stalled_cycles_backend perf event counter which can be used to measure
      the count of stalled cpu cycles in the backend of the instruction
      processor pipeline by application running on the platform. It corresponds
      to the "perf.stalled_cycles_backend" field in the *Stats
    APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_REF_CPU_CYCLES
 
  - The ref_cpu_cycles perf event counter which can be used to measure the
      count of total cpu cycles not affected by CPU frequency scaling by
      applications running on the platform. It corresponds to the
      "perf.ref_cpu_cycles" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_CPU_CLOCK
 
  - The cpu_clock perf event counter which can be used to measure the count of
      cpu clock time by applications running on the platform. It corresponds to
      the "perf.cpu_clock" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_TASK_CLOCK
 
  - The task_clock perf event counter which can be used to measure the count
      of task clock time by applications running on the platform. It corresponds
      to the "perf.task_clock" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS
 
  - The page_faults perf event counter which can be used to measure the count
      of page faults by applications running on the platform. It corresponds to
      the "perf.page_faults" field in the *Stats APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_CONTEXT_SWITCHES
 
  - The context_switches perf event counter which can be used to measure the
      count of context switches by applications running on the platform. It
      corresponds to the "perf.context_switches" field in the *Stats
      APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_CPU_MIGRATIONS
 
  - The cpu_migrations perf event counter which can be used to measure the
      count of cpu migrations by applications running on the platform. It
      corresponds to the "perf.cpu_migrations" field in the *Stats
      APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MIN
 
  - The page_faults_min perf event counter which can be used to measure the
      count of minor page faults by applications running on the platform. It
      corresponds to the "perf.page_faults_min" field in the *Stats
      APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MAJ
 
  - The page_faults_maj perf event counter which can be used to measure the
      count of major page faults by applications running on the platform. It
      corresponds to the "perf.page_faults_maj" field in the *Stats
      APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_ALIGNMENT_FAULTS
 
  - The alignment_faults perf event counter which can be used to measure the
      count of alignment faults by applications running on the platform. It
      corresponds to the "perf.alignment_faults" field in the *Stats
      APIs.
 
  - Sys::Virt::Domain::PERF_PARAM_EMULATION_FAULTS
 
  - The emulation_faults perf event counter which can be used to measure the
      count of emulation faults by applications running on the platform. It
      corresponds to the "perf.emulation_faults" field in the *Stats
      APIs.
 
 
The following constants defined IOThread statistics which can be
    monitored for a guest 
  - Sys::Virt::Domain::IOTHREAD_PARAM_POLL_MAX_NS
 
  - The maximum polling time that can be used by polling algorithm in ns. The
      polling time starts at 0 (zero) and is the time spent by the guest to
      process IOThread data before returning the CPU to the host. The polling
      time will be dynamically modified over time based on the poll_grow and
      poll_shrink parameters provided.
 
  - Sys::Virt::Domain::IOTHREAD_PARAM_POLL_GROW
 
  - This provides a value for the dynamic polling adjustment algorithm to use
      to grow its polling interval up to the poll_max_ns value.
 
  - Sys::Virt::Domain::IOTHREAD_PARAM_POLL_SHRINK
 
  - This provides a value for the dynamic polling adjustment algorithm to use
      to shrink its polling interval when the polling interval exceeds the
      poll_max_ns value.
 
  - Sys::Virt::Domain::IOTHREAD_PARAM_THREAD_POOL_MIN
 
  - Sets the lower bound for thread pool size. A value of -1 disables this
      bound leaving hypervisor use its default value, though this value is not
      accepted for running domains. Due to internal implementation it's
      recommended to set lower and upper bounds separately.
 
  - Sys::Virt::Domain::IOTHREAD_PARAM_THREAD_POOL_MAX
 
  - Sets the upper bound for thread pool size. A value of -1 disables this
      bound leaving hypervisor use its default value, though this value is not
      accepted for running domains. Since the upper band has to be equal to or
      greater than lower bound value of 0 is not accepted. Due to internal
      implementation it's recommended to set lower and upper bounds
    separately.
 
 
Daniel P. Berrange <berrange@redhat.com> 
Copyright (C) 2006 Red Hat Copyright (C) 2006-2007 Daniel P.
    Berrange 
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. 
Sys::Virt, Sys::Virt::Error,
    "http://libvirt.org" 
 
 
  Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc.
  |