NAME

Sys::Async::Virt - LibVirt protocol implementation for clients

VERSION

v0.0.12

Based on LibVirt tag v10.9.0

SYNOPSIS

use IO::Async::Loop;
use Sys::Async::Virt;

my $loop = IO::Async::Loop->new;
my $client = Sys::Async::Virt->new(url => 'qemu:///system');

$loop->add( $client );
await $client->connect;
my $domains = await $client->list_all_domains;

DESCRIPTION

This module manages access to a LibVirt service through its remote protocol.

The API documentation of this module and the related modules Sys::Async::Virt::* is meant to be used in conjunction with the documentation found at LibVirt's API reference. Since the C API is procedural whereas the Perl API is object oriented, the mapping of API entry points isn't one-to-one. Each entry point links to its C API equivalent on the libvirt.org site, enabling users to quickly find documentation. (Please report any broken links.)

An important difference with the C API is that this API only lists the INPUT and INPUT|OUTPUT (as input) arguments for its functions. The OUTPUT and INPUT|OUTPUT (as output) arguments will be returned in the on_reply event.

RUNNING AGAINST OLDER SERVERS

The reference LibVirt version of this module is v10.9.0. This means all API entry points have been implemented as they are declared in the protocol of that version (except for the ones listed in the section "UNIMPLEMENTED ENTRYPOINTS"). The consequence of a server being of a lower version is that some entry points will throw errors when being used, if not supported by the server.

RUNNING AGAINST NEWER SERVERS

The module can run against any version of LibVirt newer than v10.9.0; any new entry points in the API will not be available, but all existing APIs can be used as per the stability guarantees.

STABILITY GUARANTEES

The modules in this distribution are considered experimental, meaning that no interface guarantees are made at this time. However, since the protocol description from which most of the code is generated, changes are anticipated to be minimal. The more feedback the project receives, the sooner the project will be able to commit to the API as it is.

ASYNCHRONOUS INVOCATIONS

The API calls in these modules invoke remote procedure calls (RPC) on a LibVirt server (which may run locally). The return values are Futures which can be awaited using Future::AsyncAwait. Many calls start a process on the server without awaiting the result. One example is the $domain-shutdown()> invocation: it returns when shut down has been initiated, not when the domain is actually shut off. Other calls query the server for state (such as $domain-get_state()>) and return the state when the server replies to the invocation.

The LibVirt protocol and server support concurrent requests: requests issued before earlier requests have finished. The server responds as soon as the result is available. This means that server replies may come back out-of-order, resolving futures as results become available. The use of async and await help to await results from the server and continue processing as soon as results become available.

CLIENT EVENTS

on_message

$on_message->( @@@TODO );

Receives all messages which either don't classify as a callback invocation (i.e. the return value structure doesn't have a callbackID member), or for which no callback has been registered through one of the callback registration functions.

on_close

$on_close->( $client, $reason );

LIBVIRT EVENTS

domain_event_register_any

$cb = await $client->domain_event_register_any( $event_id, $dom = undef );

Subscribes to events of type $event_id. Restricts events to a specific domain by passing a value into $dom. Please refer to the LibVirt documentation for the list of available domain related events.

Returns a Sys::Async::Virt::Callback instance.

Example:

my $cb = $client->domain_event_register_any( $client->DOMAIN_EVENT_ID_LIFECYCLE );
my $event_data = await $cb->next_event;
# { dom => $dom, event => $event, detail => $detail }

The domain event id documentation refers to various callbacks, which are called (in the C API) with a list of arguments. $event_data will generally contain the same values, except the conn (which is available through dom) and the opaque parameters. Refer to virConnectDomainEventGenericCallback to compare the definition of the callback function and the returned $event_data above.

network_event_register_any

$cb = await $client->network_event_register_any( $event_id, $net = undef );

Subscribes to events of type $event_id. Restricts events to a specific network by passing a value into $net. Similar to domain_event_register_any; please refer to the LibVirt documentation for the list of available network related events.

Returns a Sys::Async::Virt::Callback instance.

node_device_event_register_any

$cb = await $client->node_device_event_register_any( $event_id, $dev = undef );

Subscribes to events of type $event_id. Restricts events to a specific device by passing a value into $dev. Similar to domain_event_register_any; please refer to the LibVirt documentation for the list of available node device related events.

Returns a Sys::Async::Virt::Callback instance.

secret_event_register_any

$cb = await $client->secret_event_register_any( $event_id, $secret = undef);

Subscribes to events of type $event_id. Restricts events to a specific secret by passing a value into $secret. Similar to domain_event_register_any; please refer to the LibVirt documentation for the list of available secret related events.

Returns a Sys::Async::Virt::Callback instance.

storage_pool_event_register_any

$cb = await $client->storage_pool_event_register_any( $event_id, $pool = undef );

Subscribes to events of type $event_id. Restricts events to a specific storage pool by passing a value into $pool. Similar to domain_event_register_any; please refer to the LibVirt documentation for the list of available storage (pool) related events.

Returns a Sys::Async::Virt::Callback instance.

CONSTRUCTOR

new

$client = Sys::Async::Virt->new( url => $url, ... );

Creates a new client instance. The constructor supports these parameters:

  • factory (optional)

    An instance of Sys::Async::Virt::Connection::Factory or derived class. Not required when the connection parameter is supplied.

  • connection (optional)

    An instance of Sys::Async::Virt::Connection or derived class. The connect method will be called to establish the actual connection.

  • transport (optional)

    An instance of Protocol::Sys::Virt::Transport or derived class configured to send the output through the connection passed in.

  • remote (optional)

    An instance of Protocol::Sys::Virt::Remote or derived class configured in a client role. The remote will be registered with the tranport as part of the connect procedure.

  • keepalive (optional)

    An instance of Protocol::Sys::Virt::KeepAlive or derived class configured to reply to PING messages using a PONG message as well as closing the connection when the keepalive threshold is exceeded.

  • url (optional)

    The URL of the hypervisor to connect to as per https://libvirt.org/uri.html.

    When not supplied, defaults to the environment variable LIBVIRT_DEFAULT_URI.

METHODS

configure

register

$client->register( $remote );

connect

await $client->connect( async sub pump($connection, $transport) { ... } );

Sets up the transport connection to the server, including authentication keep alive monitoring and close callback registration.

Calls pump to receive data from the $connection, sending the received data into $transport. The function should throw an exception in case of error or return in case of an End-Of-File (EOF) condition.

auth

await $client->auth( $auth_type = undef );
# -> (* no data *)

Authenticates against the server. $auth_type can be any of:

  • none

  • sasl

  • polkit

When no $auth_type is passed, the first authentication method announced by the server, is used.

is_connected

my $bool = $client->is_connected;

is_opened

my $bool = $client->is_opened;

is_secure

my $bool = await $client->is_secure;

open

await $client->open();
# -> (* no data *)

This function opens the connection to the remote driver $client->{url} as passed to new and documented in LibVirt's Connection URIs. Note that the value is to be the local hypervisor URI as applicable to the remote end of the connection.

close

await $client->close;
# -> (* no data *)

Announces to the remote the intent to close the connection. The client will receive a confirmation message from the server after which the server will close the connection.

baseline_cpu

$cpu = await $client->baseline_cpu( $xmlCPUs, $flags = 0 );

See documentation of virConnectBaselineCPU.

baseline_hypervisor_cpu

$cpu = await $client->baseline_hypervisor_cpu( $emulator, $arch, $machine, $virttype, $xmlCPUs, $flags = 0 );

See documentation of virConnectBaselineHypervisorCPU.

compare_cpu

$result = await $client->compare_cpu( $xml, $flags = 0 );

See documentation of virConnectCompareCPU.

compare_hypervisor_cpu

$result = await $client->compare_hypervisor_cpu( $emulator, $arch, $machine, $virttype, $xmlCPU, $flags = 0 );

See documentation of virConnectCompareHypervisorCPU.

domain_create_xml

$dom = await $client->domain_create_xml( $xml_desc, $flags = 0 );

See documentation of virDomainCreateXML.

domain_define_xml

$dom = await $client->domain_define_xml( $xml );

See documentation of virDomainDefineXML.

domain_define_xml_flags

$dom = await $client->domain_define_xml_flags( $xml, $flags = 0 );

See documentation of virDomainDefineXMLFlags.

domain_lookup_by_id

$dom = await $client->domain_lookup_by_id( $id );

See documentation of virDomainLookupByID.

domain_lookup_by_name

$dom = await $client->domain_lookup_by_name( $name );

See documentation of virDomainLookupByName.

domain_lookup_by_uuid

$dom = await $client->domain_lookup_by_uuid( $uuid );

See documentation of virDomainLookupByUUID.

domain_restore

await $client->domain_restore( $from );
# -> (* no data *)

See documentation of virDomainRestore.

domain_restore_flags

await $client->domain_restore_flags( $from, $dxml, $flags = 0 );
# -> (* no data *)

See documentation of virDomainRestoreFlags.

domain_restore_params

await $client->domain_restore_params( $params, $flags = 0 );
# -> (* no data *)

See documentation of virDomainRestoreParams.

domain_save_image_define_xml

await $client->domain_save_image_define_xml( $file, $dxml, $flags = 0 );
# -> (* no data *)

See documentation of virDomainSaveImageDefineXML.

domain_save_image_get_xml_desc

$xml = await $client->domain_save_image_get_xml_desc( $file, $flags = 0 );

See documentation of virDomainSaveImageGetXMLDesc.

domain_xml_from_native

$domainXml = await $client->domain_xml_from_native( $nativeFormat, $nativeConfig, $flags = 0 );

See documentation of virConnectDomainXMLFromNative.

domain_xml_to_native

$nativeConfig = await $client->domain_xml_to_native( $nativeFormat, $domainXml, $flags = 0 );

See documentation of virConnectDomainXMLToNative.

get_all_domain_stats

$retStats = await $client->get_all_domain_stats( $doms, $stats, $flags = 0 );

See documentation of virConnectGetAllDomainStats.

get_capabilities

$capabilities = await $client->get_capabilities;

See documentation of virConnectGetCapabilities.

get_cpu_model_names

$models = await $client->get_cpu_model_names( $arch, $flags = 0 );

See documentation of virConnectGetCPUModelNames.

get_domain_capabilities

$capabilities = await $client->get_domain_capabilities( $emulatorbin, $arch, $machine, $virttype, $flags = 0 );

See documentation of virConnectGetDomainCapabilities.

get_hostname

$hostname = await $client->get_hostname;

See documentation of virConnectGetHostname.

get_lib_version

$lib_ver = await $client->get_lib_version;

See documentation of virConnectGetLibVersion.

get_max_vcpus

$max_vcpus = await $client->get_max_vcpus( $type );

See documentation of virConnectGetMaxVcpus.

get_storage_pool_capabilities

$capabilities = await $client->get_storage_pool_capabilities( $flags = 0 );

See documentation of virConnectGetStoragePoolCapabilities.

get_sysinfo

$sysinfo = await $client->get_sysinfo( $flags = 0 );

See documentation of virConnectGetSysinfo.

get_type

$type = await $client->get_type;

See documentation of virConnectGetType.

get_uri

$uri = await $client->get_uri;

See documentation of virConnectGetURI.

get_version

$hv_ver = await $client->get_version;

See documentation of virConnectGetVersion.

interface_change_begin

await $client->interface_change_begin( $flags = 0 );
# -> (* no data *)

See documentation of virInterfaceChangeBegin.

interface_change_commit

await $client->interface_change_commit( $flags = 0 );
# -> (* no data *)

See documentation of virInterfaceChangeCommit.

interface_change_rollback

await $client->interface_change_rollback( $flags = 0 );
# -> (* no data *)

See documentation of virInterfaceChangeRollback.

interface_define_xml

$iface = await $client->interface_define_xml( $xml, $flags = 0 );

See documentation of virInterfaceDefineXML.

interface_lookup_by_mac_string

$iface = await $client->interface_lookup_by_mac_string( $mac );

See documentation of virInterfaceLookupByMACString.

interface_lookup_by_name

$iface = await $client->interface_lookup_by_name( $name );

See documentation of virInterfaceLookupByName.

list_all_domains

$domains = await $client->list_all_domains( $flags = 0 );

See documentation of virConnectListAllDomains.

list_all_interfaces

$ifaces = await $client->list_all_interfaces( $flags = 0 );

See documentation of virConnectListAllInterfaces.

list_all_networks

$nets = await $client->list_all_networks( $flags = 0 );

See documentation of virConnectListAllNetworks.

list_all_node_devices

$devices = await $client->list_all_node_devices( $flags = 0 );

See documentation of virConnectListAllNodeDevices.

list_all_nwfilter_bindings

$bindings = await $client->list_all_nwfilter_bindings( $flags = 0 );

See documentation of virConnectListAllNWFilterBindings.

list_all_nwfilters

$filters = await $client->list_all_nwfilters( $flags = 0 );

See documentation of virConnectListAllNWFilters.

list_all_secrets

$secrets = await $client->list_all_secrets( $flags = 0 );

See documentation of virConnectListAllSecrets.

list_all_storage_pools

$pools = await $client->list_all_storage_pools( $flags = 0 );

See documentation of virConnectListAllStoragePools.

list_defined_domains

$names = await $client->list_defined_domains;

See documentation of virConnectListDefinedDomains.

list_defined_interfaces

$names = await $client->list_defined_interfaces;

See documentation of virConnectListDefinedInterfaces.

list_defined_networks

$names = await $client->list_defined_networks;

See documentation of virConnectListDefinedNetworks.

list_defined_storage_pools

$names = await $client->list_defined_storage_pools;

See documentation of virConnectListDefinedStoragePools.

list_domains

$ids = await $client->list_domains;

See documentation of virConnectListDomains.

list_interfaces

$names = await $client->list_interfaces;

See documentation of virConnectListInterfaces.

list_networks

$names = await $client->list_networks;

See documentation of virConnectListNetworks.

list_nwfilters

$names = await $client->list_nwfilters;

See documentation of virConnectListNWFilters.

list_secrets

$uuids = await $client->list_secrets;

See documentation of virConnectListSecrets.

list_storage_pools

$names = await $client->list_storage_pools;

See documentation of virConnectListStoragePools.

network_create_xml

$net = await $client->network_create_xml( $xml );

See documentation of virNetworkCreateXML.

network_create_xml_flags

$net = await $client->network_create_xml_flags( $xml, $flags = 0 );

See documentation of virNetworkCreateXMLFlags.

network_define_xml

$net = await $client->network_define_xml( $xml );

See documentation of virNetworkDefineXML.

network_define_xml_flags

$net = await $client->network_define_xml_flags( $xml, $flags = 0 );

See documentation of virNetworkDefineXMLFlags.

network_lookup_by_name

$net = await $client->network_lookup_by_name( $name );

See documentation of virNetworkLookupByName.

network_lookup_by_uuid

$net = await $client->network_lookup_by_uuid( $uuid );

See documentation of virNetworkLookupByUUID.

node_get_cpu_stats

$params = await $client->node_get_cpu_stats( $cpuNum, $flags = 0 );

See documentation of virNodeGetCPUStats.

node_get_free_memory

$freeMem = await $client->node_get_free_memory;

See documentation of virNodeGetFreeMemory.

node_get_info

await $client->node_get_info;
# -> { cores => $cores,
#      cpus => $cpus,
#      memory => $memory,
#      mhz => $mhz,
#      model => $model,
#      nodes => $nodes,
#      sockets => $sockets,
#      threads => $threads }

See documentation of virNodeGetInfo.

node_get_memory_parameters

$params = await $client->node_get_memory_parameters( $flags = 0 );

See documentation of virNodeGetMemoryParameters.

node_get_memory_stats

$params = await $client->node_get_memory_stats( $cellNum, $flags = 0 );

See documentation of virNodeGetMemoryStats.

node_get_sev_info

$params = await $client->node_get_sev_info( $flags = 0 );

See documentation of virNodeGetSEVInfo.

node_list_devices

$names = await $client->node_list_devices( $cap, $flags = 0 );

See documentation of virNodeListDevices.

node_num_of_devices

$num = await $client->node_num_of_devices( $cap, $flags = 0 );

See documentation of virNodeNumOfDevices.

node_set_memory_parameters

await $client->node_set_memory_parameters( $params, $flags = 0 );
# -> (* no data *)

See documentation of virNodeSetMemoryParameters.

node_suspend_for_duration

await $client->node_suspend_for_duration( $target, $duration, $flags = 0 );
# -> (* no data *)

See documentation of virNodeSuspendForDuration.

num_of_defined_domains

$num = await $client->num_of_defined_domains;

See documentation of virConnectNumOfDefinedDomains.

num_of_defined_interfaces

$num = await $client->num_of_defined_interfaces;

See documentation of virConnectNumOfDefinedInterfaces.

num_of_defined_networks

$num = await $client->num_of_defined_networks;

See documentation of virConnectNumOfDefinedNetworks.

num_of_defined_storage_pools

$num = await $client->num_of_defined_storage_pools;

See documentation of virConnectNumOfDefinedStoragePools.

num_of_domains

$num = await $client->num_of_domains;

See documentation of virConnectNumOfDomains.

num_of_interfaces

$num = await $client->num_of_interfaces;

See documentation of virConnectNumOfInterfaces.

num_of_networks

$num = await $client->num_of_networks;

See documentation of virConnectNumOfNetworks.

num_of_nwfilters

$num = await $client->num_of_nwfilters;

See documentation of virConnectNumOfNWFilters.

num_of_secrets

$num = await $client->num_of_secrets;

See documentation of virConnectNumOfSecrets.

num_of_storage_pools

$num = await $client->num_of_storage_pools;

See documentation of virConnectNumOfStoragePools.

nwfilter_binding_create_xml

$nwfilter = await $client->nwfilter_binding_create_xml( $xml, $flags = 0 );

See documentation of virNWFilterBindingCreateXML.

nwfilter_binding_lookup_by_port_dev

$nwfilter = await $client->nwfilter_binding_lookup_by_port_dev( $name );

See documentation of virNWFilterBindingLookupByPortDev.

nwfilter_define_xml

$nwfilter = await $client->nwfilter_define_xml( $xml );

See documentation of virNWFilterDefineXML.

nwfilter_define_xml_flags

$nwfilter = await $client->nwfilter_define_xml_flags( $xml, $flags = 0 );

See documentation of virNWFilterDefineXMLFlags.

nwfilter_lookup_by_name

$nwfilter = await $client->nwfilter_lookup_by_name( $name );

See documentation of virNWFilterLookupByName.

nwfilter_lookup_by_uuid

$nwfilter = await $client->nwfilter_lookup_by_uuid( $uuid );

See documentation of virNWFilterLookupByUUID.

secret_define_xml

$secret = await $client->secret_define_xml( $xml, $flags = 0 );

See documentation of virSecretDefineXML.

secret_lookup_by_usage

$secret = await $client->secret_lookup_by_usage( $usageType, $usageID );

See documentation of virSecretLookupByUsage.

secret_lookup_by_uuid

$secret = await $client->secret_lookup_by_uuid( $uuid );

See documentation of virSecretLookupByUUID.

set_identity

await $client->set_identity( $params, $flags = 0 );
# -> (* no data *)

See documentation of virConnectSetIdentity.

storage_pool_create_xml

$pool = await $client->storage_pool_create_xml( $xml, $flags = 0 );

See documentation of virStoragePoolCreateXML.

storage_pool_define_xml

$pool = await $client->storage_pool_define_xml( $xml, $flags = 0 );

See documentation of virStoragePoolDefineXML.

storage_pool_lookup_by_name

$pool = await $client->storage_pool_lookup_by_name( $name );

See documentation of virStoragePoolLookupByName.

storage_pool_lookup_by_target_path

$pool = await $client->storage_pool_lookup_by_target_path( $path );

See documentation of virStoragePoolLookupByTargetPath.

storage_pool_lookup_by_uuid

$pool = await $client->storage_pool_lookup_by_uuid( $uuid );

See documentation of virStoragePoolLookupByUUID.

storage_vol_lookup_by_key

$vol = await $client->storage_vol_lookup_by_key( $key );

See documentation of virStorageVolLookupByKey.

storage_vol_lookup_by_path

$vol = await $client->storage_vol_lookup_by_path( $path );

See documentation of virStorageVolLookupByPath.

CONSTANTS

CLOSE_REASON_ERROR
CLOSE_REASON_EOF
CLOSE_REASON_KEEPALIVE
CLOSE_REASON_CLIENT
TYPED_PARAM_INT
TYPED_PARAM_UINT
TYPED_PARAM_LLONG
TYPED_PARAM_ULLONG
TYPED_PARAM_DOUBLE
TYPED_PARAM_BOOLEAN
TYPED_PARAM_STRING
TYPED_PARAM_STRING_OKAY
TYPED_PARAM_FIELD_LENGTH
DOMAIN_DEFINE_VALIDATE
LIST_DOMAINS_ACTIVE
LIST_DOMAINS_INACTIVE
LIST_DOMAINS_PERSISTENT
LIST_DOMAINS_TRANSIENT
LIST_DOMAINS_RUNNING
LIST_DOMAINS_PAUSED
LIST_DOMAINS_SHUTOFF
LIST_DOMAINS_OTHER
LIST_DOMAINS_MANAGEDSAVE
LIST_DOMAINS_NO_MANAGEDSAVE
LIST_DOMAINS_AUTOSTART
LIST_DOMAINS_NO_AUTOSTART
LIST_DOMAINS_HAS_SNAPSHOT
LIST_DOMAINS_NO_SNAPSHOT
LIST_DOMAINS_HAS_CHECKPOINT
LIST_DOMAINS_NO_CHECKPOINT
GET_ALL_DOMAINS_STATS_ACTIVE
GET_ALL_DOMAINS_STATS_INACTIVE
GET_ALL_DOMAINS_STATS_PERSISTENT
GET_ALL_DOMAINS_STATS_TRANSIENT
GET_ALL_DOMAINS_STATS_RUNNING
GET_ALL_DOMAINS_STATS_PAUSED
GET_ALL_DOMAINS_STATS_SHUTOFF
GET_ALL_DOMAINS_STATS_OTHER
GET_ALL_DOMAINS_STATS_NOWAIT
GET_ALL_DOMAINS_STATS_BACKING
GET_ALL_DOMAINS_STATS_ENFORCE_STATS
DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED
DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED
DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN
DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED
DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL
DOMAIN_EVENT_ID_LIFECYCLE
DOMAIN_EVENT_ID_REBOOT
DOMAIN_EVENT_ID_RTC_CHANGE
DOMAIN_EVENT_ID_WATCHDOG
DOMAIN_EVENT_ID_IO_ERROR
DOMAIN_EVENT_ID_GRAPHICS
DOMAIN_EVENT_ID_IO_ERROR_REASON
DOMAIN_EVENT_ID_CONTROL_ERROR
DOMAIN_EVENT_ID_BLOCK_JOB
DOMAIN_EVENT_ID_DISK_CHANGE
DOMAIN_EVENT_ID_TRAY_CHANGE
DOMAIN_EVENT_ID_PMWAKEUP
DOMAIN_EVENT_ID_PMSUSPEND
DOMAIN_EVENT_ID_BALLOON_CHANGE
DOMAIN_EVENT_ID_PMSUSPEND_DISK
DOMAIN_EVENT_ID_DEVICE_REMOVED
DOMAIN_EVENT_ID_BLOCK_JOB_2
DOMAIN_EVENT_ID_TUNABLE
DOMAIN_EVENT_ID_AGENT_LIFECYCLE
DOMAIN_EVENT_ID_DEVICE_ADDED
DOMAIN_EVENT_ID_MIGRATION_ITERATION
DOMAIN_EVENT_ID_JOB_COMPLETED
DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED
DOMAIN_EVENT_ID_METADATA_CHANGE
DOMAIN_EVENT_ID_BLOCK_THRESHOLD
DOMAIN_EVENT_ID_MEMORY_FAILURE
DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE
SUSPEND_TARGET_MEM
SUSPEND_TARGET_DISK
SUSPEND_TARGET_HYBRID
SECURITY_LABEL_BUFLEN
SECURITY_MODEL_BUFLEN
SECURITY_DOI_BUFLEN
CPU_STATS_FIELD_LENGTH
CPU_STATS_ALL_CPUS
CPU_STATS_KERNEL
CPU_STATS_USER
CPU_STATS_IDLE
CPU_STATS_IOWAIT
CPU_STATS_INTR
CPU_STATS_UTILIZATION
MEMORY_STATS_FIELD_LENGTH
MEMORY_STATS_ALL_CELLS
MEMORY_STATS_TOTAL
MEMORY_STATS_FREE
MEMORY_STATS_BUFFERS
MEMORY_STATS_CACHED
MEMORY_SHARED_PAGES_TO_SCAN
MEMORY_SHARED_SLEEP_MILLISECS
MEMORY_SHARED_PAGES_SHARED
MEMORY_SHARED_PAGES_SHARING
MEMORY_SHARED_PAGES_UNSHARED
MEMORY_SHARED_PAGES_VOLATILE
MEMORY_SHARED_FULL_SCANS
MEMORY_SHARED_MERGE_ACROSS_NODES
SEV_PDH
SEV_CERT_CHAIN
SEV_CPU0_ID
SEV_CBITPOS
SEV_REDUCED_PHYS_BITS
SEV_MAX_GUESTS
SEV_MAX_ES_GUESTS
RO
NO_ALIASES
CRED_USERNAME
CRED_AUTHNAME
CRED_LANGUAGE
CRED_CNONCE
CRED_PASSPHRASE
CRED_ECHOPROMPT
CRED_NOECHOPROMPT
CRED_REALM
CRED_EXTERNAL
UUID_BUFLEN
UUID_STRING_BUFLEN
IDENTITY_USER_NAME
IDENTITY_UNIX_USER_ID
IDENTITY_GROUP_NAME
IDENTITY_UNIX_GROUP_ID
IDENTITY_PROCESS_ID
IDENTITY_PROCESS_TIME
IDENTITY_SASL_USER_NAME
IDENTITY_X509_DISTINGUISHED_NAME
IDENTITY_SELINUX_CONTEXT
CPU_COMPARE_ERROR
CPU_COMPARE_INCOMPATIBLE
CPU_COMPARE_IDENTICAL
CPU_COMPARE_SUPERSET
COMPARE_CPU_FAIL_INCOMPATIBLE
COMPARE_CPU_VALIDATE_XML
BASELINE_CPU_EXPAND_FEATURES
BASELINE_CPU_MIGRATABLE
ALLOC_PAGES_ADD
ALLOC_PAGES_SET
LIST_INTERFACES_INACTIVE
LIST_INTERFACES_ACTIVE
INTERFACE_DEFINE_VALIDATE
LIST_NETWORKS_INACTIVE
LIST_NETWORKS_ACTIVE
LIST_NETWORKS_PERSISTENT
LIST_NETWORKS_TRANSIENT
LIST_NETWORKS_AUTOSTART
LIST_NETWORKS_NO_AUTOSTART
NETWORK_CREATE_VALIDATE
NETWORK_DEFINE_VALIDATE
NETWORK_EVENT_ID_LIFECYCLE
NETWORK_EVENT_ID_METADATA_CHANGE
LIST_NODE_DEVICES_CAP_SYSTEM
LIST_NODE_DEVICES_CAP_PCI_DEV
LIST_NODE_DEVICES_CAP_USB_DEV
LIST_NODE_DEVICES_CAP_USB_INTERFACE
LIST_NODE_DEVICES_CAP_NET
LIST_NODE_DEVICES_CAP_SCSI_HOST
LIST_NODE_DEVICES_CAP_SCSI_TARGET
LIST_NODE_DEVICES_CAP_SCSI
LIST_NODE_DEVICES_CAP_STORAGE
LIST_NODE_DEVICES_CAP_FC_HOST
LIST_NODE_DEVICES_CAP_VPORTS
LIST_NODE_DEVICES_CAP_SCSI_GENERIC
LIST_NODE_DEVICES_CAP_DRM
LIST_NODE_DEVICES_CAP_MDEV_TYPES
LIST_NODE_DEVICES_CAP_MDEV
LIST_NODE_DEVICES_CAP_CCW_DEV
LIST_NODE_DEVICES_CAP_CSS_DEV
LIST_NODE_DEVICES_CAP_VDPA
LIST_NODE_DEVICES_CAP_AP_CARD
LIST_NODE_DEVICES_CAP_AP_QUEUE
LIST_NODE_DEVICES_CAP_AP_MATRIX
LIST_NODE_DEVICES_CAP_VPD
LIST_NODE_DEVICES_PERSISTENT
LIST_NODE_DEVICES_TRANSIENT
LIST_NODE_DEVICES_INACTIVE
LIST_NODE_DEVICES_ACTIVE
NODE_DEVICE_CREATE_XML_VALIDATE
NODE_DEVICE_DEFINE_XML_VALIDATE
NODE_DEVICE_EVENT_ID_LIFECYCLE
NODE_DEVICE_EVENT_ID_UPDATE
NWFILTER_DEFINE_VALIDATE
NWFILTER_BINDING_CREATE_VALIDATE
SECRET_USAGE_TYPE_NONE
SECRET_USAGE_TYPE_VOLUME
SECRET_USAGE_TYPE_CEPH
SECRET_USAGE_TYPE_ISCSI
SECRET_USAGE_TYPE_TLS
SECRET_USAGE_TYPE_VTPM
LIST_SECRETS_EPHEMERAL
LIST_SECRETS_NO_EPHEMERAL
LIST_SECRETS_PRIVATE
LIST_SECRETS_NO_PRIVATE
SECRET_DEFINE_VALIDATE
SECRET_EVENT_ID_LIFECYCLE
SECRET_EVENT_ID_VALUE_CHANGED
STORAGE_POOL_CREATE_NORMAL
STORAGE_POOL_CREATE_WITH_BUILD
STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE
STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE
LIST_STORAGE_POOLS_INACTIVE
LIST_STORAGE_POOLS_ACTIVE
LIST_STORAGE_POOLS_PERSISTENT
LIST_STORAGE_POOLS_TRANSIENT
LIST_STORAGE_POOLS_AUTOSTART
LIST_STORAGE_POOLS_NO_AUTOSTART
LIST_STORAGE_POOLS_DIR
LIST_STORAGE_POOLS_FS
LIST_STORAGE_POOLS_NETFS
LIST_STORAGE_POOLS_LOGICAL
LIST_STORAGE_POOLS_DISK
LIST_STORAGE_POOLS_ISCSI
LIST_STORAGE_POOLS_SCSI
LIST_STORAGE_POOLS_MPATH
LIST_STORAGE_POOLS_RBD
LIST_STORAGE_POOLS_SHEEPDOG
LIST_STORAGE_POOLS_GLUSTER
LIST_STORAGE_POOLS_ZFS
LIST_STORAGE_POOLS_VSTORAGE
LIST_STORAGE_POOLS_ISCSI_DIRECT
STORAGE_POOL_DEFINE_VALIDATE
STORAGE_VOL_CREATE_PREALLOC_METADATA
STORAGE_VOL_CREATE_VALIDATE
STORAGE_POOL_EVENT_ID_LIFECYCLE
STORAGE_POOL_EVENT_ID_REFRESH

INTERNAL METHODS

_call

This method forwards protocol "calls" to the remote instance. Using this wrapper allows for tracking all calls allowing to set up handling of the replies.

_send

_send_end

_dispatch_message

_dispatch_reply

_dispatch_stream

_domain_migrate_finish

_domain_migrate_finish2

_domain_migrate_prepare_tunnel

_supports_feature

BUGS AND LIMITATIONS

  • Talking to servers without the REMOTE_EVENT_CALLBACK feature (v1.3.3 - 2016-04-06) is not - currently - supported

TODO

  • Sort interaction between connect and auth methods

    Currently, connect always calls auth, which makes having a public auth method rather pointless.

  • Modules implementing connections for various protocols (tcp, tls, etc)

  • @generate: none entrypoints review (and implement relevant ones)

  • @generate: server entrypoints review (and implement relevant ones)

  • libvirt client configuration (/etc/libvirt/libvirt.conf (for root) or $XDG_CONFIG_HOME/libvirt/libvirt.conf (for other users))

UNIMPLEMENTED ENTRYPOINTS

The following entrypoints have not been implemented yet; contributions towards implementation are greatly appreciated.

    • @generate: none

      • REMOTE_PROC_AUTH_SASL_START

      • REMOTE_PROC_AUTH_SASL_STEP

    • @generate: none (include/libvirt/libvirt-domain.h)

      • REMOTE_PROC_DOMAIN_BLOCK_PEEK

      • REMOTE_PROC_DOMAIN_CREATE_WITH_FILES

      • REMOTE_PROC_DOMAIN_CREATE_XML_WITH_FILES

      • REMOTE_PROC_DOMAIN_FD_ASSOCIATE

      • REMOTE_PROC_DOMAIN_GET_BLOCK_JOB_INFO

      • REMOTE_PROC_DOMAIN_GET_EMULATOR_PIN_INFO

      • REMOTE_PROC_DOMAIN_GET_IOTHREAD_INFO

      • REMOTE_PROC_DOMAIN_GET_LAUNCH_SECURITY_INFO

      • REMOTE_PROC_DOMAIN_GET_PERF_EVENTS

      • REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL

      • REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL_LIST

      • REMOTE_PROC_DOMAIN_GET_TIME

      • REMOTE_PROC_DOMAIN_GET_VCPUS

      • REMOTE_PROC_DOMAIN_GET_VCPU_PIN_INFO

      • REMOTE_PROC_DOMAIN_MEMORY_PEEK

      • REMOTE_PROC_DOMAIN_OPEN_GRAPHICS

      • REMOTE_PROC_DOMAIN_OPEN_GRAPHICS_FD

      • REMOTE_PROC_DOMAIN_PIN_EMULATOR

    • @generate: none (include/libvirt/libvirt-host.h)

      • REMOTE_PROC_NODE_ALLOC_PAGES

      • REMOTE_PROC_NODE_GET_CPU_MAP

      • REMOTE_PROC_NODE_GET_FREE_PAGES

      • REMOTE_PROC_NODE_GET_SECURITY_MODEL

    • @generate: none (include/libvirt/libvirt-secret.h)

      • REMOTE_PROC_SECRET_GET_VALUE

    • @generate: none (src/libvirt_internal.h)

      • REMOTE_PROC_DOMAIN_MIGRATE_BEGIN3

      • REMOTE_PROC_DOMAIN_MIGRATE_BEGIN3_PARAMS

      • REMOTE_PROC_DOMAIN_MIGRATE_CONFIRM3

      • REMOTE_PROC_DOMAIN_MIGRATE_CONFIRM3_PARAMS

      • REMOTE_PROC_DOMAIN_MIGRATE_FINISH3

      • REMOTE_PROC_DOMAIN_MIGRATE_FINISH3_PARAMS

      • REMOTE_PROC_DOMAIN_MIGRATE_PERFORM3

      • REMOTE_PROC_DOMAIN_MIGRATE_PERFORM3_PARAMS

      • REMOTE_PROC_DOMAIN_MIGRATE_PREPARE

      • REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2

      • REMOTE_PROC_DOMAIN_MIGRATE_PREPARE3

      • REMOTE_PROC_DOMAIN_MIGRATE_PREPARE3_PARAMS

      • REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL3_PARAMS

    • @generate: server (include/libvirt/libvirt-host.h)

      • REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY

    • @generate: server (include/libvirt/libvirt-nodedev.h)

      • REMOTE_PROC_NODE_DEVICE_DETACH_FLAGS

      • REMOTE_PROC_NODE_DEVICE_DETTACH

      • REMOTE_PROC_NODE_DEVICE_RESET

      • REMOTE_PROC_NODE_DEVICE_RE_ATTACH

    • @generate: server (include/libvirt/libvirt-storage.h)

      • REMOTE_PROC_CONNECT_FIND_STORAGE_POOL_SOURCES

      • REMOTE_PROC_STORAGE_VOL_GET_INFO_FLAGS

    • @generate: server (src/libvirt_internal.h)

      • REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL3

SEE ALSO

LibVirt, Sys::Virt

LICENSE AND COPYRIGHT

Copyright (C) 2024 Erik Huelsmann

All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.