1Sys::Virt(3pm)        User Contributed Perl Documentation       Sys::Virt(3pm)
2
3
4

NAME

6       Sys::Virt - Represent and manage a libvirt hypervisor connection
7

SYNOPSIS

9         my $conn = Sys::Virt->new(uri => $uri);
10
11         my @domains = $conn->list_domains();
12
13         foreach my $dom (@domains) {
14           print "Domain ", $dom->get_id, " ", $dom->get_name, "\n";
15         }
16

DESCRIPTION

18       The Sys::Virt module provides a Perl XS binding to the libvirt virtual
19       machine management APIs. This allows machines running within arbitrary
20       virtualization containers to be managed with a consistent API.
21

CALLBACK HANDLING

23       Each callback registration routine returns a $callbackID (except for
24       "domain_event_register" and "register_close_callback"). This return
25       value must be retained and used for callback deregistration.
26
27       IMPORTANT: All callbacks must be deregistered (including the ones
28       registered using "domain_event_register" and
29       "register_close_callback"); failing to do so prevents the "Sys::Virt"
30       object from being garbage collected and the connection to "libvirtd"
31       from being closed.
32

ERROR HANDLING

34       Any operations in the Sys::Virt API which have failure scenarios will
35       result in an instance of the Sys::Virt::Error module being thrown. To
36       catch these errors, simply wrap the method in an eval block:
37
38         eval { my $conn = Sys::Virt->new(uri => $uri); };
39         if ($@) {
40           print STDERR "Unable to open connection to $addr" . $@->message . "\n";
41         }
42
43       For details of the information contained in the error objects, consult
44       the Sys::Virt::Error manual page.
45

METHODS

47       my $conn = Sys::Virt->new(uri => $uri, readonly => $ro, flags =>
48       $flags);
49           Attach to the virtualization host identified by "uri". The "uri"
50           parameter may be omitted, in which case the default connection made
51           will be to the local Xen hypervisor. Some example URIs include:
52
53           xen:///
54               Xen on the local machine
55
56           test:///default
57               Dummy "in memory" driver for test suites
58
59           qemu:///system
60               System-wide driver for QEMU / KVM virtualization
61
62           qemu:///session
63               Per-user driver for QEMU virtualization
64
65           qemu+tls://somehost/system
66               System-wide QEMU driver on "somehost" using TLS security
67
68           xen+tcp://somehost/
69               Xen driver on "somehost" using TCP / SASL security
70
71           For further details consult "http://libvirt.org/uri.html"
72
73           If the optional "readonly" parameter is supplied, then an
74           unprivileged connection to the hypervisor will be attempted. If it
75           is not supplied, then it defaults to making a fully privileged
76           connection to the hypervisor. If the calling application is not
77           running as root, it may be necessary to provide authentication
78           callbacks.
79
80           If the optional "auth" parameter is set to a non-zero value,
81           authentication will be enabled during connection, using the default
82           set of credential gathering callbacks. The default callbacks prompt
83           for credentials on the console, so are not suitable for graphical
84           applications. For such apps a custom implementation should be
85           supplied. The "credlist" parameter should be an array reference
86           listing the set of credential types that will be supported. The
87           credential constants in this module can be used as values in this
88           list. The "callback" parameter should be a subroutine reference
89           containing the code necessary to gather the credentials. When
90           invoked it will be supplied with a single parameter, an array
91           reference of requested credentials. The elements of the array are
92           hash references, with keys "type" giving the type of credential,
93           "prompt" giving a user descriptive user prompt, "challenge" giving
94           name of the credential required. The answer should be collected
95           from the user, and returned by setting the "result" key. This key
96           may already be set with a default result if applicable
97
98           As a simple example returning hardcoded credentials
99
100               my $uri  = "qemu+tcp://192.168.122.1/system";
101               my $username = "test";
102               my $password = "123456";
103
104               my $con = Sys::Virt->new(uri => $uri,
105                                        auth => 1,
106                                        credlist => [
107                                          Sys::Virt::CRED_AUTHNAME,
108                                          Sys::Virt::CRED_PASSPHRASE,
109                                        ],
110                                        callback =>
111                    sub {
112                          my $creds = shift;
113
114                          foreach my $cred (@{$creds}) {
115                             if ($cred->{type} == Sys::Virt::CRED_AUTHNAME) {
116                                 $cred->{result} = $username;
117                             }
118                             if ($cred->{type} == Sys::Virt::CRED_PASSPHRASE) {
119                                 $cred->{result} = $password;
120                             }
121                          }
122                          return 0;
123                    });
124
125           For backwards compatibility with earlier releases, the "address"
126           parameter is accepted as a synonym for the "uri" parameter. The use
127           of "uri" is recommended for all newly written code.
128
129       $conn->set_identity($identity, $flags=0)
130           Change the identity that is used for access control over the
131           connection. Normally the remote daemon will use the identity
132           associated with the UNIX domain socket that the app opens.  Only a
133           privileged client is usually able to override this.  The $identity
134           should be a hash reference whose keys are one of the IDENTITY
135           constants. The $flags parameter is currently unused, and defaults
136           to 0 if omitted.
137
138       my $st = $conn->new_stream($flags)
139           Create a new stream, with the given flags
140
141       my $dom = $conn->create_domain($xml, $flags=0);
142           Create a new domain based on the XML description passed into the
143           $xml parameter. The returned object is an instance of the
144           Sys::Virt::Domain class. This method is not available with
145           unprivileged connections to the hypervisor. The $flags parameter
146           accepts one of the DOMAIN CREATION constants documented in
147           Sys::Virt::Domain, and defaults to 0 if omitted.
148
149       my $dom = $conn->create_domain_with_files($xml, $fds, $flags=0);
150           Create a new domain based on the XML description passed into the
151           $xml parameter. The returned object is an instance of the
152           Sys::Virt::Domain class. This method is not available with
153           unprivileged connections to the hypervisor. The $fds parameter is
154           an array of UNIX file descriptors which will be passed to the init
155           process of the container. This is only supported with container
156           based virtualization. The $flags parameter accepts one of the
157           DOMAIN CREATION constants documented in Sys::Virt::Domain, and
158           defaults to 0 if omitted.
159
160       my $dom = $conn->define_domain($xml, $flags=0);
161           Defines, but does not start, a new domain based on the XML
162           description passed into the $xml parameter. The returned object is
163           an instance of the Sys::Virt::Domain class. This method is not
164           available with unprivileged connections to the hypervisor. The
165           defined domain can be later started by calling the "create" method
166           on the returned "Sys::Virt::Domain" object. The $flags parameter
167           accepts one of the DOMAIN DEFINE constants documented in
168           Sys::Virt::Domain, and defaults to 0 if omitted.
169
170       my $net = $conn->create_network($xml, $flags=0);
171           Create a new network based on the XML description passed into the
172           $xml parameter. The returned object is an instance of the
173           Sys::Virt::Network class. This method is not available with
174           unprivileged connections to the hypervisor. The $flags parameter
175           accepts one of the NETWORK CREATION constants documented in
176           Sys::Virt::Network, and defaults to 0 if omitted.
177
178       my $net = $conn->define_network($xml, $flags=0);
179           Defines, but does not start, a new network based on the XML
180           description passed into the $xml parameter. The returned object is
181           an instance of the Sys::Virt::Network class. This method is not
182           available with unprivileged connections to the hypervisor. The
183           defined network can be later started by calling the "create" method
184           on the returned "Sys::Virt::Network" object. The $flags parameter
185           accepts one of the NETWORK DEFINE constants documented in
186           Sys::Virt::Network, and defaults to 0 if omitted.
187
188       my $nwfilter = $conn->define_nwfilter($xml, $flags=0);
189           Defines a new network filter based on the XML description passed
190           into the $xml parameter. The returned object is an instance of the
191           Sys::Virt::NWFilter class. This method is not available with
192           unprivileged connections to the hypervisor. The $flags parameter
193           accepts one of the NWFILTER DEFINE constants documented in
194           Sys::Virt::NWFilter, and defaults to 0 if omitted.
195
196       my $binding = $conn->create_nwfilter_binding($xml, $flags=0);
197           Create a new network filter binding based on the XML description
198           passed into the $xml parameter. The returned object is an instance
199           of the Sys::Virt::NWFilterBinding class. The $flags parameter
200           accepts one of the NETWORK FILTER BINDING CREATION constants
201           documented in Sys::Virt::NWFilterBinding, and defaults to 0 if
202           omitted.
203
204       my $secret = $conn->define_secret($xml, $flags=0);
205           Defines a new secret based on the XML description passed into the
206           $xml parameter. The returned object is an instance of the
207           Sys::Virt::Secret class. This method is not available with
208           unprivileged connections to the hypervisor. The $flags parameter
209           accepts one of the SECRET DEFINE constants documented in
210           Sys::Virt::Secret, and defaults to 0 if omitted.
211
212       my $pool = $conn->create_storage_pool($xml);
213           Create a new storage pool based on the XML description passed into
214           the $xml parameter. The returned object is an instance of the
215           Sys::Virt::StoragePool class. This method is not available with
216           unprivileged connections to the hypervisor.
217
218       my $pool = $conn->define_storage_pool($xml, $flags=0);
219           Defines, but does not start, a new storage pol based on the XML
220           description passed into the $xml parameter. The returned object is
221           an instance of the Sys::Virt::StoragePool class. This method is not
222           available with unprivileged connections to the hypervisor. The
223           defined pool can be later started by calling the "create" method on
224           the returned "Sys::Virt::StoragePool" object. The $flags parameter
225           accepts one of the STORAGE POOL DEFINE constants documented in
226           Sys::Virt::StoragePool, and defaults to 0 if omitted.
227
228       my $pool = $conn->create_interface($xml);
229           Create a new interface based on the XML description passed into the
230           $xml parameter. The returned object is an instance of the
231           Sys::Virt::Interface class. This method is not available with
232           unprivileged connections to the hypervisor.
233
234       my $iface = $conn->define_interface($xml, $flags=0);
235           Defines, but does not start, a new interface based on the XML
236           description passed into the $xml parameter. The returned object is
237           an instance of the Sys::Virt::Interface class. This method is not
238           available with unprivileged connections to the hypervisor. The
239           defined interface can be later started by calling the "create"
240           method on the returned "Sys::Virt::Interface" object. The $flags
241           parameter accepts one of the INTERFACE DEFINE constants documented
242           in Sys::Virt::Interface, and defaults to 0 if omitted.
243
244       my $dev = $conn->create_node_device($xml, $flags=0);
245           Create a new virtual node device based on the XML description
246           passed into the $xml parameter. The returned object is an instance
247           of the Sys::Virt::NodeDevice class. This method is not available
248           with unprivileged connections to the hypervisor. The $flags
249           parameter accepts one of the NODE DEVICE CREATION constants
250           documented in Sys::Virt::NodeDevice, and defaults to 0 if omitted.
251
252       my $dev = $conn->define_node_device($xml, $flags=0);
253           Defines, but does not start, a new node dev based on the XML
254           description passed into the $xml parameter. The returned object is
255           an instance of the Sys::Virt::NodeDevice class. This method is not
256           available with unprivileged connections to the hypervisor. The
257           defined node device can be later started by calling the "create"
258           method on the returned "Sys::Virt::NodeDevice" object. The $flags
259           parameter accepts one of the NODE DEVICE DEFINE constants
260           documented in Sys::Virt::NodeDevice, and defaults to 0 if omitted.
261
262       my @doms = $conn->list_domains()
263           Return a list of all running domains currently known to the
264           hypervisor. The elements in the returned list are instances of the
265           Sys::Virt::Domain class. This method requires O(n) RPC calls, so
266           the "list_all_domains" method is recommended as a more efficient
267           alternative.
268
269       my $nids = $conn->num_of_domains()
270           Return the number of running domains known to the hypervisor. This
271           can be used as the "maxids" parameter to "list_domain_ids".
272
273       my @domIDs = $conn->list_domain_ids($maxids)
274           Return a list of all domain IDs currently known to the hypervisor.
275           The IDs can be used with the "get_domain_by_id" method.
276
277       my @doms = $conn->list_defined_domains()
278           Return a list of all domains defined, but not currently running, on
279           the hypervisor. The elements in the returned list are instances of
280           the Sys::Virt::Domain class. This method requires O(n) RPC calls,
281           so the "list_all_domains" method is recommended as a more efficient
282           alternative.
283
284       my $ndoms = $conn->num_of_defined_domains()
285           Return the number of running domains known to the hypervisor. This
286           can be used as the "maxnames" parameter to
287           "list_defined_domain_names".
288
289       my @names = $conn->list_defined_domain_names($maxnames)
290           Return a list of names of all domains defined, but not currently
291           running, on the hypervisor. The names can be used with the
292           "get_domain_by_name" method.
293
294       my @doms = $conn->list_all_domains($flags)
295           Return a list of all domains currently known to the hypervisor,
296           whether running or shutoff. The elements in the returned list are
297           instances of the Sys::Virt::Domain class. The $flags parameter can
298           be used to filter the list of returned domains.
299
300       my @nets = $conn->list_networks()
301           Return a list of all networks currently known to the hypervisor.
302           The elements in the returned list are instances of the
303           Sys::Virt::Network class.  This method requires O(n) RPC calls, so
304           the "list_all_networks" method is recommended as a more efficient
305           alternative.
306
307       my $nnets = $conn->num_of_networks()
308           Return the number of running networks known to the hypervisor. This
309           can be used as the "maxids" parameter to "list_network_ids".
310
311       my @netNames = $conn->list_network_names($maxnames)
312           Return a list of all network names currently known to the
313           hypervisor. The names can be used with the "get_network_by_name"
314           method.
315
316       my @nets = $conn->list_defined_networks()
317           Return a list of all networks defined, but not currently running,
318           on the hypervisor. The elements in the returned list are instances
319           of the Sys::Virt::Network class. This method requires O(n) RPC
320           calls, so the "list_all_networks" method is recommended as a more
321           efficient alternative.
322
323       my $nnets = $conn->num_of_defined_networks()
324           Return the number of running networks known to the host. This can
325           be used as the "maxnames" parameter to
326           "list_defined_network_names".
327
328       my @names = $conn->list_defined_network_names($maxnames)
329           Return a list of names of all networks defined, but not currently
330           running, on the host. The names can be used with the
331           "get_network_by_name" method.
332
333       my @nets = $conn->list_all_networks($flags)
334           Return a list of all networks currently known to the hypervisor,
335           whether running or shutoff. The elements in the returned list are
336           instances of the Sys::Virt::Network class. The $flags parameter can
337           be used to filter the list of returned networks.
338
339       my @pools = $conn->list_storage_pools()
340           Return a list of all storage pools currently known to the host. The
341           elements in the returned list are instances of the
342           Sys::Virt::StoragePool class.  This method requires O(n) RPC calls,
343           so the "list_all_storage_pools" method is recommended as a more
344           efficient alternative.
345
346       my $npools = $conn->num_of_storage_pools()
347           Return the number of running storage pools known to the hypervisor.
348           This can be used as the "maxids" parameter to
349           "list_storage_pool_names".
350
351       my @poolNames = $conn->list_storage_pool_names($maxnames)
352           Return a list of all storage pool names currently known to the
353           hypervisor. The IDs can be used with the "get_network_by_id"
354           method.
355
356       my @pools = $conn->list_defined_storage_pools()
357           Return a list of all storage pools defined, but not currently
358           running, on the host. The elements in the returned list are
359           instances of the Sys::Virt::StoragePool class. This method requires
360           O(n) RPC calls, so the "list_all_storage_pools" method is
361           recommended as a more efficient alternative.
362
363       my $npools = $conn->num_of_defined_storage_pools()
364           Return the number of running networks known to the host. This can
365           be used as the "maxnames" parameter to
366           "list_defined_storage_pool_names".
367
368       my @names = $conn->list_defined_storage_pool_names($maxnames)
369           Return a list of names of all storage pools defined, but not
370           currently running, on the host. The names can be used with the
371           "get_storage_pool_by_name" method.
372
373       my @pools = $conn->list_all_storage_pools($flags)
374           Return a list of all storage pools currently known to the
375           hypervisor, whether running or shutoff. The elements in the
376           returned list are instances of the Sys::Virt::StoragePool class.
377           The $flags parameter can be used to filter the list of returned
378           pools.
379
380       my @devs = $conn->list_node_devices($capability)
381           Return a list of all devices currently known to the host OS. The
382           elements in the returned list are instances of the
383           Sys::Virt::NodeDevice class.  The optional "capability" parameter
384           allows the list to be restricted to only devices with a particular
385           capability type. This method requires O(n) RPC calls, so the
386           "list_all_node_devices" method is recommended as a more efficient
387           alternative.
388
389       my $ndevs = $conn->num_of_node_devices($capability[, $flags])
390           Return the number of host devices known to the hypervisor. This can
391           be used as the "maxids" parameter to "list_node_device_names".  The
392           "capability" parameter allows the list to be restricted to only
393           devices with a particular capability type, and should be left as
394           "undef" if the full list is required. The optional <flags>
395           parameter is currently unused and defaults to 0 if omitted.
396
397       my @devNames = $conn->list_node_device_names($capability, $maxnames[,
398       $flags])
399           Return a list of all host device names currently known to the
400           hypervisor. The names can be used with the
401           "get_node_device_by_name" method.  The "capability" parameter
402           allows the list to be restricted to only devices with a particular
403           capability type, and should be left as "undef" if the full list is
404           required. The optional <flags> parameter is currently unused and
405           defaults to 0 if omitted.
406
407       my @devs = $conn->list_all_node_devices($flags)
408           Return a list of all node devices currently known to the
409           hypervisor. The elements in the returned list are instances of the
410           Sys::Virt::NodeDevice class. The $flags parameter can be used to
411           filter the list of returned devices.
412
413       my @ifaces = $conn->list_interfaces()
414           Return a list of all network interfaces currently known to the
415           hypervisor. The elements in the returned list are instances of the
416           Sys::Virt::Interface class.  This method requires O(n) RPC calls,
417           so the "list_all_interfaces" method is recommended as a more
418           efficient alternative.
419
420       my $nifaces = $conn->num_of_interfaces()
421           Return the number of running interfaces known to the hypervisor.
422           This can be used as the "maxnames" parameter to
423           "list_interface_names".
424
425       my @names = $conn->list_interface_names($maxnames)
426           Return a list of all interface names currently known to the
427           hypervisor. The names can be used with the "get_interface_by_name"
428           method.
429
430       my @ifaces = $conn->list_defined_interfaces()
431           Return a list of all network interfaces currently known to the
432           hypervisor. The elements in the returned list are instances of the
433           Sys::Virt::Interface class.  This method requires O(n) RPC calls,
434           so the "list_all_interfaces" method is recommended as a more
435           efficient alternative.
436
437       my $nifaces = $conn->num_of_defined_interfaces()
438           Return the number of inactive interfaces known to the hypervisor.
439           This can be used as the "maxnames" parameter to
440           "list_defined_interface_names".
441
442       my @names = $conn->list_defined_interface_names($maxnames)
443           Return a list of inactive interface names currently known to the
444           hypervisor. The names can be used with the "get_interface_by_name"
445           method.
446
447       my @ifaces = $conn->list_all_interfaces($flags)
448           Return a list of all interfaces currently known to the hypervisor,
449           whether running or shutoff. The elements in the returned list are
450           instances of the Sys::Virt::Interface class. The $flags parameter
451           can be used to filter the list of returned interfaces.
452
453       my @ifaces = $conn->list_secrets()
454           Return a list of all secrets currently known to the hypervisor. The
455           elements in the returned list are instances of the
456           Sys::Virt::Secret class.  This method requires O(n) RPC calls, so
457           the "list_all_secrets" method is recommended as a more efficient
458           alternative.
459
460       my $nuuids = $conn->num_of_secrets()
461           Return the number of secrets known to the hypervisor. This can be
462           used as the "maxuuids" parameter to "list_secrets".
463
464       my @uuids = $conn->list_secret_uuids($maxuuids)
465           Return a list of all secret uuids currently known to the
466           hypervisor. The uuids can be used with the "get_secret_by_uuid"
467           method.
468
469       my @secrets = $conn->list_all_secrets($flags)
470           Return a list of all secrets currently known to the hypervisor. The
471           elements in the returned list are instances of the
472           Sys::Virt::Network class.  The $flags parameter can be used to
473           filter the list of returned secrets.
474
475       my @nwfilters = $conn->list_nwfilters()
476           Return a list of all nwfilters currently known to the hypervisor.
477           The elements in the returned list are instances of the
478           Sys::Virt::NWFilter class.  This method requires O(n) RPC calls, so
479           the "list_all_nwfilters" method is recommended as a more efficient
480           alternative.
481
482       my $nnwfilters = $conn->num_of_nwfilters()
483           Return the number of running nwfilters known to the hypervisor.
484           This can be used as the "maxids" parameter to
485           "list_nwfilter_names".
486
487       my @filterNames = $conn->list_nwfilter_names($maxnames)
488           Return a list of all nwfilter names currently known to the
489           hypervisor. The names can be used with the "get_nwfilter_by_name"
490           method.
491
492       my @nwfilters = $conn->list_all_nwfilters($flags)
493           Return a list of all nwfilters currently known to the hypervisor.
494           The elements in the returned list are instances of the
495           Sys::Virt::NWFilter class.  The $flags parameter is currently
496           unused and defaults to zero.
497
498       my @bindings = $conn->list_all_nwfilter_bindings($flags)
499           Return a list of all nwfilter bindings currently known to the
500           hypervisor. The elements in the returned list are instances of the
501           Sys::Virt::NWFilterBinding class. The $flags parameter is currently
502           unused and defaults to zero.
503
504       $conn->define_save_image_xml($file, $dxml, $flags=0)
505           Update the XML associated with a virtual machine's save image. The
506           $file parameter is the fully qualified path to the save image XML,
507           while $dxml is the new XML document to write. The $flags parameter
508           is currently unused and defaults to zero.
509
510       $xml = $conn->get_save_image_xml_description($file, $flags=1)
511           Retrieve the current XML configuration associated with the virtual
512           machine's save image identified by $file. The $flags parameter
513           accepts the same constants as
514           "Sys::Virt::Domain::managed_save_get_xml_description".
515
516       my $dom = $conn->get_domain_by_name($name)
517           Return the domain with a name of $name. The returned object is an
518           instance of the Sys::Virt::Domain class.
519
520       my $dom = $conn->get_domain_by_id($id)
521           Return the domain with a local id of $id. The returned object is an
522           instance of the Sys::Virt::Domain class.
523
524       my $dom = $conn->get_domain_by_uuid($uuid)
525           Return the domain with a globally unique id of $uuid. The returned
526           object is an instance of the Sys::Virt::Domain class.
527
528       my $net = $conn->get_network_by_name($name)
529           Return the network with a name of $name. The returned object is an
530           instance of the Sys::Virt::Network class.
531
532       my $net = $conn->get_network_by_uuid($uuid)
533           Return the network with a globally unique id of $uuid. The returned
534           object is an instance of the Sys::Virt::Network class.
535
536       my $pool = $conn->get_storage_pool_by_name($name)
537           Return the storage pool with a name of $name. The returned object
538           is an instance of the Sys::Virt::StoragePool class.
539
540       my $pool = $conn->get_storage_pool_by_uuid($uuid)
541           Return the storage pool with a globally unique id of $uuid. The
542           returned object is an instance of the Sys::Virt::StoragePool class.
543
544       my $pool = $conn->get_storage_pool_by_volume($vol)
545           Return the storage pool with a storage volume $vol. The $vol
546           parameter must be an instance of the Sys::Virt::StorageVol class.
547           The returned object is an instance of the Sys::Virt::StoragePool
548           class.
549
550       my $pool = $conn->get_storage_pool_by_target_path($path)
551           Return the storage pool with a target path of $path. The returned
552           object is an instance of the Sys::Virt::StoragePool class.
553
554       my $vol = $conn->get_storage_volume_by_path($path)
555           Return the storage volume with a location of $path. The returned
556           object is an instance of the Sys::Virt::StorageVol class.
557
558       my $vol = $conn->get_storage_volume_by_key($key)
559           Return the storage volume with a globally unique id of $key. The
560           returned object is an instance of the Sys::Virt::StorageVol class.
561
562       my $dev = $conn->get_node_device_by_name($name)
563           Return the node device with a name of $name. The returned object is
564           an instance of the Sys::Virt::NodeDevice class.
565
566       my $dev = $conn->get_node_device_scsihost_by_wwn($wwnn, $wwpn,
567       $flags=0)
568           Return the node device which is a SCSI host identified by $wwnn and
569           $wwpn.  The $flags parameter is unused and defaults to zero.  The
570           returned object is an instance of the Sys::Virt::NodeDevice class.
571
572       my $iface = $conn->get_interface_by_name($name)
573           Return the interface with a name of $name. The returned object is
574           an instance of the Sys::Virt::Interface class.
575
576       my $iface = $conn->get_interface_by_mac($mac)
577           Return the interface with a MAC address of $mac. The returned
578           object is an instance of the Sys::Virt::Interface class.
579
580       my $sec = $conn->get_secret_by_uuid($uuid)
581           Return the secret with a globally unique id of $uuid. The returned
582           object is an instance of the Sys::Virt::Secret class.
583
584       my $sec = $conn->get_secret_by_usage($usageType, $usageID)
585           Return the secret with a usage type of $usageType, identified by
586           $usageID. The returned object is an instance of the
587           Sys::Virt::Secret class.
588
589       my $nwfilter = $conn->get_nwfilter_by_name($name)
590           Return the domain with a name of $name. The returned object is an
591           instance of the Sys::Virt::NWFilter class.
592
593       my $nwfilter = $conn->get_nwfilter_by_uuid($uuid)
594           Return the nwfilter with a globally unique id of $uuid. The
595           returned object is an instance of the Sys::Virt::NWFilter class.
596
597       my $binding = $conn->get_nwfilter_binding_by_port_dev($name)
598           Return the network filter binding for the port device $name. The
599           returned object is an instance of the Sys::Virt::NWFilterBinding
600           class.
601
602       my $xml = $conn->find_storage_pool_sources($type, $srcspec[, $flags])
603           Probe for available storage pool sources for the pool of type
604           $type.  The $srcspec parameter can be "undef", or a parameter to
605           refine the discovery process, for example a server hostname for NFS
606           discovery. The $flags parameter is optional, and if omitted
607           defaults to zero. The returned scalar is an XML document describing
608           the discovered storage pool sources.
609
610       my @stats = $conn->get_all_domain_stats($stats, \@doms=undef,
611       $flags=0);
612           Get a list of all statistics for domains known to the hypervisor.
613           The $stats parameter controls which data fields to return and
614           should be a combination of the DOMAIN STATS FIELD CONSTANTS.
615
616           The optional @doms parameter is a list of Sys::Virt::Domain objects
617           to return stats for. If this is undefined, then all domains will be
618           returned. The $flags method can be used to filter the list of
619           returned domains.
620
621           The return data for the method is a list, one element for each
622           domain.  The element will be a hash with two keys, "dom" pointing
623           to an instance of "Sys::Virt::Domain" and "data" pointing to
624           another hash reference containing the actual statistics.
625
626       $conn->interface_change_begin($flags)
627           Begin a transaction for changing the configuration of one or more
628           network interfaces
629
630       $conn->interface_change_commit($flags)
631           Complete a transaction for changing the configuration of one or
632           more network interfaces
633
634       $conn->interface_change_rollback($flags)
635           Abort a transaction for changing the configuration of one or more
636           network interfaces
637
638       $conn->restore_domain($savefile, $dxml=undef, $params=undef, $flags=0)
639           Recreate a domain from the saved state file given in the $savefile
640           parameter. The optional $dxml parameter can be used to alter
641           portions of the domain XML. The $params parameter is a hash
642           reference whose keys is a subset of the SAVE / RESTORE PARAMETER
643           CONSTANTS. The $flags parameter accepts one of the SAVE / RESTORE
644           FLAG CONSTANTS described later and defaults to zero.
645
646       $conn->get_max_vcpus($domtype)
647           Return the maximum number of vcpus that can be configured for a
648           domain of type $domtype
649
650       my $hostname = $conn->get_hostname()
651           Return the name of the host with which this connection is
652           associated.
653
654       my $uri = $conn->get_uri()
655           Return the URI associated with the open connection. This may be
656           different from the URI used when initially connecting to libvirt,
657           when 'auto-probing' or drivers occurs.
658
659       my $xml = $conn->get_sysinfo()
660           Return an XML documenting representing the host system information,
661           typically obtained from SMBIOS tables.
662
663       my $type = $conn->get_type()
664           Return the type of virtualization backend accessed by this
665           hypervisor object. Currently the only supported type is "Xen".
666
667       my $xml = $conn->domain_xml_from_native($format, $config);
668           Convert the native hypervisor configuration $config which is in
669           format <$format> into libvirrt domain XML. Valid values of $format
670           vary between hypervisor drivers.
671
672       my $config = $conn->domain_xml_to_native($format, $xml)
673           Convert the libvirt domain XML configuration $xml to a native
674           hypervisor configuration in format $format
675
676       my $ver = $conn->get_version()
677           Return the complete version number as a string encoded in the
678           formula "(major * 1000000) + (minor * 1000) + micro".
679
680       my $ver = $conn->get_major_version
681           Return the major version number of the libvirt library.
682
683       my $ver = $conn->get_minor_version
684           Return the minor version number of the libvirt library.
685
686       my $ver = $conn->get_micro_version
687           Return the micro version number of the libvirt library.
688
689       my $ver = $conn->get_library_version
690           Return the version number of the API associated with the active
691           connection. This differs from "get_version" in that if the
692           connection is to a remote libvirtd daemon, it will return the API
693           version of the remote libvirt, rather than the local client.
694
695       $conn->is_secure()
696           Returns a true value if the current connection is secure against
697           network interception. This implies either use of UNIX sockets, or
698           encryption with a TCP stream.
699
700       $conn->is_encrypted()
701           Returns a true value if the current connection data stream is
702           encrypted.
703
704       $conn->is_alive()
705           Returns a true value if the connection is alive, as determined by
706           keep-alive packets or other recent RPC traffic.
707
708       $conn->set_keep_alive($interval, $count)
709           Change the operation of the keep alive protocol to send $count
710           packets spaced $interval seconds apart before considering the
711           connection dead.
712
713       my $info = $con->get_node_info()
714           Returns a hash reference summarising the capabilities of the host
715           node. The elements of the hash are as follows:
716
717           memory
718               The amount of physical memory in the host
719
720           model
721               The model of the CPU, eg x86_64
722
723           cpus
724               The total number of logical CPUs.
725
726           mhz The peak MHZ of the CPU
727
728           nodes
729               The number of NUMA cells
730
731           sockets
732               The number of CPU sockets
733
734           cores
735               The number of cores per socket
736
737           threads
738               The number of threads per core
739
740           NB, more accurate information about the total number of CPUs and
741           those online can be obtained using the "get_node_cpu_map" method.
742
743       my ($totcpus, $onlinemap, $totonline) = $con->get_node_cpu_map();
744           Returns an array containing information about the CPUs available on
745           the host. The first element, "totcpus", specifies the total number
746           of CPUs available to the host regardless of their online stat. The
747           second element, "onlinemap", provides a bitmap detailing which CPUs
748           are currently online. The third element, "totonline", specifies the
749           total number of online CPUs. The values in the bitmap can be
750           extracted using the "unpack" method as follows:
751
752             my @onlinemap = split(//, unpack("b*", $onlinemap));
753
754       my $info = $con->get_node_cpu_stats($cpuNum=-1, $flags=0)
755           Returns a hash reference providing information about the host CPU
756           statistics. If <$cpuNum> is omitted, it defaults to
757           "Sys::Virt::NODE_CPU_STATS_ALL_CPUS" which causes it to return
758           cumulative information for all CPUs in the host. If $cpuNum is zero
759           or larger, it returns information just for the specified number.
760           The $flags parameter is currently unused and defaults to zero. The
761           fields in the returned hash reference are
762
763           kernel
764               The time spent in kernelspace
765
766           user
767               The time spent in userspace
768
769           idle
770               The idle time
771
772           iowait
773               The I/O wait time
774
775           utilization
776               The overall percentage utilization.
777
778       my $info = $con->get_node_memory_stats($cellNum=-1, $flags=0)
779           Returns a hash reference providing information about the host
780           memory statistics. If <$cellNum> is omitted, it defaults to
781           "Sys::Virt::NODE_MEMORY_STATS_ALL_CELLS" which causes it to return
782           cumulative information for all NUMA cells in the host. If $cellNum
783           is zero or larger, it returns information just for the specified
784           number. The $flags parameter is currently unused and defaults to
785           zero. The fields in the returned hash reference are
786
787           total
788               The total memory
789
790           free
791               The free memory
792
793           buffers
794               The memory consumed by buffers
795
796           cached
797               The memory consumed for cache
798
799       my $params = $conn->get_node_memory_parameters($flags=0)
800           Return a hash reference containing the set of memory tunable
801           parameters for the node. The keys in the hash are one of the
802           constants MEMORY PARAMETERS described later. The $flags parameter
803           is currently unused, and defaults to 0 if omitted.
804
805       $conn->set_node_memory_parameters($params, $flags=0)
806           Update the memory tunable parameters for the node. The $params
807           should be a hash reference whose keys are one of the MEMORY
808           PARAMETERS constants. The $flags parameter is currently unused, and
809           defaults to 0 if omitted.
810
811       $info = $conn->get_node_sev_info($flags=0)
812           Get the AMD SEV information for the host. $flags is currently
813           unused and defaults to 0 if omitted. The returned hash contains the
814           following keys:
815
816           Sys::Virt::SEV_CBITPOS
817               The CBit position
818
819           Sys::Virt::SEV_CERT_CHAIN
820               The certificate chain
821
822           Sys::Virt::SEV_PDH
823               Platform diffie-hellman key
824
825           Sys::Virt::SEV_REDUCED_PHYS_BITS
826               The number of physical address bits used by SEV
827
828           Sys::Virt::SEV_MAX_GUESTS
829               Maximum number of SEV guests that can be launched
830
831           Sys::Virt::SEV_MAX_ES_GUESTS
832               Maximum number of SEV-ES guests that can be launched
833
834           Sys::Virt::SEV_CPU0_ID
835               The SEV firmware ID for CPU 0
836
837       $conn->node_suspend_for_duration($target, $duration, $flags=0)
838           Suspend the the host, using mode $target which is one of the NODE
839           SUSPEND constants listed later. The $duration parameter controls
840           how long the node is suspended for before waking up.
841
842       $conn->domain_event_register($callback)
843           Register a callback to received notifications of domain state
844           change events. Only a single callback can be registered with each
845           connection instance. The callback will be invoked with four
846           parameters, an instance of "Sys::Virt" for the connection, an
847           instance of "Sys::Virt::Domain" for the domain changing state, and
848           a "event" and "detail" arguments, corresponding to the event
849           constants defined in the "Sys::Virt::Domain" module. Before
850           discarding the connection object, the callback must be
851           deregistered, otherwise the connection object memory will never be
852           released in garbage collection.
853
854       $conn->domain_event_deregister()
855           Unregister a callback, allowing the connection object to be garbage
856           collected.
857
858       $callbackID = $conn->domain_event_register_any($dom, $eventID,
859       $callback)
860           Register a callback to received notifications of domain events.
861           The $dom parameter can be "undef" to request events on all known
862           domains, or a specific "Sys::Virt::Domain" object to filter events.
863           The $eventID parameter is one of the EVENT ID constants described
864           later in this document. The $callback is a subroutine reference
865           that will receive the events.
866
867           All callbacks receive a "Sys::Virt" connection as the first
868           parameter and a "Sys::Virt::Domain" object indicating the domain on
869           which the event occurred as the second parameter. Subsequent
870           parameters vary according to the event type
871
872           EVENT_ID_LIFECYCLE
873               Extra "event" and "detail" parameters defining the lifecycle
874               transition that occurred.
875
876           EVENT_ID_REBOOT
877               No extra parameters
878
879           EVENT_ID_RTC_CHANGE
880               The "utcoffset" gives the offset from UTC in seconds
881
882           EVENT_ID_WATCHDOG
883               The "action" defines the action that is taken as a result of
884               the watchdog triggering. One of the WATCHDOG constants
885               described later
886
887           EVENT_ID_IO_ERROR
888               The "srcPath" is the file on the host which had the error.  The
889               "devAlias" is the unique device alias from the guest
890               configuration associated with "srcPath". The "action" is the
891               action taken as a result of the error, one of the IO ERROR
892               constants described later
893
894           EVENT_ID_GRAPHICS
895               The "phase" is the stage of the connection, one of the GRAPHICS
896               PHASE constants described later. The "local" and "remote"
897               parameters follow with the details of the local and remote
898               network addresses. The "authScheme" describes how the user was
899               authenticated (if at all). Finally "identities" is an array ref
900               containing authenticated identities for the user, if any.
901
902           The return value is a unique callback ID that must be used when
903           unregistering the event.
904
905       $conn->domain_event_deregister_any($callbackID)
906           Unregister a callback, associated with the $callbackID previously
907           obtained from "domain_event_register_any".
908
909       $callbackID = $conn->network_event_register_any($net, $eventID,
910       $callback)
911           Register a callback to received notifications of network events.
912           The $net parameter can be "undef" to request events on all known
913           networks, or a specific "Sys::Virt::Network" object to filter
914           events. The $eventID parameter is one of the EVENT ID constants
915           described later in this document. The $callback is a subroutine
916           reference that will receive the events.
917
918           All callbacks receive a "Sys::Virt" connection as the first
919           parameter and a "Sys::Virt::Network" object indicating the network
920           on which the event occurred as the second parameter. Subsequent
921           parameters vary according to the event type
922
923           EVENT_ID_LIFECYCLE
924               Extra "event" and "detail" parameters defining the lifecycle
925               transition that occurred.
926
927           The return value is a unique callback ID that must be used when
928           unregistering the event.
929
930       $conn->network_event_deregister_any($callbackID)
931           Unregister a callback, associated with the $callbackID previously
932           obtained from "network_event_register_any".
933
934       $callbackID = $conn->storage_pool_event_register_any($pool, $eventID,
935       $callback)
936           Register a callback to received notifications of storage pool
937           events.  The $pool parameter can be "undef" to request events on
938           all known storage pools, or a specific "Sys::Virt::StoragePool"
939           object to filter events. The $eventID parameter is one of the EVENT
940           ID constants described later in this document. The $callback is a
941           subroutine reference that will receive the events.
942
943           All callbacks receive a "Sys::Virt" connection as the first
944           parameter and a "Sys::Virt::StoragePool" object indicating the
945           storage pool on which the event occurred as the second parameter.
946           Subsequent parameters vary according to the event type
947
948           EVENT_ID_LIFECYCLE
949               Extra "event" and "detail" parameters defining the lifecycle
950               transition that occurred.
951
952           EVENT_ID_REFRESH
953               No extra parameters.
954
955           The return value is a unique callback ID that must be used when
956           unregistering the event.
957
958       $conn->storage_pool_event_deregister_any($callbackID)
959           Unregister a callback, associated with the $callbackID previously
960           obtained from "storage_pool_event_register_any".
961
962       $callbackID = $conn->node_device_event_register_any($dev, $eventID,
963       $callback)
964           Register a callback to received notifications of node device
965           events.  The $dev parameter can be "undef" to request events on all
966           known node devices, or a specific "Sys::Virt::NodeDevice" object to
967           filter events. The $eventID parameter is one of the EVENT ID
968           constants described later in this document. The $callback is a
969           subroutine reference that will receive the events.
970
971           All callbacks receive a "Sys::Virt" connection as the first
972           parameter and a "Sys::Virt::NodeDevice" object indicating the node
973           device on which the event occurred as the second parameter.
974           Subsequent parameters vary according to the event type
975
976           EVENT_ID_LIFECYCLE
977               Extra "event" and "detail" parameters defining the lifecycle
978               transition that occurred.
979
980           The return value is a unique callback ID that must be used when
981           unregistering the event.
982
983       $conn->node_device_event_deregister_any($callbackID)
984           Unregister a callback, associated with the $callbackID previously
985           obtained from "node_device_event_register_any".
986
987       $callbackID = $conn->secret_event_register_any($secret, $eventID,
988       $callback)
989           Register a callback to received notifications of secret events.
990           The $secret parameter can be "undef" to request events on all known
991           secrets, or a specific "Sys::Virt::Secret" object to filter events.
992           The $eventID parameter is one of the EVENT ID constants described
993           later in this document. The $callback is a subroutine reference
994           that will receive the events.
995
996           All callbacks receive a "Sys::Virt" connection as the first
997           parameter and a "Sys::Virt::Secret" object indicating the secret on
998           which the event occurred as the second parameter. Subsequent
999           parameters vary according to the event type
1000
1001           EVENT_ID_LIFECYCLE
1002               Extra "event" and "detail" parameters defining the lifecycle
1003               transition that occurred.
1004
1005           EVENT_ID_VALUE_CHANGED
1006               No extra parameters.
1007
1008           The return value is a unique callback ID that must be used when
1009           unregistering the event.
1010
1011       $conn->secret_event_deregister_any($callbackID)
1012           Unregister a callback, associated with the $callbackID previously
1013           obtained from "secret_event_register_any".
1014
1015       $conn->register_close_callback($coderef);
1016           Register a callback to be invoked when the connection is closed.
1017           The callback will be invoked with two parameters, the $conn it was
1018           registered against, and the reason for the close event.  The reason
1019           value will be one of the "CLOSE REASON CONSTANTS" listed later in
1020           this document.
1021
1022       $conn->unregister_close_callback();
1023           Remove the previously registered close callback.
1024
1025       my $xml = $con->baseline_cpu(\@xml, $flags=0)
1026           Given an array ref whose elements are XML documents describing host
1027           CPUs, compute the baseline CPU model that is operable across all
1028           hosts. The XML for the baseline CPU model is returned. The optional
1029           $flags parameter can take one of
1030
1031           Sys::Virt::BASELINE_CPU_EXPAND_FEATURES
1032               Expand the CPU definition to list all feature flags, even those
1033               implied by the model name.
1034
1035           Sys::Virt::BASELINE_CPU_MIGRATABLE
1036               Only include features which can be live migrated.
1037
1038       my $xml = $con->baseline_hypervisor_cpu($emulator, $arch, $machine,
1039       $virttype, \@xml, $flags=0)
1040           Given an array ref whose elements are XML documents describing host
1041           CPUs, compute the baseline CPU model that is operable across all
1042           hosts. The XML for the baseline CPU model is returned. Either
1043           $emulator or $arch must be a valid string referring to an emulator
1044           binary or an architecture name respectively. The $machine parameter
1045           is an optional name of a guest machine, and $virttype is an
1046           optional name of the virtualization type. The optional $flags
1047           parameter accepts the same values as "baseline_cpu".
1048
1049       @names = $con->get_cpu_model_names($arch, $flags=0)
1050           Get a list of valid CPU models names for the architecture given by
1051           $arch. The $arch value should be one of the architectures listed in
1052           the capabilities XML document.  The $flags parameter is currently
1053           unused and defaults to 0.
1054
1055       my $info = $con->get_node_security_model()
1056           Returns a hash reference summarising the security model of the host
1057           node. There are two keys in the hash, "model" specifying the name
1058           of the security model (eg 'selinux') and "doi" specifying the
1059           'domain of interpretation' for security labels.
1060
1061       my $xml = $con->get_capabilities();
1062           Returns an XML document describing the hypervisor capabilities
1063
1064       my $xml = $con->get_domain_capabilities($emulator, $arch, $machine,
1065       $virttype, flags=0);
1066           Returns an XML document describing the capabilities of the
1067           requested guest configuration. Either $emulator or $arch must be a
1068           valid string referring to an emulator binary or an architecture
1069           name respectively. The $machine parameter is an optional name of a
1070           guest machine, and $virttype is an optional name of the
1071           virtualization type. $flags is unused and defaults to zero.
1072
1073       my $xml = $con->get_storage_pool_capabilities($flags=0);
1074           Returns an XML document describing the storage pool driver
1075           capabilities (e.g. which storage pool types are supported and so
1076           on). $flags is currently unused and defaults to zero.
1077
1078       my $result = $con->compare_cpu($xml, $flags=0);
1079           Checks whether the CPU definition in $xml is compatible with the
1080           current hypervisor connection. This can be used to determine
1081           whether it is safe to migrate a guest to this host. The returned
1082           result is one of the constants listed later The optional $flags
1083           parameter can take one of the following constants
1084
1085           Sys::Virt::COMPARE_CPU_FAIL_INCOMPATIBLE
1086               Raise a fatal error if the CPUs are not compatible, instead of
1087               just returning a special error code.
1088
1089           Sys::Virt::COMPARE_CPU_VALIDATE_XML
1090               Validate input XML document against the RNG schema.
1091
1092       my $result = $con->compare_hypervisor_cpu($emulator, $arch, $machine,
1093       $virttype, $xml, $flags=0);
1094           Checks whether the CPU definition in $xml is compatible with the
1095           current hypervisor connection. This can be used to determine
1096           whether it is safe to migrate a guest to this host. Either
1097           $emulator or $arch must be a valid string referring to an emulator
1098           binary or an architecture name respectively. The $machine parameter
1099           is an optional name of a guest machine, and $virttype is an
1100           optional name of the virtualization type. The returned result is
1101           one of the constants listed later The optional $flags parameter can
1102           take the same values as the "compare_cpu" method.
1103
1104       $mem = $con->get_node_free_memory();
1105           Returns the current free memory on the host
1106
1107       @mem = $con->get_node_cells_free_memory($start, $end);
1108           Returns the free memory on each NUMA cell between $start and $end.
1109
1110       @pages = $con->get_node_free_pages(\@pagesizes, $start, $end);
1111           Returns information about the number of pages free on each NUMA
1112           cell between $start and $end inclusive. The @pagesizes parameter
1113           should be an arrayref specifying which pages sizes information
1114           should be returned for. Information about supported page sizes is
1115           available in the capabilities XML. The returned array has an
1116           element for each NUMA cell requested. The elements are hash
1117           references with two keys, 'cell' specifies the NUMA cell number and
1118           'pages' specifies the free page information for that cell. The
1119           'pages' value is another hash reference where the keys are the page
1120           sizes and the values are the free count for that size.
1121
1122       $con->node_alloc_pages(\@pages, $start, $end, $flags=0)
1123           Allocate further huge pages for the reserved dev. The <\@pages>
1124           parameter is an array reference with one entry per page size to
1125           allocate for. Each entry is a further array reference where the
1126           first element is the page size and the second element is the page
1127           count. The same number of pages will be allocated on each NUMA node
1128           in the range $start to $end inclusive. The $flags parameter accepts
1129           two constants
1130
1131           Sys::Virt::NODE_ALLOC_PAGES_ADD
1132               The requested number of pages will be added to the existing
1133               huge page reservation.
1134
1135           Sys::Virt::NODE_ALLOC_PAGES_SET
1136               The huge page reservation will be set to exactly the requested
1137               number
1138

CONSTANTS

1140       The following sets of constants are useful when dealing with APIs in
1141       this package
1142
1143   CONNECTION
1144       When opening a connection the following constants can be used:
1145
1146       Sys::Virt::CONNECT_RO
1147           Request a read-only connection
1148
1149       Sys::Virt::CONNECT_NO_ALIASES
1150           Prevent the resolution of URI aliases
1151
1152   CREDENTIAL TYPES
1153       When providing authentication callbacks, the following constants
1154       indicate the type of credential being requested
1155
1156       Sys::Virt::CRED_AUTHNAME
1157           Identity to act as
1158
1159       Sys::Virt::CRED_USERNAME
1160           Identity to authorize as
1161
1162       Sys::Virt::CRED_CNONCE
1163           Client supplies a nonce
1164
1165       Sys::Virt::CRED_REALM
1166           Authentication realm
1167
1168       Sys::Virt::CRED_ECHOPROMPT
1169           Challenge response non-secret
1170
1171       Sys::Virt::CRED_NOECHOPROMPT
1172           Challenge response secret
1173
1174       Sys::Virt::CRED_PASSPHRASE
1175           Passphrase secret
1176
1177       Sys::Virt::CRED_LANGUAGE
1178           RFC 1766 language code
1179
1180       Sys::Virt::CRED_EXTERNAL
1181           Externally provided credential
1182
1183   IDENTITY CONSTANTS
1184       The following constants are useful to change the connection identity
1185
1186       Sys::Virt::IDENTITY_USER_NAME
1187           The process user name
1188
1189       Sys::Virt::IDENTITY_UNIX_USER_ID
1190           The process UNIX user ID
1191
1192       Sys::Virt::IDENTITY_GROUP_NAME
1193           The process group name
1194
1195       Sys::Virt::IDENTITY_UNIX_GROUP_ID
1196           The process UNIX group ID
1197
1198       Sys::Virt::IDENTITY_PROCESS_ID
1199           The process ID.
1200
1201       Sys::Virt::IDENTITY_PROCESS_TIME
1202           The process start time.
1203
1204       Sys::Virt::IDENTITY_SASL_USER_NAME
1205           The SASL authenticated user name
1206
1207       Sys::Virt::IDENTITY_X509_DISTINGUISHED_NAME
1208           The X509 certificate distinguished name for the TLS connection
1209
1210       Sys::Virt::IDENTITY_SELINUX_CONTEXT
1211           The SELinux process context
1212
1213   CPU COMPARISON CONSTANTS
1214       Sys::Virt::CPU_COMPARE_INCOMPATIBLE
1215           This host is missing one or more CPU features in the CPU
1216           description
1217
1218       Sys::Virt::CPU_COMPARE_IDENTICAL
1219           The host has an identical CPU description
1220
1221       Sys::Virt::CPU_COMPARE_SUPERSET
1222           The host offers a superset of the CPU descriptoon
1223
1224   NODE SUSPEND CONSTANTS
1225       Sys::Virt::NODE_SUSPEND_TARGET_MEM
1226           Suspends to memory (equivalent of S3 on x86 architectures)
1227
1228       Sys::Virt::NODE_SUSPEND_TARGET_DISK
1229           Suspends to disk (equivalent of S5 on x86 architectures)
1230
1231       Sys::Virt::NODE_SUSPEND_TARGET_HYBRID
1232           Suspends to memory and disk (equivalent of S3+S5 on x86
1233           architectures)
1234
1235   NODE VCPU CONSTANTS
1236       Sys::Virt::NODE_CPU_STATS_ALL_CPUS
1237           Request statistics for all CPUs
1238
1239   NODE MEMORY CONSTANTS
1240       Sys::Virt::NODE_MEMORY_STATS_ALL_CELLS
1241           Request statistics for all memory cells
1242
1243   MEMORY PARAMETERS
1244       The following constants are used to name memory parameters of the node
1245
1246       Sys::Virt::NODE_MEMORY_SHARED_FULL_SCANS
1247           How many times all mergeable areas have been scanned.
1248
1249       Sys::Virt::NODE_MEMORY_SHARED_PAGES_SHARED
1250           How many the shared memory pages are being used.
1251
1252       Sys::Virt::NODE_MEMORY_SHARED_PAGES_SHARING
1253           How many sites are sharing the pages
1254
1255       Sys::Virt::NODE_MEMORY_SHARED_PAGES_TO_SCAN
1256           How many present pages to scan before the shared memory service
1257           goes to sleep
1258
1259       Sys::Virt::NODE_MEMORY_SHARED_PAGES_UNSHARED
1260           How many pages unique but repeatedly checked for merging.
1261
1262       Sys::Virt::NODE_MEMORY_SHARED_PAGES_VOLATILE
1263           How many pages changing too fast to be placed in a tree.
1264
1265       Sys::Virt::NODE_MEMORY_SHARED_SLEEP_MILLISECS
1266           How many milliseconds the shared memory service should sleep before
1267           next scan.
1268
1269       Sys::Virt::NODE_MEMORY_SHARED_MERGE_ACROSS_NODES
1270           Whether pages can be merged across NUMA nodes
1271
1272   CLOSE REASON CONSTANTS
1273       The following constants related to the connection close callback,
1274       describe the reason for the closing of the connection.
1275
1276       Sys::Virt::CLOSE_REASON_CLIENT
1277           The client application requested the connection be closed
1278
1279       Sys::Virt::CLOSE_REASON_EOF
1280           End-of-file was encountered reading data from the connection
1281
1282       Sys::Virt::CLOSE_REASON_ERROR
1283           An I/O error was encountered reading/writing data from/to the
1284           connection
1285
1286       Sys::Virt::CLOSE_REASON_KEEPALIVE
1287           The connection keepalive timer triggered due to lack of response
1288           from the server
1289
1290   CPU STATS CONSTANTS
1291       The following constants provide the names of known CPU stats fields
1292
1293       Sys::Virt::NODE_CPU_STATS_IDLE
1294           Time spent idle
1295
1296       Sys::Virt::NODE_CPU_STATS_IOWAIT
1297           Time spent waiting for I/O to complete
1298
1299       Sys::Virt::NODE_CPU_STATS_KERNEL
1300           Time spent executing kernel code
1301
1302       Sys::Virt::NODE_CPU_STATS_USER
1303           Time spent executing user code
1304
1305       Sys::Virt::NODE_CPU_STATS_INTR
1306           Time spent processing interrupts
1307
1308       Sys::Virt::NODE_CPU_STATS_UTILIZATION
1309           Percentage utilization of the CPU.
1310
1311   MEMORY STAS CONSTANTS
1312       The following constants provide the names of known memory stats fields
1313
1314       Sys::Virt::NODE_MEMORY_STATS_BUFFERS
1315           The amount of memory consumed by I/O buffers
1316
1317       Sys::Virt::NODE_MEMORY_STATS_CACHED
1318           The amount of memory consumed by disk cache
1319
1320       Sys::Virt::NODE_MEMORY_STATS_FREE
1321           The amount of free memory
1322
1323       Sys::Virt::NODE_MEMORY_STATS_TOTAL
1324           The total amount of memory
1325
1326   IP address constants
1327       The following constants are used to interpret IP address types
1328
1329       Sys::Virt::IP_ADDR_TYPE_IPV4
1330           An IPv4 address type
1331
1332       Sys::Virt::IP_ADDR_TYPE_IPV6
1333           An IPv6 address type
1334

BUGS

1336       Hopefully none, but the XS code needs to be audited to ensure it is not
1337       leaking memory.
1338

AUTHORS

1340       Daniel P. Berrange <berrange@redhat.com>
1341
1343       Copyright (C) 2006-2009 Red Hat Copyright (C) 2006-2009 Daniel P.
1344       Berrange
1345

LICENSE

1347       This program is free software; you can redistribute it and/or modify it
1348       under the terms of either the GNU General Public License as published
1349       by the Free Software Foundation (either version 2 of the License, or at
1350       your option any later version), or, the Artistic License, as specified
1351       in the Perl README file.
1352

SEE ALSO

1354       Sys::Virt::Domain, Sys::Virt::Network, Sys::Virt::StoragePool,
1355       Sys::Virt::StorageVol, Sys::Virt::Error, "http://libvirt.org"
1356
1357
1358
1359perl v5.38.0                      2023-09-08                    Sys::Virt(3pm)
Impressum