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