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