Debian Codegraph @

lib/Sys/Virt/Domain.pm

raw
1 # -*- perl -*-
2 #
3 # Copyright (C) 2006 Red Hat
4 # Copyright (C) 2006-2007 Daniel P. Berrange
5 #
6 # This program is free software; You can redistribute it and/or modify
7 # it under either:
8 #
9 # a) the GNU General Public License as published by the Free
10 # Software Foundation; either version 2, or (at your option) any
11 # later version,
12 #
13 # or
14 #
15 # b) the "Artistic License"
16 #
17 # The file "LICENSE" distributed along with this file provides full
18 # details of the terms and conditions of the two licenses.
19
20 =pod
21
22 =head1 NAME
23
24 Sys::Virt::Domain - Represent & manage a libvirt guest domain
25
26 =head1 DESCRIPTION
27
28 The C<Sys::Virt::Domain> module represents a guest domain managed
29 by the virtual machine monitor.
30
31 =head1 METHODS
32
33 =over 4
34
35 =cut
36
37 package Sys::Virt::Domain;
38
39 use strict;
40 use warnings;
41
42
43 sub _new {
44 my $proto = shift;
45 my $class = ref($proto) || $proto;
46 my %params = @_;
47
48 my $con = exists $params{connection} ? $params{connection} : die "connection parameter is required";
49 my $self;
50 if (exists $params{name}) {
51 $self = Sys::Virt::Domain::_lookup_by_name($con, $params{name});
52 } elsif (exists $params{id}) {
53 $self = Sys::Virt::Domain::_lookup_by_id($con, $params{id});
54 } elsif (exists $params{uuid}) {
55 if (length($params{uuid}) == 16) {
56 $self = Sys::Virt::Domain::_lookup_by_uuid($con, $params{uuid});
57 } elsif (length($params{uuid}) == 32 ||
58 length($params{uuid}) == 36) {
59 $self = Sys::Virt::Domain::_lookup_by_uuid_string($con, $params{uuid});
60 } else {
61 die "UUID must be either 16 unsigned bytes, or 32/36 hex characters long";
62 }
63 } elsif (exists $params{xml}) {
64 if ($params{nocreate}) {
65 $self = Sys::Virt::Domain::_define_xml($con, $params{xml}, $params{flags});
66 } else {
67 if (exists $params{fds}) {
68 $self = Sys::Virt::Domain::_create_with_files($con, $params{xml},
69 $params{fds}, $params{flags});
70 } else {
71 $self = Sys::Virt::Domain::_create($con, $params{xml}, $params{flags});
72 }
73 }
74 } else {
75 die "address, id or uuid parameters are required";
76 }
77
78 bless $self, $class;
79
80 return $self;
81 }
82
83
84 =item my $id = $dom->get_id()
85
86 Returns an integer with a locally unique identifier for the
87 domain.
88
89 =item my $uuid = $dom->get_uuid()
90
91 Returns a 16 byte long string containing the raw globally unique identifier
92 (UUID) for the domain.
93
94 =item my $uuid = $dom->get_uuid_string()
95
96 Returns a printable string representation of the raw UUID, in the format
97 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'.
98
99 =item my $name = $dom->get_name()
100
101 Returns a string with a locally unique name of the domain
102
103 =item my $hostname = $dom->get_hostname($flags=0)
104
105 Returns a string representing the hostname of the guest. C<$flags>
106 can be zero or more of
107
108 =over 4
109
110 =item Sys::Virt::Domain::GET_HOSTNAME_AGENT
111
112 Report the guest agent hostname
113
114 =item Sys::Virt::Domain::GET_HOSTNAME_LEASE
115
116 Report the DHCP lease hostname
117
118 =back
119
120 =item my $str = $dom->get_metadata($type, $uri, $flags =0)
121
122 Returns the metadata element of type C<$type> associated
123 with the domain. If C<$type> is C<Sys::Virt::Domain::METADATA_ELEMENT>
124 then the C<$uri> parameter specifies the XML namespace to
125 retrieve, otherwise C<$uri> should be C<undef>. The optional
126 C<$flags> parameter defaults to zero.
127
128 =item $dom->set_metadata($type, $val, $key, $uri, $flags=0)
129
130 Sets the metadata element of type C<$type> to hold the value
131 C<$val>. If C<$type> is C<Sys::Virt::Domain::METADATA_ELEMENT>
132 then the C<$key> and C<$uri> elements specify an XML namespace
133 to use, otherwise they should both be C<undef>. The optional
134 C<$flags> parameter defaults to zero.
135
136 =item $dom->is_active()
137
138 Returns a true value if the domain is currently running
139
140 =item $dom->is_persistent()
141
142 Returns a true value if the domain has a persistent configuration
143 file defined
144
145 =item $dom->is_updated()
146
147 Returns a true value if the domain is running and has a persistent
148 configuration file defined that is out of date compared to the
149 current live config.
150
151 =item my $xml = $dom->get_xml_description($flags=0)
152
153 Returns an XML document containing a complete description of
154 the domain's configuration. The optional $flags parameter
155 controls generation of the XML document, defaulting to 0 if
156 omitted. It can be one or more of the XML DUMP constants
157 listed later in this document.
158
159 =item my $type = $dom->get_os_type()
160
161 Returns a string containing the name of the OS type running
162 within the domain.
163
164 =item $dom->create($flags)
165
166 Start a domain whose configuration was previously defined using the
167 C<define_domain> method in L<Sys::Virt>. The C<$flags> parameter
168 accepts one of the DOMAIN CREATION constants documented later, and
169 defaults to 0 if omitted.
170
171 =item $dom->create_with_files($fds, $flags)
172
173 Start a domain whose configuration was previously defined using the
174 C<define_domain> method in L<Sys::Virt>. The C<$fds> parameter is an
175 array of UNIX file descriptors which will be passed to the init
176 process of the container. This is only supported with container based
177 virtualization.The C<$flags> parameter accepts one of the DOMAIN
178 CREATION constants documented later, and defaults to 0 if omitted.
179
180 =item $dom->undefine()
181
182 Remove the configuration associated with a domain previously defined
183 with the C<define_domain> method in L<Sys::Virt>. If the domain is
184 running, you probably want to use the C<shutdown> or C<destroy>
185 methods instead.
186
187 =item $dom->suspend()
188
189 Temporarily stop execution of the domain, allowing later continuation
190 by calling the C<resume> method.
191
192 =item $dom->resume()
193
194 Resume execution of a domain previously halted with the C<suspend>
195 method.
196
197 =item $dom->pm_wakeup()
198
199 Wakeup the guest from power management suspend state
200
201 =item $dom->pm_suspend_for_duration($target, $duration, $flags=0)
202
203 Tells the guest OS to enter the power management suspend state
204 identified by C<$target>. The C<$target> parameter should be
205 one of the NODE SUSPEND CONSTANTS listed in C<Sys::Virt>. The
206 C<$duration> specifies when the guest should automatically
207 wakeup. The C<$flags> parameter is optional and defaults to
208 zero.
209
210 =item $dom->save($filename, $dxml=undef, $params=undef, $flags=0)
211
212 Take a snapshot of the domain's state and save the information to
213 the file named in the C<$filename> parameter. The domain can later
214 be restored from this file with the C<restore_domain> method on
215 the L<Sys::Virt> object. The optional C<$dxml> parameter can be used to alter
216 portions of the domain XML that will be used when performing restore. The
217 C<$params> parameter is a hash reference whose keys is a subset of the SAVE /
218 RESTORE PARAMETER CONSTANTS. The C<$flags> parameter accepts one of the SAVE /
219 RESTORE FLAG CONSTANTS described later and defaults to zero.
220
221 =item $dom->managed_save($flags=0)
222
223 Take a snapshot of the domain's state and save the information to
224 a managed save location. The domain will be automatically restored
225 with this state when it is next started. The C<$flags> parameter is
226 unused and defaults to zero.
227
228 =item $bool = $dom->has_managed_save_image($flags=0)
229
230 Return a non-zero value if the domain has a managed save image
231 that will be used at next start. The C<$flags> parameter is
232 unused and defaults to zero.
233
234 =item $dom->managed_save_remove($flags=0)
235
236 Remove the current managed save image, causing the guest to perform
237 a full boot next time it is started. The C<$flags> parameter is
238 unused and defaults to zero.
239
240 =item $dom->managed_save_define_xml($xml, $flags=0)
241
242 Update the XML of the managed save image to C<$xml>. The C<$flags>
243 parameter is unused and defaults to zero.
244
245 =item $xml = $dom->managed_save_get_xml_description($flags=0)
246
247 Get the XML in the managed save image. The C<$flags>
248 parameter accepts the following constants
249
250 =over 4
251
252 =item Sys::Virt::Domain::SAVE_IMAGE_XML_SECURE
253
254 Include security sensitive information in the XML dump, such as
255 passwords.
256
257 =back
258
259 =item $dom->core_dump($filename[, $flags])
260
261 Trigger a core dump of the guest virtual machine, saving its memory
262 image to C<$filename> so it can be analysed by tools such as C<crash>.
263 The optional C<$flags> flags parameter is currently unused and if
264 omitted will default to 0.
265
266 =item $dom->core_dump_format($filename, $format, [, $flags])
267
268 Trigger a core dump of the guest virtual machine, saving its memory
269 image to C<$filename> so it can be analysed by tools such as C<crash>.
270 The C<$format> parameter is one of the core dump format constants.
271 The optional C<$flags> flags parameter is currently unused and if
272 omitted will default to 0.
273
274 =over 4
275
276 =item Sys::Virt::Domain::CORE_DUMP_FORMAT_RAW
277
278 The raw ELF format
279
280 =item Sys::Virt::Domain::CORE_DUMP_FORMAT_KDUMP_ZLIB
281
282 The zlib compressed ELF format
283
284 =item Sys::Virt::Domain::CORE_DUMP_FORMAT_KDUMP_SNAPPY
285
286 The snappy compressed ELF format
287
288 =item Sys::Virt::Domain::CORE_DUMP_FORMAT_KDUMP_LZO
289
290 The lzo compressed ELF format
291
292 =item Sys::Virt::Domain::CORE_DUMP_FORMAT_WIN_DMP
293
294 The Windows dump format
295
296 =back
297
298 =item $dom->destroy()
299
300 Immediately poweroff the machine. This is equivalent to removing the
301 power plug. The guest OS is given no time to cleanup / save state.
302 For a clean poweroff sequence, use the C<shutdown> method instead.
303
304 =item my $info = $dom->get_info()
305
306 Returns a hash reference summarising the execution state of the
307 domain. The elements of the hash are as follows:
308
309 =over 4
310
311 =item maxMem
312
313 The maximum memory allowed for this domain, in kilobytes
314
315 =item memory
316
317 The current memory allocated to the domain in kilobytes
318
319 =item cpuTime
320
321 The amount of CPU time used by the domain
322
323 =item nrVirtCpu
324
325 The current number of virtual CPUs enabled in the domain
326
327 =item state
328
329 The execution state of the machine, which will be one of the
330 constants &Sys::Virt::Domain::STATE_*.
331
332 =back
333
334 =item my ($state, $reason) = $dom->get_state()
335
336 Returns an array whose values specify the current state
337 of the guest, and the reason for it being in that state.
338 The C<$state> values are the same as for the C<get_info>
339 API, and the C<$reason> values come from:
340
341 =over 4
342
343 =item Sys::Virt::Domain::STATE_CRASHED_UNKNOWN
344
345 It is not known why the domain has crashed
346
347 =item Sys::Virt::Domain::STATE_CRASHED_PANICKED
348
349 The domain has crashed due to a kernel panic
350
351 =item Sys::Virt::Domain::STATE_NOSTATE_UNKNOWN
352
353 It is not known why the domain has no state
354
355 =item Sys::Virt::Domain::STATE_PAUSED_DUMP
356
357 The guest is paused due to a core dump operation
358
359 =item Sys::Virt::Domain::STATE_PAUSED_FROM_SNAPSHOT
360
361 The guest is paused due to a snapshot
362
363 =item Sys::Virt::Domain::STATE_PAUSED_IOERROR
364
365 The guest is paused due to an I/O error
366
367 =item Sys::Virt::Domain::STATE_PAUSED_MIGRATION
368
369 The guest is paused due to migration
370
371 =item Sys::Virt::Domain::STATE_PAUSED_SAVE
372
373 The guest is paused due to a save operation
374
375 =item Sys::Virt::Domain::STATE_PAUSED_UNKNOWN
376
377 It is not known why the domain has paused
378
379 =item Sys::Virt::Domain::STATE_PAUSED_USER
380
381 The guest is paused at admin request
382
383 =item Sys::Virt::Domain::STATE_PAUSED_WATCHDOG
384
385 The guest is paused due to the watchdog
386
387 =item Sys::Virt::Domain::STATE_PAUSED_SHUTTING_DOWN
388
389 The guest is paused while domain shutdown takes place
390
391 =item Sys::Virt::Domain::STATE_PAUSED_SNAPSHOT
392
393 The guest is paused while a snapshot takes place
394
395 =item Sys::Virt::Domain::STATE_PAUSED_CRASHED
396
397 The guest is paused due to a kernel panic
398
399 =item Sys::Virt::Domain::STATE_PAUSED_STARTING_UP
400
401 The guest is paused as it is being started up.
402
403 =item Sys::Virt::Domain::STATE_PAUSED_POSTCOPY
404
405 The guest is paused as post-copy migration is taking place
406
407 =item Sys::Virt::Domain::STATE_PAUSED_POSTCOPY_FAILED
408
409 The guest is paused as post-copy migration failed
410
411 =item Sys::Virt::Domain::STATE_PAUSED_API_ERROR
412
413 The guest is paused as a result of failed resume operation at the end of some
414 APIs which internally suspend guests.
415
416 =item Sys::Virt::Domain::STATE_RUNNING_BOOTED
417
418 The guest is running after being booted
419
420 =item Sys::Virt::Domain::STATE_RUNNING_FROM_SNAPSHOT
421
422 The guest is running after restore from snapshot
423
424 =item Sys::Virt::Domain::STATE_RUNNING_MIGRATED
425
426 The guest is running after migration
427
428 =item Sys::Virt::Domain::STATE_RUNNING_MIGRATION_CANCELED
429
430 The guest is running after migration abort
431
432 =item Sys::Virt::Domain::STATE_RUNNING_RESTORED
433
434 The guest is running after restore from file
435
436 =item Sys::Virt::Domain::STATE_RUNNING_SAVE_CANCELED
437
438 The guest is running after save cancel
439
440 =item Sys::Virt::Domain::STATE_RUNNING_UNKNOWN
441
442 It is not known why the domain has started
443
444 =item Sys::Virt::Domain::STATE_RUNNING_UNPAUSED
445
446 The guest is running after a resume
447
448 =item Sys::Virt::Domain::STATE_RUNNING_WAKEUP
449
450 The guest is running after wakeup from power management suspend
451
452 =item Sys::Virt::Domain::STATE_RUNNING_CRASHED
453
454 The guest was restarted after crashing
455
456 =item Sys::Virt::Domain::STATE_RUNNING_POSTCOPY
457
458 The guest is running but post-copy is taking place
459
460 =item Sys::Virt::Domain::STATE_RUNNING_POSTCOPY_FAILED
461
462 The guest is running, but migration failed in post-copy
463
464 =item Sys::Virt::Domain::STATE_BLOCKED_UNKNOWN
465
466 The guest is blocked for an unknown reason
467
468 =item Sys::Virt::Domain::STATE_SHUTDOWN_UNKNOWN
469
470 It is not known why the domain has shutdown
471
472 =item Sys::Virt::Domain::STATE_SHUTDOWN_USER
473
474 The guest is shutdown due to admin request
475
476 =item Sys::Virt::Domain::STATE_SHUTOFF_CRASHED
477
478 The guest is shutoff after a crash
479
480 =item Sys::Virt::Domain::STATE_SHUTOFF_DESTROYED
481
482 The guest is shutoff after being destroyed
483
484 =item Sys::Virt::Domain::STATE_SHUTOFF_FAILED
485
486 The guest is shutoff due to a virtualization failure
487
488 =item Sys::Virt::Domain::STATE_SHUTOFF_FROM_SNAPSHOT
489
490 The guest is shutoff after a snapshot
491
492 =item Sys::Virt::Domain::STATE_SHUTOFF_MIGRATED
493
494 The guest is shutoff after migration
495
496 =item Sys::Virt::Domain::STATE_SHUTOFF_SAVED
497
498 The guest is shutoff after a save
499
500 =item Sys::Virt::Domain::STATE_SHUTOFF_SHUTDOWN
501
502 The guest is shutoff due to controlled shutdown
503
504 =item Sys::Virt::Domain::STATE_SHUTOFF_UNKNOWN
505
506 It is not known why the domain has shutoff
507
508 =item Sys::Virt::Domain::STATE_SHUTOFF_DAEMON
509
510 The daemon stopped the guest due to a failure
511
512 =item Sys::Virt::Domain::STATE_PMSUSPENDED_UNKNOWN
513
514 It is not known why the domain was suspended to RAM
515
516 =item Sys::Virt::Domain::STATE_PMSUSPENDED_DISK_UNKNOWN
517
518 It is not known why the domain was suspended to disk
519
520 =back
521
522 =item my $info = $dom->get_control_info($flags=0)
523
524 Returns a hash reference providing information about
525 the control channel. The returned keys in the hash
526 are
527
528 =over 4
529
530 =item C<state>
531
532 One of the CONTROL INFO constants listed later
533
534 =item C<details>
535
536 Currently unused, always 0.
537
538 =item C<stateTime>
539
540 The elapsed time since the control channel entered
541 the current state.
542
543 =back
544
545 =item my $time = $dom->get_time($flags=0);
546
547 Get the current time of the guest, in seconds and nanoseconds.
548 The C<$flags> parameter is currently unused and defaults to
549 zero. The return value is an array ref with two elements,
550 the first contains the time in seconds, the second contains
551 the remaining nanoseconds.
552
553 =item $dom->set_time($secs, $nsecs, $flags=0);
554
555 Set the current time of the guest, in seconds and nanoseconds.
556 The C<$flags> parameter accepts one of
557
558 =over 4
559
560 =item C<Sys::Virt::Domain::TIME_SYNC>
561
562 Re-sync domain time from domain's RTC.
563
564 =back
565
566
567 =item $dom->set_user_password($username, $password, $flags=0);
568
569 Update the password for account C<$username> to be
570 C<$password>. C<$password> is the clear-text password
571 string unless the PASSWORD_ENCRYPTED flag is set.
572
573 =over 4
574
575 =item C<Sys::Virt::Domain::PASSWORD_ENCRYPTED>
576
577 The C<$password> is encrypted with the password scheme required
578 by the guest OS.
579
580 =back
581
582 =item $dom->rename($newname, $flags=0)
583
584 Change the name of an inactive guest to be C<$newname>.
585 The C<$flags> parameter is currently unused and defaults
586 to zero.
587
588 =item my @errs = $dom->get_disk_errors($flags=0)
589
590 Returns a list of all disk errors that have occurred on
591 the backing store for the guest's virtual disks. The
592 returned array elements are hash references, containing
593 two keys
594
595 =over 4
596
597 =item C<path>
598
599 The path of the disk with an error
600
601 =item C<error>
602
603 The error type
604
605 =back
606
607 =item $dom->send_key($keycodeset, $holdtime, \@keycodes, $flags=0)
608
609 Sends a sequence of keycodes to the guest domain. The
610 C<$keycodeset> should be one of the constants listed
611 later in the KEYCODE SET section. C<$holdtiem> is the
612 duration, in milliseconds, to keep the key pressed
613 before releasing it and sending the next keycode.
614 C<@keycodes> is an array reference containing the list
615 of keycodes to send to the guest. The elements in the
616 array should be keycode values from the specified
617 keycode set. C<$flags> is currently unused.
618
619 =item my $info = $dom->get_block_info($dev, $flags=0)
620
621 Returns a hash reference summarising the disk usage of
622 the host backing store for a guest block device. The
623 C<$dev> parameter should be the path to the backing
624 store on the host. C<$flags> is currently unused and
625 defaults to 0 if omitted. The returned hash contains
626 the following elements
627
628 =over 4
629
630 =item capacity
631
632 Logical size in bytes of the block device backing image *
633
634 =item allocation
635
636 Highest allocated extent in bytes of the block device backing image
637
638 =item physical
639
640 Physical size in bytes of the container of the backing image
641
642 =back
643
644 =item $dom->set_max_memory($mem)
645
646 Set the maximum memory for the domain to the value C<$mem>. The
647 value of the C<$mem> parameter is specified in kilobytes.
648
649 =item $mem = $dom->get_max_memory()
650
651 Returns the current maximum memory allowed for this domain in
652 kilobytes.
653
654 =item $dom->set_memory($mem, $flags)
655
656 Set the current memory for the domain to the value C<$mem>. The
657 value of the C<$mem> parameter is specified in kilobytes. This
658 must be less than, or equal to the domain's max memory limit.
659 The C<$flags> parameter can control whether the update affects
660 the live guest, or inactive config, defaulting to modifying
661 the current state.
662
663 =item $dom->set_memory_stats_period($period, $flags)
664
665 Set the period on which guests memory stats are refreshed,
666 with C<$period> being a value in seconds. The C<$flags>
667 parameter is currently unused.
668
669 =item $dom->shutdown([$flags])
670
671 Request that the guest OS perform a graceful shutdown and
672 poweroff. This usually requires some form of cooperation
673 from the guest operating system, such as responding to an
674 ACPI signal, or a guest agent process. For an immediate,
675 forceful poweroff, use the C<destroy> method instead.
676 The optional C<$flags> parameter specifies the shutdown
677 mechanism, see L</SHUTDOWN CONSTANTS>. If not specified,
678 driver's defaults are used.
679
680 =item $dom->reboot([$flags])
681
682 Request that the guest OS perform a graceful shutdown and
683 optionally restart. The optional C<$flags> parameter
684 specifies the reboot mechanism, see L</REBOOT CONSTANTS>.
685 If not specified, driver's defaults are used.
686
687 =item $dom->reset([$flags])
688
689 Perform a hardware reset of the virtual machine. The guest
690 OS is given no opportunity to shutdown gracefully. The
691 optional C<$flags> parameter is currently unused and if
692 omitted defaults to zero.
693
694 =item $dom->get_max_vcpus()
695
696 Return the maximum number of vcpus that are configured
697 for the domain
698
699 =item $dom->attach_device($xml[, $flags])
700
701 Hotplug a new device whose configuration is given by C<$xml>,
702 to the running guest. The optional <$flags> parameter defaults
703 to 0, but can accept one of the device hotplug flags described
704 later.
705
706 =item $dom->detach_device($xml[, $flags])
707
708 Hotunplug an existing device whose configuration is given by C<$xml>,
709 from the running guest. The optional <$flags> parameter defaults
710 to 0, but can accept one of the device hotplug flags described
711 later.
712
713 =item $dom->detach_device_alias($alias[, $flags])
714
715 Hotunplug an existing device which is identified by C<$alias>.
716 The optional <$flags> parameter defaults to 0, but can accept one
717 of the device hotplug flags described later.
718
719 =item $dom->update_device($xml[, $flags])
720
721 Update the configuration of an existing device. The new configuration
722 is given by C<$xml>. The optional <$flags> parameter defaults to
723 0 but can accept one of the device hotplug flags described later.
724
725 =item $data = $dom->block_peek($path, $offset, $size[, $flags])
726
727 Peek into the guest disk C<$path>, at byte C<$offset> capturing
728 C<$size> bytes of data. The returned scalar may contain embedded
729 NULLs. The optional C<$flags> parameter is currently unused and
730 if omitted defaults to zero.
731
732 =item $data = $dom->memory_peek($offset, $size[, $flags])
733
734 Peek into the guest memory at byte C<$offset> virtual address,
735 capturing C<$size> bytes of memory. The return scalar may
736 contain embedded NULLs. The optional C<$flags> parameter is
737 currently unused and if omitted defaults to zero.
738
739 =item $flag = $dom->get_autostart();
740
741 Return a true value if the guest domain is configured to automatically
742 start upon boot. Return false, otherwise
743
744 =item $dom->set_autostart($flag)
745
746 Set the state of the autostart flag, which determines whether the
747 guest will automatically start upon boot of the host OS
748
749 =item $flag = $dom->get_autostart_once();
750
751 Provides a boolean value indicating whether the domain is
752 configured to be automatically started the next time the host
753 machine boots only.
754
755 =item $dom->set_autostart_once($flag)
756
757 Configure the domain to be automatically started the next time
758 the host machine boots only.
759
760 =item $dom->set_vcpus($count, [$flags])
761
762 Set the number of virtual CPUs in the guest VM to C<$count>.
763 The optional C<$flags> parameter can be used to control whether
764 the setting changes the live config or inactive config.
765
766 =item $dom->set_vcpu($cpumap, $state, [$flags=0])
767
768 Set the state of the CPUs in C<$cpumap> to C<$state>. The
769 C<$flags> parameter accepts one or more the SETVCPU OPTIONS
770 constants documented later, and defaults to 0 if omitted.
771
772 =item $count = $dom->get_vcpus([$flags])
773
774 Get the number of virtual CPUs in the guest VM.
775 The optional C<$flags> parameter can be used to control whether
776 to query the setting of the live config or inactive config.
777
778 =item $dom->set_guest_vcpus($cpumap, $state, [$flags=0])
779
780 Set the online status of the guest OS CPUs. The C<$cpumap>
781 parameter describes the set of CPUs to modify (e.g. "0-3,^1").
782 C<$state> is either B<1> to set the CPUs online, or B<0>
783 to set them offline. The C<$flags> parameter is currently
784 unused and defaults to 0.
785
786 =item $info $dom->get_guest_vcpus([$flags=0])
787
788 Query information about the guest OS CPUs. The returned
789 data is a hash reference with the following keys.
790
791 =over 4
792
793 =item B<vcpus>
794
795 String containing bitmap representing CPU ids reported
796 currently known to the guest.
797
798 =item B<online>
799
800 String containing bitmap representing CPU ids that are
801 currently online in the guest.
802
803 =item B<offlinable>
804
805 String containing bitmap representing CPU ids that can
806 be offlined in the guest.
807
808 =back
809
810 The C<$flags> parameter is currently unused and defaults to 0.
811
812 =item $type = $dom->get_scheduler_type()
813
814 Return the scheduler type for the guest domain
815
816 =item $stats = $dom->block_stats($path)
817
818 Fetch the current I/O statistics for the block device given by C<$path>.
819 The returned hash reference contains keys for
820
821 =over 4
822
823 =item C<rd_req>
824
825 Number of read requests
826
827 =item C<rd_bytes>
828
829 Number of bytes read
830
831 =item C<wr_req>
832
833 Number of write requests
834
835 =item C<wr_bytes>
836
837 Number of bytes written
838
839 =item C<errs>
840
841 Some kind of error count
842
843 =back
844
845 =item my $params = $dom->get_scheduler_parameters($flags=0)
846
847 Return the set of scheduler tunable parameters for the guest,
848 as a hash reference. The precise set of keys in the hash
849 are specific to the hypervisor.
850
851 =item $dom->set_scheduler_parameters($params, $flags=0)
852
853 Update the set of scheduler tunable parameters. The value names for
854 tunables vary, and can be discovered using the C<get_scheduler_params>
855 call
856
857 =item my $params = $dom->get_memory_parameters($flags=0)
858
859 Return a hash reference containing the set of memory tunable
860 parameters for the guest. The keys in the hash are one of the
861 constants MEMORY PARAMETERS described later. The C<$flags>
862 parameter accepts one or more the CONFIG OPTION constants
863 documented later, and defaults to 0 if omitted.
864
865 =item $dom->set_memory_parameters($params, $flags=0)
866
867 Update the memory tunable parameters for the guest. The
868 C<$params> should be a hash reference whose keys are one
869 of the MEMORY PARAMETERS constants. The C<$flags>
870 parameter accepts one or more the CONFIG OPTION constants
871 documented later, and defaults to 0 if omitted.
872
873 =item my $params = $dom->get_blkio_parameters($flags=0)
874
875 Return a hash reference containing the set of blkio tunable
876 parameters for the guest. The keys in the hash are one of the
877 constants BLKIO PARAMETERS described later. The C<$flags>
878 parameter accepts one or more the CONFIG OPTION constants
879 documented later, and defaults to 0 if omitted.
880
881 =item $dom->set_blkio_parameters($params, $flags=0)
882
883 Update the blkio tunable parameters for the guest. The
884 C<$params> should be a hash reference whose keys are one
885 of the BLKIO PARAMETERS constants. The C<$flags>
886 parameter accepts one or more the CONFIG OPTION constants
887 documented later, and defaults to 0 if omitted.
888
889 =item $stats = $dom->get_block_iotune($disk, $flags=0)
890
891 Return a hash reference containing the set of blkio tunable
892 parameters for the guest disk C<$disk>. The keys in the hash
893 are one of the constants BLOCK IOTUNE PARAMETERS described later.
894
895 =item $dom->set_block_iotune($disk, $params, $flags=0);
896
897 Update the blkio tunable parameters for the guest disk C<$disk>. The
898 C<$params> should be a hash reference whose keys are one
899 of the BLOCK IOTUNE PARAMETERS constants.
900
901 =item my $params = $dom->get_interface_parameters($intf, $flags=0)
902
903 Return a hash reference containing the set of interface tunable
904 parameters for the guest. The keys in the hash are one of the
905 constants INTERFACE PARAMETERS described later.
906
907 =item $dom->set_interface_parameters($intf, $params, $flags=0)
908
909 Update the interface tunable parameters for the guest. The
910 C<$params> should be a hash reference whose keys are one
911 of the INTERFACE PARAMETERS constants.
912
913 =item my $params = $dom->get_numa_parameters($flags=0)
914
915 Return a hash reference containing the set of numa tunable
916 parameters for the guest. The keys in the hash are one of the
917 constants NUMA PARAMETERS described later. The C<$flags>
918 parameter accepts one or more the CONFIG OPTION constants
919 documented later, and defaults to 0 if omitted.
920
921 =item $dom->set_numa_parameters($params, $flags=0)
922
923 Update the numa tunable parameters for the guest. The
924 C<$params> should be a hash reference whose keys are one
925 of the NUMA PARAMETERS constants. The C<$flags>
926 parameter accepts one or more the CONFIG OPTION constants
927 documented later, and defaults to 0 if omitted.
928
929 =item my $params = $dom->get_perf_events($flags=0)
930
931 Return a hash reference containing the set of performance
932 events that are available for the guest. The keys in the
933 hash are one of the constants PERF EVENTS described later.
934 The C<$flags> parameter accepts one or more the CONFIG
935 OPTION constants documented later, and defaults to 0 if
936 omitted.
937
938 =item $dom->set_perf_events($params, $flags=0)
939
940 Update the enabled state for performance events for the
941 guest. The C<$params> should be a hash reference whose
942 keys are one of the PERF EVENTS constants. The C<$flags>
943 parameter accepts one or more the CONFIG OPTION constants
944 documented later, and defaults to 0 if omitted.
945
946 =item $dom->block_resize($disk, $newsize, $flags=0)
947
948 Resize the disk C<$disk> to have new size C<$newsize> KB. If the disk
949 is backed by a special image format, the actual resize is done by the
950 hypervisor. If the disk is backed by a raw file, or block device,
951 the resize must be done prior to invoking this API call, and it
952 merely updates the hypervisor's view of the disk size. The following
953 flags may be used
954
955 =over 4
956
957 =item Sys::Virt::Domain::BLOCK_RESIZE_BYTES
958
959 Treat C<$newsize> as if it were in bytes, rather than KB.
960
961 =item Sys::Virt::Domain::BLOCK_RESIZE_CAPACITY
962
963 Resize to full the capacity of the source
964
965 =item Sys::Virt::Domain::BLOCK_RESIZE_EXTEND
966
967 Disallow shrinking of the disk in size.
968
969 =back
970
971 =item $dom->interface_stats($path)
972
973 Fetch the current I/O statistics for the block device given by C<$path>.
974 The returned hash contains keys for
975
976 =over 4
977
978 =item C<rx_bytes>
979
980 Total bytes received
981
982 =item C<rx_packets>
983
984 Total packets received
985
986 =item C<rx_errs>
987
988 Total packets received with errors
989
990 =item C<rx_drop>
991
992 Total packets drop at reception
993
994 =item C<tx_bytes>
995
996 Total bytes transmitted
997
998 =item C<tx_packets>
999
1000 Total packets transmitted
1001
1002 =item C<tx_errs>
1003
1004 Total packets transmitted with errors
1005
1006 =item C<tx_drop>
1007
1008 Total packets dropped at transmission.
1009
1010 =back
1011
1012 =item $dom->memory_stats($flags=0)
1013
1014 Fetch the current memory statistics for the guest domain. The
1015 C<$flags> parameter is currently unused and can be omitted.
1016 The returned hash contains keys for
1017
1018 =over 4
1019
1020 =item C<swap_in>
1021
1022 Data read from swap space
1023
1024 =item C<swap_out>
1025
1026 Data written to swap space
1027
1028 =item C<major_fault>
1029
1030 Page fault involving disk I/O
1031
1032 =item C<minor_fault>
1033
1034 Page fault not involving disk I/O
1035
1036 =item C<unused>
1037
1038 Memory not used by the system
1039
1040 =item C<available>
1041
1042 Total memory seen by guest
1043
1044 =item C<rss>
1045
1046 Resident set size. Size of memory resident in host RAM.
1047
1048 =back
1049
1050 =item $info = $dom->get_security_label()
1051
1052 Fetch information about the security label assigned to the guest
1053 domain. The returned hash reference has two keys, C<model> gives
1054 the name of the security model in effect (e.g. C<selinux>), while
1055 C<label> provides the name of the security label applied to the
1056 domain. This method only returns information about the first
1057 security label. To retrieve all labels, use C<get_security_label_list>.
1058
1059 =item @info = $dom->get_security_label_list()
1060
1061 Fetches information about all security labels assigned to the
1062 guest domain. The elements in the returned array are all
1063 hash references, whose keys are as described for C<get_security_label>.
1064
1065 =item $ddom = $dom->migrate(destcon, \%params, flags=0)
1066
1067 Migrate a domain to an alternative host. The C<destcon> parameter
1068 should be a C<Sys::Virt> connection to the remote target host.
1069 The C<flags> parameter takes one or more of the C<Sys::Virt::Domain::MIGRATE_XXX>
1070 constants described later in this document. The C<%params> parameter is
1071 a hash reference used to set various parameters for the migration
1072 operation, with the following valid keys.
1073
1074 =over 4
1075
1076 =item C<Sys::Virt::Domain::MIGRATE_PARAM_URI>
1077
1078 The URI to use for initializing the domain migration. It takes a
1079 hypervisor specific format. The uri_transports element of the hypervisor
1080 capabilities XML includes details of the supported URI schemes. When
1081 omitted libvirt will auto-generate suitable default URI. It is typically
1082 only necessary to specify this URI if the destination host has multiple
1083 interfaces and a specific interface is required to transmit migration data.
1084
1085 =item C<Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME>
1086
1087 The name to be used for the domain on the destination host. Omitting
1088 this parameter keeps the domain name the same. This field is only
1089 allowed to be used with hypervisors that support domain renaming
1090 during migration.
1091
1092 =item C<Sys::Virt::Domain::MIGRATE_PARAM_DEST_XML>
1093
1094 The new configuration to be used for the domain on the destination host.
1095 The configuration must include an identical set of virtual devices, to
1096 ensure a stable guest ABI across migration. Only parameters related to
1097 host side configuration can be changed in the XML. Hypervisors which
1098 support this field will forbid migration if the provided XML would cause
1099 a change in the guest ABI. This field cannot be used to rename the domain
1100 during migration (use VIR_MIGRATE_PARAM_DEST_NAME field for that purpose).
1101 Domain name in the destination XML must match the original domain name.
1102
1103 Omitting this parameter keeps the original domain configuration. Using this
1104 field with hypervisors that do not support changing domain configuration
1105 during migration will result in a failure.
1106
1107 =item C<Sys::Virt::Domain::MIGRATE_PARAM_GRAPHICS_URI>
1108
1109 URI to use for migrating client's connection to domain's graphical console
1110 as VIR_TYPED_PARAM_STRING. If specified, the client will be asked to
1111 automatically reconnect using these parameters instead of the automatically
1112 computed ones. This can be useful if, e.g., the client does not have a direct
1113 access to the network virtualization hosts are connected to and needs to
1114 connect through a proxy. The URI is formed as follows:
1115
1116 protocol://hostname[:port]/[?parameters]
1117
1118 where protocol is either "spice" or "vnc" and parameters is a list of
1119 protocol specific parameters separated by '&'. Currently recognized
1120 parameters are "tlsPort" and "tlsSubject". For example,
1121
1122 spice://target.host.com:1234/?tlsPort=4567
1123
1124 =item C<Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH>
1125
1126 The maximum bandwidth (in MiB/s) that will be used for migration. If
1127 set to 0 or omitted, libvirt will choose a suitable default. Some
1128 hypervisors do not support this feature and will return an error if
1129 this field is used and is not 0.
1130
1131 =item C<Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH_POSTCOPY>
1132
1133 The maximum bandwidth (in MiB/s) that will be used for migration
1134 during post-copy phase. If set to 0 or omitted, libvirt will choose
1135 a suitable default. Some hypervisors do not support this feature and
1136 return an error if this field is used and is not 0.
1137
1138 =item C<Sys::Virt::Domain::MIGRATE_PARAM_LISTEN_ADDRESS>
1139
1140 The address on which to listen for incoming migration connections.
1141 If omitted, libvirt will listen on the wildcard address (0.0.0.0
1142 or ::). This default may be a security risk if guests, or other
1143 untrusted users have the ability to connect to the virtualization
1144 host, thus use of an explicit restricted listen address is recommended.
1145
1146 =item C<Sys::Virt::Domain::MIGRATE_PARAM_DISK_PORT>
1147
1148 Port that destination server should use for incoming disks migration. Type is
1149 VIR_TYPED_PARAM_INT. If set to 0 or omitted, libvirt will choose a suitable
1150 default. At the moment this is only supported by the QEMU driver.
1151
1152 =item C<Sys::Virt::Domain::MIGRATE_PARAM_MIGRATE_DISKS>
1153
1154 The list of disks to migrate when doing block storage migration.
1155 In contrast to other parameters whose values are plain strings,
1156 the parameter value should be an array reference, whose elements
1157 are in turn strings representing the disk target names.
1158
1159 =item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION>
1160
1161 The type of compression method use use, either C<xbzrle> or
1162 C<mt>.
1163
1164 =item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_THREADS>
1165
1166 The number of compression threads to use
1167
1168 =item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_DTHREADS>
1169
1170 The number of decompression threads
1171
1172 =item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_LEVEL>
1173
1174 The compression level from 0 (no compression) to 9 (maximum
1175 compression)
1176
1177 =item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE>
1178
1179 The size of the cache for xbzrle compression
1180
1181 =item C<Sys::Virt::Domain::MIGRATE_PARAM_PERSIST_XML>
1182
1183 The alternative persistent XML config to copy
1184
1185 =item C<Sys::Virt::Domain::MIGRATE_PARAM_AUTO_CONVERGE_INITIAL>
1186
1187 The initial percentage to throttle guest vCPUs
1188
1189 =item C<Sys::Virt::Domain::MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT>
1190
1191 The additional percentage step size to throttle guest vCPUs if
1192 progress is not made
1193
1194 =item C<Sys::Virt::Domain::MIGRATE_PARAM_PARALLEL_CONNECTIONS>
1195
1196 The number of connections used during parallel migration.
1197
1198 =item C<Sys::Virt::Domain::MIGRATE_PARAM_TLS_DESTINATION>
1199
1200 Override the destination host name used for TLS verification.
1201 Normally the TLS certificate from the destination host must match
1202 the host's name for TLS verification to succeed. When the
1203 certificate does not match the destination hostname and the
1204 expected certificate's hostname is known, this parameter can be
1205 used to pass this expected hostname when starting the migration.
1206
1207 =item C<Sys::Virt::Domain::MIGRATE_PARAM_DISKS_URI>
1208
1209 The URI to use for initializing the domain migration for storage. It takes
1210 a hypervisor specific format. The uri_transports element of the hypervisor
1211 capabilities XML includes details of the supported URI schemes. When
1212 omitted libvirt will auto-generate suitable default URI. It is typically
1213 only necessary to specify this URI if the destination host has multiple
1214 interfaces and a specific interface is required to transmit storage data.
1215
1216 =item C<Sys::Virt::Domain::MIGRATE_PARAM_ZLIB_LEVEL>
1217
1218 The level of compression for zlib. Accepted values are in range 0-9. 0 is no
1219 compression, 1 is maximum speed and 9 is maximum compression.
1220
1221 =item C<Sys::Virt::Domain::MIGRATE_PARAM_ZSTD_LEVEL>
1222
1223 The level of compression for zstd. Accepted values are in range 0-20. 0 is no
1224 compression, 1 is maximum speed and 20 is maximum compression.
1225
1226 =item C<Sys::Virt::Domain::MIGRATE_PARAM_DISKS_DETECT_ZEROES>
1227
1228 Enable zero detection on list of disks to avoid transferring zero
1229 blocks. Users must ensure that any pre-created storage source on
1230 the destination will be cleared and thus read all-zeroes before
1231 using this feature, otherwise the destination image may become
1232 corrupted.
1233 In contrast to other parameters whose values are plain strings,
1234 the parameter value should be an array reference, whose elements
1235 are in turn strings representing the disk target names.
1236
1237 =item C<Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH_AVAIL_SWITCHOVER>
1238
1239 The maximum bandwidth (in MiB/s) that will be used for migration
1240 during the switchover phase. If set to 0 or omitted, QEMU will
1241 estimate a suitable default.
1242
1243 =item C<Sys::Virt::Domain::MIGRATE_PARAM_MIGRATE_DISKS_TARGET_ZERO>
1244
1245 List of target disks that can be assumed to be initialized to all zeros.
1246
1247 =back
1248
1249 =item $ddom = $dom->migrate(destcon, flags=0, dname=undef, uri=undef, bandwidth=0)
1250
1251 Migrate a domain to an alternative host. Use of positional parameters
1252 with C<migrate> is deprecated in favour of passing a hash reference
1253 as described above.
1254
1255 =cut
1256
1257 sub migrate {
1258 my $dom = shift;
1259 my $destcon = shift;
1260
1261 if (ref $_[0] &&
1262 ref $_[0] eq "HASH") {
1263 my $params = shift;
1264 my $flags = shift;
1265
1266 return $dom->_migrate($destcon, $params, $flags);
1267 } else {
1268 my $flags = shift;
1269 my $dname = shift;
1270 my $uri = shift;
1271 my $bandwidth = shift;
1272 my $params = {};
1273
1274 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME} = $dname
1275 if defined $dname;
1276 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_URI} = $uri
1277 if defined $uri;
1278 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH} = $bandwidth
1279 if defined $bandwidth;
1280
1281 return $dom->_migrate($destcon, $params, $flags);
1282 }
1283 }
1284
1285
1286 =item $ddom = $dom->migrate2(destcon, dxml, flags, dname, uri, bandwidth)
1287
1288 Migrate a domain to an alternative host. This method is deprecated in
1289 favour of passing a hash ref to C<migrate>.
1290
1291 =cut
1292
1293 sub migrate2 {
1294 my $dom = shift;
1295 my $destcon = shift;
1296 my $dxml = shift;
1297 my $flags = shift;
1298 my $dname = shift;
1299 my $uri = shift;
1300 my $bandwidth = shift;
1301 my $params = {};
1302
1303 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_XML} = $dxml
1304 if defined $dxml;
1305 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME} = $dname
1306 if defined $dname;
1307 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_URI} = $uri
1308 if defined $uri;
1309 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH} = $bandwidth
1310 if defined $bandwidth;
1311
1312 return $dom->_migrate($destcon, $params, $flags);
1313 }
1314
1315
1316 =item $ddom = $dom->migrate_to_uri(desturi, \%params, flags=0)
1317
1318 Migrate a domain to an alternative host. The C<desturi> parameter
1319 should be a valid libvirt connection URI for the remote target host.
1320 The C<flags> parameter takes one or more of the C<Sys::Virt::Domain::MIGRATE_XXX>
1321 constants described later in this document. The C<%params> parameter is
1322 a hash reference used to set various parameters for the migration
1323 operation, with the same keys described for the C<migrate> API.
1324
1325 =item $dom->migrate_to_uri(desturi, flags, dname, bandwidth)
1326
1327 Migrate a domain to an alternative host. Use of positional parameters
1328 with C<migrate_to_uri> is deprecated in favour of passing a hash reference
1329 as described above.
1330
1331 =cut
1332
1333 sub migrate_to_uri {
1334 my $dom = shift;
1335 my $desturi = shift;
1336
1337 if (ref $_[0] &&
1338 ref $_[0] eq "HASH") {
1339 my $params = shift;
1340 my $flags = shift;
1341
1342 return $dom->_migrate_to_uri($desturi, $params, $flags);
1343 } else {
1344 my $flags = shift;
1345 my $dname = shift;
1346 my $uri = shift;
1347 my $bandwidth = shift;
1348 my $params = {};
1349
1350 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME} = $dname
1351 if defined $dname;
1352 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_URI} = $uri
1353 if defined $uri;
1354 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH} = $bandwidth
1355 if defined $bandwidth;
1356
1357 return $dom->_migrate_to_uri($desturi, $params, $flags);
1358 }
1359 }
1360
1361
1362 =item $dom->migrate_to_uri2(dconnuri, miguri, dxml, flags, dname, bandwidth)
1363
1364 Migrate a domain to an alternative host. This method is deprecated in
1365 favour of passing a hash ref to C<migrate_to_uri>.
1366
1367 =cut
1368
1369 sub migrate_to_uri2 {
1370 my $dom = shift;
1371 my $desturi = shift;
1372 my $dxml = shift;
1373 my $flags = shift;
1374 my $dname = shift;
1375 my $uri = shift;
1376 my $bandwidth = shift;
1377 my $params = {};
1378
1379 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_XML} = $dxml
1380 if defined $dxml;
1381 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME} = $dname
1382 if defined $dname;
1383 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_URI} = $uri
1384 if defined $uri;
1385 $params->{&Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH} = $bandwidth
1386 if defined $bandwidth;
1387
1388 return $dom->_migrate_to_uri2($desturi, $params, $flags);
1389 }
1390
1391
1392 =item $dom->migrate_set_max_downtime($downtime, $flags=0)
1393
1394 Set the maximum allowed downtime during migration of the guest. A
1395 longer downtime makes it more likely that migration will complete,
1396 at the cost of longer time blackout for the guest OS at the switch
1397 over point. The C<downtime> parameter is measured in milliseconds.
1398 The C<$flags> parameter is currently unused and defaults to zero.
1399
1400 =item $downtime = $dom->migrate_get_max_downtime($flags=0)
1401
1402 Get the current value of the maximum downtime allowed during a
1403 migration of a guest. The returned <downtime> value is measured
1404 in milliseconds. The C<$flags> parameter is currently unused and
1405 defaults to zero.
1406
1407 =item $dom->migrate_set_max_speed($bandwidth, $flags=0)
1408
1409 Set the maximum allowed bandwidth during migration of the guest.
1410 The C<bandwidth> parameter is measured in MB/second.
1411 The C<$flags> parameter takes zero or more of the constants:
1412
1413 =over 4
1414
1415 =item $Sys::Virt::Domain::MIGRATE_MAX_SPEED_POSTCOPY
1416
1417 Set the post-copy speed instead of the pre-copy speed.
1418
1419 =back
1420
1421 =item $bandwidth = $dom->migrate_get_max_speed($flags=0)
1422
1423 Get the maximum allowed bandwidth during migration of the guest.
1424 The returned <bandwidth> value is measured in MB/second.
1425 The C<$flags> parameter is accepts the same constants as
1426 C<migrate_set_max_speed>.
1427
1428 =item $dom->migrate_set_compression_cache($cacheSize, $flags=0)
1429
1430 Set the maximum allowed compression cache size during migration of
1431 the guest. The C<cacheSize> parameter is measured in bytes.
1432 The C<$flags> parameter is currently unused and defaults to zero.
1433
1434 =item $cacheSize = $dom->migrate_get_compression_cache($flags=0)
1435
1436 Get the maximum allowed compression cache size during migration of
1437 the guest. The returned <bandwidth> value is measured in bytes.
1438 The C<$flags> parameter is currently unused and defaults to zero.
1439
1440 =item $dom->migrate_start_post_copy($flags=0)
1441
1442 Switch the domain from pre-copy to post-copy mode. This requires
1443 that the original migrate command had the C<Sys::Virt::Domain::MIGRATE_POST_COPY>
1444 flag specified.
1445
1446 =item $dom->inject_nmi($flags)
1447
1448 Trigger an NMI in the guest virtual machine. The C<$flags> parameter
1449 is currently unused and defaults to 0.
1450
1451 =item $dom->open_console($st, $devname, $flags)
1452
1453 Open the text console for a serial, parallel or paravirt console
1454 device identified by C<$devname>, connecting it to the stream
1455 C<$st>. If C<$devname> is undefined, the default console will be
1456 opened. C<$st> must be a C<Sys::Virt::Stream> object used for
1457 bi-directional communication with the console. C<$flags> is
1458 currently unused, defaulting to 0.
1459
1460 =item $dom->open_channel($st, $devname, $flags)
1461
1462 Open the text console for a data channel device identified by
1463 C<$devname>, connecting it to the stream C<$st>. C<$st> must
1464 be a C<Sys::Virt::Stream> object used for bi-directional
1465 communication with the channel. C<$flags> is currently unused,
1466 defaulting to 0.
1467
1468 =item $dom->open_graphics($idx, $fd, $flags)
1469
1470 Open the graphics console for a guest, identified by C<$idx>,
1471 counting from 0. The C<$fd> should be a file descriptor for an
1472 anonymous socket pair. The C<$flags> argument should be one of
1473 the constants listed at the end of this document, and defaults
1474 to 0.
1475
1476 =item $fd = $dom->open_graphics_fd($idx, $flags)
1477
1478 Open the graphics console for a guest, identified by C<$idx>,
1479 counting from 0. The C<$flags> argument should be one of the
1480 constants listed at the end of this document, and defaults
1481 to 0. The return value will be a file descriptor connected
1482 to the console which must be closed when no longer needed.
1483 This method is preferred over C<open_graphics> since it will
1484 work correctly under sVirt mandatory access control policies.
1485
1486 =item my $mimetype = $dom->screenshot($st, $screen, $flags)
1487
1488 Capture a screenshot of the virtual machine's monitor. The C<$screen>
1489 parameter controls which monitor is captured when using a multi-head
1490 or multi-card configuration. C<$st> must be a C<Sys::Virt::Stream>
1491 object from which the data can be read. C<$flags> is currently unused
1492 and defaults to 0. The mimetype of the screenshot is returned
1493
1494 =item @vcpuinfo = $dom->get_vcpu_info($flags=0)
1495
1496 Obtain information about the state of all virtual CPUs in a running
1497 guest domain. The returned list will have one element for each vCPU,
1498 where each elements contains a hash reference. The keys in the hash
1499 are, C<number> the vCPU number, C<cpu> the physical CPU on which the
1500 vCPU is currently scheduled, C<cpuTime> the cumulative execution
1501 time of the vCPU, C<state> the running state and C<affinity> giving
1502 the allowed scheduler placement. The value for C<affinity> is a
1503 string representing a bitmask against physical CPUs, 8 cpus per
1504 character. To extract the bits use the C<unpack> function with
1505 the C<b*> template. NB The C<state>, C<cpuTime>, C<cpu> values are
1506 only available if using C<$flags> value of 0, and the domain is
1507 currently running; otherwise they will all be set to zero.
1508
1509 =item $dom->pin_vcpu($vcpu, $mask)
1510
1511 Pin the virtual CPU given by index C<$vcpu> to physical CPUs
1512 given by C<$mask>. The C<$mask> is a string representing a bitmask
1513 against physical CPUs, 8 cpus per character.
1514
1515 =item $mask = $dom->get_emulator_pin_info()
1516
1517 Obtain information about the CPU affinity of the emulator process.
1518 The returned C<$mask> is a bitstring against physical CPUs, 8 cpus
1519 per character. To extract the bits use the C<unpack> function with
1520 the C<b*> template.
1521
1522 =item $dom->pin_emulator($newmask, $flags=0)
1523
1524 Pin the emulator threads to the physical CPUs identified by the
1525 affinity in C<$newmask>. The C<$newmask> is a bitstring against
1526 the physical CPUa, 8 cpus per character. To create a suitable
1527 bitstring, use the C<vec> function with a value of C<1> for the
1528 C<BITS> parameter.
1529
1530 =item @iothreadinfo = $dom->get_iothread_info($flags=0)
1531
1532 Obtain information about the state of all IOThreads in a running
1533 guest domain. The returned list will have one element for each IOThread,
1534 where each elements contains a hash reference. The keys in the hash
1535 are, C<number> the IOThread number and C<affinity> giving the allowed
1536 scheduler placement. The value for C<affinity> is a
1537 string representing a bitmask against physical CPUs, 8 cpus per
1538 character. To extract the bits use the C<unpack> function with
1539 the C<b*> template.
1540
1541 =item $dom->pin_iothread($iothread, $mask)
1542
1543 Pin the IOThread given by index C<$iothread> to physical CPUs
1544 given by C<$mask>. The C<$mask> is a string representing a bitmask
1545 against physical CPUs, 8 cpus per character.
1546
1547 =item $dom->add_iothread($iothread, $flags=0)
1548
1549 Add a new IOThread by the C<$iothread> value to the guest domain.
1550 The C<$flags> parameter accepts one or more the CONFIG OPTION constants
1551 documented later, and defaults to 0 if omitted.
1552
1553 =item $dom->del_iothread($iothread, $flags=0)
1554
1555 Delete an existing IOThread by the C<$iothread> value from the guest domain.
1556 The C<$flags> parameter accepts one or more the CONFIG OPTION constants
1557 documented later, and defaults to 0 if omitted.
1558
1559 =item $dom->set_iothread($iothread, $params, $flags=0)
1560
1561 Set parameters for the IOThread by the C<$iothread> value on the guest domain.
1562 The C<$params> parameter is a hash reference whose keys are the
1563 C<IOTHREAD STATS> constants documented later.
1564 The C<$flags> parameter accepts one or more the CONFIG OPTION constants
1565 documented later, and defaults to 0 if omitted.
1566
1567 =item my @stats = $dom->get_cpu_stats($startCpu, $numCpus, $flags=0)
1568
1569 Requests the guests host physical CPU usage statistics, starting
1570 from host CPU <$startCpu> counting up to C<$numCpus>. If C<$startCpu>
1571 is -1 and C<$numCpus> is 1, then the utilization across all CPUs
1572 is returned. Returns an array of hash references, each element
1573 containing stats for one CPU.
1574
1575 =item my $info = $dom->get_job_info()
1576
1577 Returns a hash reference summarising the execution state of the
1578 background job. The elements of the hash are as follows:
1579
1580 =over 4
1581
1582 =item type
1583
1584 The type of job, one of the JOB TYPE constants listed later in
1585 this document.
1586
1587 =item timeElapsed
1588
1589 The elapsed time in milliseconds
1590
1591 =item timeRemaining
1592
1593 The expected remaining time in milliseconds. Only set if the
1594 C<type> is JOB_UNBOUNDED.
1595
1596 =item dataTotal
1597
1598 The total amount of data expected to be processed by the job, in bytes.
1599
1600 =item dataProcessed
1601
1602 The current amount of data processed by the job, in bytes.
1603
1604 =item dataRemaining
1605
1606 The expected amount of data remaining to be processed by the job, in bytes.
1607
1608 =item memTotal
1609
1610 The total amount of memory expected to be processed by the job, in bytes.
1611
1612 =item memProcessed
1613
1614 The current amount of memory processed by the job, in bytes.
1615
1616 =item memRemaining
1617
1618 The expected amount of memory remaining to be processed by the job, in bytes.
1619
1620 =item fileTotal
1621
1622 The total amount of file expected to be processed by the job, in bytes.
1623
1624 =item fileProcessed
1625
1626 The current amount of file processed by the job, in bytes.
1627
1628 =item fileRemaining
1629
1630 The expected amount of file remaining to be processed by the job, in bytes.
1631
1632 =back
1633
1634 =item my ($type, $stats) = $dom->get_job_stats($flags=0)
1635
1636 Returns an array summarising the execution state of the
1637 background job. The C<$type> value is one of the JOB TYPE
1638 constants listed later in this document. The C<$stats>
1639 value is a hash reference, whose elements are one of the
1640 following constants.
1641
1642 =over 4
1643
1644 =item type
1645
1646 The type of job, one of the JOB TYPE constants listed later in
1647 this document.
1648
1649 The C<$flags> parameter defaults to zero and can take one of
1650 the following constants.
1651
1652 =over 4
1653
1654 =item Sys::Virt::Domain::JOB_STATS_COMPLETED
1655
1656 Return the stats of the most recently completed job.
1657
1658 =item Sys::Virt::Domain::JOB_STATS_KEEP_COMPLETED
1659
1660 Don't clear the completed stats after reading them.
1661
1662 =back
1663
1664 =item Sys::Virt::Domain::JOB_TIME_ELAPSED
1665
1666 The elapsed time in milliseconds
1667
1668 =item Sys::Virt::Domain::JOB_TIME_ELAPSED_NET
1669
1670 Time in milliseconds since the beginning of the migration job NOT
1671 including the time required to transfer control flow from the
1672 source host to the destination host.
1673
1674 =item Sys::Virt::Domain::JOB_TIME_REMAINING
1675
1676 The expected remaining time in milliseconds. Only set if the
1677 C<type> is JOB_UNBOUNDED.
1678
1679 =item Sys::Virt::Domain::JOB_DATA_TOTAL
1680
1681 The total amount of data expected to be processed by the job, in bytes.
1682
1683 =item Sys::Virt::Domain::JOB_DATA_PROCESSED
1684
1685 The current amount of data processed by the job, in bytes.
1686
1687 =item Sys::Virt::Domain::JOB_DATA_REMAINING
1688
1689 The expected amount of data remaining to be processed by the job, in bytes.
1690
1691 =item Sys::Virt::Domain::JOB_MEMORY_TOTAL
1692
1693 The total amount of memory expected to be processed by the job, in bytes.
1694
1695 =item Sys::Virt::Domain::JOB_MEMORY_PROCESSED
1696
1697 The current amount of memory processed by the job, in bytes.
1698
1699 =item Sys::Virt::Domain::JOB_MEMORY_REMAINING
1700
1701 The expected amount of memory remaining to be processed by the job, in bytes.
1702
1703 =item Sys::Virt::Domain::JOB_MEMORY_CONSTANT
1704
1705 The number of pages filled with a constant byte which have
1706 been transferred
1707
1708 =item Sys::Virt::Domain::JOB_MEMORY_NORMAL
1709
1710 The number of pages transferred without any compression
1711
1712 =item Sys::Virt::Domain::JOB_MEMORY_NORMAL_BYTES
1713
1714 The number of bytes transferred without any compression
1715
1716 =item Sys::Virt::Domain::JOB_MEMORY_BPS
1717
1718 The bytes per second transferred
1719
1720 =item Sys::Virt::Domain::JOB_MEMORY_DIRTY_RATE
1721
1722 The number of memory pages dirtied per second
1723
1724 =item Sys::Virt::Domain::JOB_MEMORY_PAGE_SIZE
1725
1726 The memory page size in bytes
1727
1728 =item Sys::Virt::Domain::JOB_MEMORY_ITERATION
1729
1730 The total number of iterations over guest memory
1731
1732 =item Sys::Virt::Domain::JOB_MEMORY_POSTCOPY_REQS
1733
1734 The number of page requests received from the destination host during post-copy migration.
1735
1736 =item Sys::Virt::Domain::JOB_DISK_TOTAL
1737
1738 The total amount of file expected to be processed by the job, in bytes.
1739
1740 =item Sys::Virt::Domain::JOB_DISK_PROCESSED
1741
1742 The current amount of file processed by the job, in bytes.
1743
1744 =item Sys::Virt::Domain::JOB_DISK_REMAINING
1745
1746 The expected amount of file remaining to be processed by the job, in bytes.
1747
1748 =item Sys::Virt::Domain::JOB_DISK_BPS
1749
1750 The bytes per second transferred
1751
1752 =item Sys::Virt::Domain::JOB_AUTO_CONVERGE_THROTTLE
1753
1754 The percentage by which vCPUs are currently throttled
1755
1756 =item Sys::Virt::Domain::JOB_COMPRESSION_CACHE
1757
1758 The size of the compression cache in bytes
1759
1760 =item Sys::Virt::Domain::JOB_COMPRESSION_BYTES
1761
1762 The number of compressed bytes transferred
1763
1764 =item Sys::Virt::Domain::JOB_COMPRESSION_PAGES
1765
1766 The number of compressed pages transferred
1767
1768 =item Sys::Virt::Domain::JOB_COMPRESSION_CACHE_MISSES
1769
1770 The number of changing pages not in compression cache
1771
1772 =item Sys::Virt::Domain::JOB_COMPRESSION_OVERFLOW
1773
1774 The number of changing pages in the compression cache but sent
1775 uncompressed since the compressed page was larger than the
1776 non-compressed page.
1777
1778 =item Sys::Virt::Domain::JOB_DOWNTIME
1779
1780 The number of milliseconds of downtime expected during
1781 migration switchover.
1782
1783 =item Sys::Virt::Domain::JOB_DOWNTIME_NET
1784
1785 Real measured downtime (ms) NOT including the time required to
1786 transfer control flow from the source host to the destination
1787 host.
1788
1789 =item Sys::Virt::Domain::JOB_SETUP_TIME
1790
1791 The number of milliseconds of time doing setup of the job
1792
1793 =item Sys::Virt::Domain::JOB_OPERATION
1794
1795 The type of operation associated with the job
1796
1797 =item Sys::Virt::Domain::JOB_SUCCESS
1798
1799 Whether the job was successfully completed.
1800
1801 =item Sys::Virt::Domain::JOB_DISK_TEMP_TOTAL
1802
1803 Possible total temporary disk space for the job in bytes
1804
1805 =item Sys::Virt::Domain::JOB_DISK_TEMP_USED
1806
1807 Current total temporary disk space for the job in bytes
1808
1809 =item Sys::Virt::Domain::JOB_ERRMSG
1810
1811 The error message from a failed job
1812
1813 =item Sys::Virt::Domain::JOB_VFIO_DATA_TRANSFERRED
1814
1815 Total data transferred for VFIO devices
1816
1817 =back
1818
1819 The values for the Sys::Virt::Domain::JOB_OPERATION field are
1820
1821 =over 4
1822
1823 =item Sys::Virt::Domain::JOB_OPERATION_UNKNOWN
1824
1825 No known job type
1826
1827 =item Sys::Virt::Domain::JOB_OPERATION_START
1828
1829 The guest is starting
1830
1831 =item Sys::Virt::Domain::JOB_OPERATION_SAVE
1832
1833 The guest is saving to disk
1834
1835 =item Sys::Virt::Domain::JOB_OPERATION_RESTORE
1836
1837 The guest is restoring from disk
1838
1839 =item Sys::Virt::Domain::JOB_OPERATION_MIGRATION_IN
1840
1841 The guest is migrating in from another host
1842
1843 =item Sys::Virt::Domain::JOB_OPERATION_MIGRATION_OUT
1844
1845 The guest is migrating out to another host
1846
1847 =item Sys::Virt::Domain::JOB_OPERATION_SNAPSHOT
1848
1849 The guest is saving a snapshot
1850
1851 =item Sys::Virt::Domain::JOB_OPERATION_SNAPSHOT_REVERT
1852
1853 The guest is reverting to a snapshot
1854
1855 =item Sys::Virt::Domain::JOB_OPERATION_DUMP
1856
1857 The guest is saving a crash dump
1858
1859 =item Sys::Virt::Domain::JOB_OPERATION_BACKUP
1860
1861 The guest is performing a block backup
1862
1863 =item Sys::Virt::Domain::JOB_OPERATION_SNAPSHOT_DELETE
1864
1865 The guest is deleting a snapshot
1866
1867 =back
1868
1869 =item $dom->abort_job($flags=0)
1870
1871 Aborts the currently executing job. Valid C<$flags> include:
1872
1873 =over 4
1874
1875 =item Sys::Virt::Domain::DOMAIN_ABORT_JOB_POSTCOPY
1876
1877 Interrupt post-copy migration. It can later be resumed using
1878 migrate APIs with C<MIGRATE_POSTCOPY_RESUME> flag.
1879
1880 =back
1881
1882 =item my $info = $dom->get_block_job_info($path, $flags=0)
1883
1884 Returns a hash reference summarising the execution state of
1885 the block job. The C<$path> parameter should be the fully
1886 qualified path of the block device being changed. Valid
1887 C<$flags> include:
1888
1889 =over 4
1890
1891 =item Sys::Virt::Domain::BLOCK_JOB_INFO_BANDWIDTH_BYTES
1892
1893 Treat bandwidth value as bytes instead of MiB.
1894
1895 =back
1896
1897 =item $dom->set_block_job_speed($path, $bandwidth, $flags=0)
1898
1899 Change the maximum I/O bandwidth used by the block job that
1900 is currently executing for C<$path>. The C<$bandwidth> argument
1901 is specified in MB/s. The C<$flags> parameter
1902 can take the bitwise union of the values:
1903
1904 =over 4
1905
1906 =item Sys::Virt::Domain::BLOCK_JOB_SPEED_BANDWIDTH_BYTES
1907
1908 The C<$bandwidth> parameter value is measured in bytes/s
1909 instead of MB/s.
1910
1911 =back
1912
1913 =item $dom->abort_block_job($path, $flags=0)
1914
1915 Abort the current job that is executing for the block device
1916 associated with C<$path>
1917
1918 =item $dom->block_pull($path, $bandwidth, $flags=0)
1919
1920 Merge the backing files associated with C<$path> into the
1921 top level file. The C<$bandwidth> parameter specifies the
1922 maximum I/O rate to allow in MB/s. The C<$flags> parameter
1923 can take the bitwise union of the values:
1924
1925 =over 4
1926
1927 =item Sys::Virt::Domain::BLOCK_PULL_BANDWIDTH_BYTES
1928
1929 The C<$bandwidth> parameter value is measured in bytes/s
1930 instead of MB/s.
1931
1932 =back
1933
1934 =item $dom->block_rebase($path, $base, $bandwidth, $flags=0)
1935
1936 Switch the backing path associated with C<$path> to instead
1937 use C<$base>. The C<$bandwidth> parameter specifies the
1938 maximum I/O rate to allow in MB/s. The C<$flags> parameter
1939 can take the bitwise union of the values:
1940
1941 =over 4
1942
1943 =item Sys::Virt::Domain::BLOCK_REBASE_BANDWIDTH_BYTES
1944
1945 The C<$bandwidth> parameter value is measured in bytes/s
1946 instead of MB/s.
1947
1948 =back
1949
1950 =item $dom->block_copy($path, $destxml, $params, $flags=0)
1951
1952 Copy contents of a disk image <$path> into the target volume
1953 described by C<$destxml> which follows the schema of the
1954 <disk> element in the domain XML. The C<$params> parameter
1955 is a hash of optional parameters to control the process
1956
1957 =over 4
1958
1959 =item Sys::Virt::Domain::BLOCK_COPY_BANDWIDTH
1960
1961 The maximum bandwidth in bytes per second.
1962
1963 =item Sys::Virt::Domain::BLOCK_COPY_GRANULARITY
1964
1965 The granularity in bytes of the copy process
1966
1967 =item Sys::Virt::Domain::BLOCK_COPY_BUF_SIZE
1968
1969 The maximum amount of data in flight in bytes.
1970
1971 =back
1972
1973 =item $dom->block_commit($path, $base, $top, $bandwidth, $flags=0)
1974
1975 Commit changes there were made to the temporary top level file C<$top>.
1976 Takes all the differences between C<$top> and C<$base> and merge them
1977 into C<$base>. The C<$bandwidth> parameter specifies the
1978 maximum I/O rate to allow in MB/s. The C<$flags> parameter
1979 can take the bitwise union of the values:
1980
1981 =over 4
1982
1983 =item Sys::Virt::Domain::BLOCK_COMMIT_BANDWIDTH_BYTES
1984
1985 The C<$bandwidth> parameter value is measured in bytes
1986 instead of MB/s.
1987
1988 =back
1989
1990 =item $count = $dom->num_of_snapshots()
1991
1992 Return the number of saved snapshots of the domain
1993
1994 =item @names = $dom->list_snapshot_names()
1995
1996 List the names of all saved snapshots. The names can be
1997 used with the C<lookup_snapshot_by_name>
1998
1999 =item @snapshots = $dom->list_snapshots()
2000
2001 Return a list of all snapshots currently known to the domain. The elements
2002 in the returned list are instances of the L<Sys::Virt::DomainSnapshot> class.
2003 This method requires O(n) RPC calls, so the C<list_all_snapshots> method is
2004 recommended as a more efficient alternative.
2005
2006 =cut
2007
2008
2009 sub list_snapshots {
2010 my $self = shift;
2011
2012 my $nnames = $self->num_of_snapshots();
2013 my @names = $self->list_snapshot_names($nnames);
2014
2015 my @snapshots;
2016 foreach my $name (@names) {
2017 eval {
2018 push @snapshots, Sys::Virt::DomainSnapshot->_new(domain => $self, name => $name);
2019 };
2020 if ($@) {
2021 # nada - snapshot went away before we could look it up
2022 };
2023 }
2024 return @snapshots;
2025 }
2026
2027
2028
2029 =item my @snapshots = $dom->list_all_snapshots($flags)
2030
2031 Return a list of all domain snapshots associated with this domain.
2032 The elements in the returned list are instances of the
2033 L<Sys::Virt::DomainSnapshot> class. The C<$flags> parameter can be
2034 used to filter the list of return domain snapshots.
2035
2036 =item my $snapshot = $dom->get_snapshot_by_name($name)
2037
2038 Return the domain snapshot with a name of C<$name>. The returned object is
2039 an instance of the L<Sys::Virt::DomainSnapshot> class.
2040
2041 =cut
2042
2043 sub get_snapshot_by_name {
2044 my $self = shift;
2045 my $name = shift;
2046
2047 return Sys::Virt::DomainSnapshot->_new(domain => $self, name => $name);
2048 }
2049
2050 =item $dom->has_current_snapshot()
2051
2052 Returns a true value if the domain has a currently active snapshot
2053
2054 =item $snapshot = $dom->current_snapshot()
2055
2056 Returns the currently active snapshot for the domain.
2057
2058 =item $snapshot = $dom->create_snapshot($xml[, $flags])
2059
2060 Create a new snapshot from the C<$xml>. The C<$flags> parameter accepts
2061 the B<SNAPSHOT CREATION> constants listed in C<Sys::Virt::DomainSnapshots>.
2062
2063 =cut
2064
2065 sub create_snapshot {
2066 my $self = shift;
2067 my $xml = shift;
2068 my $flags = shift;
2069
2070 my $snapshot = Sys::Virt::DomainSnapshot->_new(domain => $self, xml => $xml, flags => $flags);
2071
2072 return $snapshot;
2073 }
2074
2075 =item my @checkpoints = $dom->list_all_checkpoints($flags)
2076
2077 Return a list of all domain checkpoints associated with this domain.
2078 The elements in the returned list are instances of the
2079 L<Sys::Virt::DomainCheckpoint> class. The C<$flags> parameter can be
2080 used to filter the list of return domain checkpoints.
2081
2082 =item my $checkpoint = $dom->get_checkpoint_by_name($name)
2083
2084 Return the domain checkpoint with a name of C<$name>. The returned object is
2085 an instance of the L<Sys::Virt::DomainCheckpoint> class.
2086
2087 =cut
2088
2089 sub get_checkpoint_by_name {
2090 my $self = shift;
2091 my $name = shift;
2092
2093 return Sys::Virt::DomainCheckpoint->_new(domain => $self, name => $name);
2094 }
2095
2096 =item $checkpoint = $dom->create_checkpoint($xml[, $flags])
2097
2098 Create a new checkpoint from the C<$xml>. The C<$flags> parameter accepts
2099 the B<CHECKPOINT CREATION> constants listed in C<Sys::Virt::DomainCheckpoints>.
2100
2101 =cut
2102
2103 sub create_checkpoint {
2104 my $self = shift;
2105 my $xml = shift;
2106 my $flags = shift;
2107
2108 my $checkpoint = Sys::Virt::DomainCheckpoint->_new(domain => $self, xml => $xml, flags => $flags);
2109
2110 return $checkpoint;
2111 }
2112
2113 1;
2114
2115 =item $dom->backup_begin($backupxml, $checkpointxml=undef, $flags=0);
2116
2117 Start a point-in-time backup job for the specified disks of a
2118 running domain. The C<$backupxml> parameter describes the
2119 backup operation, including which disks to use. The optional
2120 C<$checkpointxml> parameter can be used to create a checkpoint
2121 covering to the same point in time as the backup. The optional
2122 C<$flags> parameter can be one of the following constants:
2123
2124 =over 4
2125
2126 =item Sys::Virt::Domain::BACKUP_BEGIN_REUSE_EXTERNAL
2127
2128 Assume that the output/temporary files for the backup have been
2129 precreated by the caller with the correct size and format.
2130
2131 =item Sys::Virt::Domain::BACKUP_BEGIN_PRESERVE_SHUTDOWN_DOMAIN
2132
2133 Preserve the domain if the guest OS shuts down while the backup
2134 is running.
2135
2136 =back
2137
2138 =item $xml = $dom->backup_get_xml_description($flags=0);
2139
2140 Get the XML description of the currently executing backup
2141 job. If there is no backup job then an error is raised.
2142
2143 =item $dom->fs_trim($mountPoint, $minimum, $flags=0);
2144
2145 Issue an FS_TRIM command to the device at C<$mountPoint>
2146 to remove chunks of unused space that are at least
2147 C<$minimum> bytes in length. C<$flags> is currently
2148 unused and defaults to zero.
2149
2150 =item $dom->fs_freeze(\@mountPoints, $flags=0);
2151
2152 Freeze all the filesystems associated with the C<@mountPoints>
2153 array reference. If <@mountPoints> is an empty list, then all
2154 filesystems will be frozen. C<$flags> is currently
2155 unused and defaults to zero.
2156
2157 =item $dom->fs_thaw(\@mountPoints, $flags=0);
2158
2159 Thaw all the filesystems associated with the C<@mountPoints>
2160 array reference. If <@mountPoints> is an empty list, then all
2161 filesystems will be thawed. C<$flags> is currently
2162 unused and defaults to zero.
2163
2164 =item @fslist = $dom->get_fs_info($flags=0);
2165
2166 Obtain a list of all guest filesystems. The returned list will
2167 contain one element for each filesystem, whose value will be
2168 a hash reference with the following keys
2169
2170 =over 4
2171
2172 =item name
2173
2174 The name of the guest device that is mounted
2175
2176 =item fstype
2177
2178 The filesystem type (e.g. 'ext4', 'fat', 'ntfs', etc)
2179
2180 =item mountpoint
2181
2182 The location in the filesystem tree of the mount
2183
2184 =item devalias
2185
2186 An array reference containing list of device aliases
2187 associated with the guest device. The device aliases
2188 correspond to disk target names in the guest XML
2189 configuration
2190
2191 =back
2192
2193 =item @nics = $dom->get_interface_addresses($src, $flags=0);
2194
2195 Obtain a list of all guest network interfaces. The C<$src>
2196 parameter is one of the constants
2197
2198 =over 4
2199
2200 =item Sys::Virt::Domain::INTERFACE_ADDRESSES_SRC_LEASE
2201
2202 Extract the DHCP server lease information
2203
2204 =item Sys::Virt::Domain::INTERFACE_ADDRESSES_SRC_AGENT
2205
2206 Query the guest OS via an agent
2207
2208 =item Sys::Virt::Domain::INTERFACE_ADDRESSES_SRC_ARP
2209
2210 Extract from the local ARP tables
2211
2212 =back
2213
2214 The returned list will contain one element for each interface.
2215 The values in the list will be a hash reference with the
2216 following keys
2217
2218 =over 4
2219
2220 =item name
2221
2222 The name of the guest interface that is mounted
2223
2224 =item hwaddr
2225
2226 The hardware address, aka MAC, if available.
2227
2228 =item addrs
2229
2230 An array reference containing list of IP addresses
2231 associated with the guest NIC. Each element in the
2232 array is a further hash containing
2233
2234 =over 4
2235
2236 =item addr
2237
2238 The IP address string
2239
2240 =item prefix
2241
2242 The IP address network prefix
2243
2244 =item type
2245
2246 The IP address type (IPv4 vs IPv6)
2247
2248 =back
2249
2250 =back
2251
2252 =item $dom->send_process_signal($pid, $signum, $flags=0);
2253
2254 Send the process C<$pid> the signal C<$signum>. The
2255 C<$signum> value must be one of the constants listed
2256 later, not a POSIX or Linux signal value. C<$flags>
2257 is currently unused and defaults to zero.
2258
2259 =item $dom->set_block_threshold($dev, $threshold, $flags=0);
2260
2261 Set the threshold level for delivering the
2262 EVENT_ID_BLOCK_THRESHOLD if the device or backing chain element
2263 described by C<$dev> is written beyond the set C<$threshold>
2264 level. The threshold level is unset once the event fires. The
2265 event might not be delivered at all if libvirtd was not running
2266 at the moment when the threshold was reached.
2267
2268 =item $dom->set_lifecycle_action($type, $action, $flags=0)
2269
2270 Changes the actions of lifecycle events for domain represented as
2271 <on_$type>$action</on_$type> in the domain XML.
2272
2273 =item $info = $dom->get_launch_security_info($flags=0)
2274
2275 Get information about the domain launch security policy. C<$flags>
2276 is currently unused and defaults to zero. The returned hash may
2277 contain the following keys
2278
2279 =over 4
2280
2281 =item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_MEASUREMENT
2282
2283 The AMD SEV launch measurement
2284
2285 =item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_API_MAJOR
2286
2287 The host SEV API major version
2288
2289 =item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_API_MINOR
2290
2291 The host SEV API minor version
2292
2293 =item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_BUILD_ID
2294
2295 The host SEV firmware build ID
2296
2297 =item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_POLICY
2298
2299 The guest SEV policy
2300
2301 =item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_SNP_POLICY
2302
2303 The guest SEV-SNP policy
2304
2305 =back
2306
2307 =item $dom->set_launch_security_state(\%params, $flags=0)
2308
2309 Set information about the domain launch security state. C<$flags>
2310 is currently unused and defaults to zero. The provided hash may
2311 contain the following keys
2312
2313 =over 4
2314
2315 =item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_SECRET
2316
2317 The SEV secret string to inject
2318
2319 =item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_SECRET_HEADER
2320
2321 The SEV secret header string to inject
2322
2323 =item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_SECRET_SET_ADDRESS
2324
2325 The address at which to inject the SEV secret. If omitted
2326 it can be automatically determined from the firmware
2327
2328 =back
2329
2330 =item $info = $dom->get_guest_info($types, $flags=0)
2331
2332 Get information about the domain guest configuration. The C<$types>
2333 parameter determines what pieces of information are returned and
2334 should be the bitwise or of the following constants:
2335
2336 =over 4
2337
2338 =item Sys::Virt::Domain::GUEST_INFO_USERS
2339
2340 Active user information.
2341
2342 The following keys will be used for the returned parameters
2343
2344 =over 4
2345
2346 =item Sys::Virt::Domain::GUEST_INFO_USER_COUNT
2347
2348 The number of active users on this domain as an unsigned int.
2349
2350 =item Sys::Virt::Domain::GUEST_INFO_USER_PREFIX
2351
2352 The parameter name prefix to access each user entry. Concatenate the
2353 prefix, the entry number formatted as an unsigned integer and one of the
2354 user suffix parameters to form a complete parameter name.
2355
2356 =item Sys::Virt::Domain::GUEST_INFO_USER_SUFFIX_NAME
2357
2358 Username of the user as a string.
2359
2360 =item Sys::Virt::Domain::GUEST_INFO_USER_SUFFIX_DOMAIN
2361
2362 Domain of the user as a string (may only be present on certain guest
2363 types).
2364
2365 =item Sys::Virt::Domain::GUEST_INFO_USER_SUFFIX_LOGIN_TIME
2366
2367 The login time of a user in milliseconds since the epoch as unsigned long
2368 long.
2369
2370 =back
2371
2372 =item Sys::Virt::Domain::GUEST_INFO_OS
2373
2374 Misc operating system information.
2375
2376 The following keys will be used for the returned parameters
2377
2378 =over 4
2379
2380 =item Sys::Virt::Domain::GUEST_INFO_OS_ID
2381
2382 A string identifying the operating system.
2383
2384 =item Sys::Virt::Domain::GUEST_INFO_OS_NAME
2385
2386 The name of the operating system, suitable for presentation to a user, as
2387 a string.
2388
2389 =item Sys::Virt::Domain::GUEST_INFO_OS_PRETTY_NAME
2390
2391 A pretty name for the operating system, suitable for presentation to a
2392 user, as a string.
2393
2394 =item Sys::Virt::Domain::GUEST_INFO_OS_VERSION
2395
2396 The version of the operating system suitable for presentation to a user,
2397 as a string.
2398
2399 =item Sys::Virt::Domain::GUEST_INFO_OS_VERSION_ID
2400
2401 The version id of the operating system suitable for processing by scripts,
2402 as a string.
2403
2404 =item Sys::Virt::Domain::GUEST_INFO_OS_KERNEL_RELEASE
2405
2406 The release of the operating system kernel, as a string.
2407
2408 =item Sys::Virt::Domain::GUEST_INFO_OS_KERNEL_VERSION
2409
2410 The version of the operating system kernel, as a string.
2411
2412 =item Sys::Virt::Domain::GUEST_INFO_OS_MACHINE
2413
2414 The machine hardware name as a string.
2415
2416 =item Sys::Virt::Domain::GUEST_INFO_OS_VARIANT
2417
2418 A specific variant or edition of the operating system suitable for
2419 presentation to a user, as a string.
2420
2421 =item Sys::Virt::Domain::GUEST_INFO_OS_VARIANT_ID
2422
2423 The id for a specific variant or edition of the operating system, as a
2424 string.
2425
2426 =back
2427
2428 =item Sys::Virt::Domain::GUEST_INFO_TIMEZONE
2429
2430 The guest timezone.
2431
2432 The following keys will be used for the returned parameters
2433
2434 =over 4
2435
2436 =item Sys::Virt::Domain::GUEST_INFO_TIMEZONE_NAME
2437
2438 The name of the timezone as a string.
2439
2440 =item Sys::Virt::Domain::GUEST_INFO_TIMEZONE_OFFSET
2441
2442 The offset to UTC in seconds as an int.
2443
2444 =back
2445
2446 =item Sys::Virt::Domain::GUEST_INFO_HOSTNAME
2447
2448 The guest hostname.
2449
2450 The following keys will be used for the returned parameters
2451
2452 =over 4
2453
2454 =item Sys::Virt::Domain::GUEST_INFO_HOSTNAME_HOSTNAME
2455
2456 The hostname of the domain as a string.
2457
2458 =back
2459
2460 =item Sys::Virt::Domain::GUEST_INFO_FILESYSTEM
2461
2462 Filesystem mount information.
2463
2464 The following keys will be used for the returned parameters
2465
2466 =over 4
2467
2468 =item Sys::Virt::Domain::GUEST_INFO_FS_COUNT
2469
2470 The number of filesystems defined on this domain as an unsigned int.
2471
2472 =item Sys::Virt::Domain::GUEST_INFO_FS_PREFIX
2473
2474 The parameter name prefix to access each filesystem entry. Concatenate the
2475 prefix, the entry number formatted as an unsigned integer and one of the
2476 filesystem suffix parameters to form a complete parameter name.
2477
2478 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_MOUNTPOINT
2479
2480 The path to the mount point for the filesystem as a string.
2481
2482 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_NAME
2483
2484 Device name in the guest (e.g. "sda1") as a string.
2485
2486 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_FSTYPE
2487
2488 The type of filesystem as a string.
2489
2490 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_TOTAL_BYTES
2491
2492 The total size of the filesystem as an unsigned long long.
2493
2494 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_USED_BYTES
2495
2496 The number of bytes used in the filesystem as an unsigned long long.
2497
2498 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_DISK_COUNT
2499
2500 The number of disks targeted by this filesystem as an int.
2501
2502 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_DISK_PREFIX
2503
2504 The parameter name prefix to access each disk entry. Concatenate the
2505 filesystem prefix, the filesystem entry number formatted as an unsigned
2506 integer, the disk prefix, the disk entry number formatted as an unsigned
2507 integer and one of the disk suffix parameters to form a complete parameter
2508 name.
2509
2510 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_DISK_SUFFIX_ALIAS
2511
2512 The device alias of the disk (e.g. sda) as a string.
2513
2514 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_DISK_SUFFIX_SERIAL
2515
2516 The serial number of the disk as a string.
2517
2518 =item Sys::Virt::Domain::GUEST_INFO_FS_SUFFIX_DISK_SUFFIX_DEVICE
2519
2520 The device node of the disk as a string.
2521
2522 =back
2523
2524 =item Sys::Virt::Domain::GUEST_INFO_DISKS
2525
2526 Block device information.
2527
2528 The following keys will be used for the returned parameters
2529
2530 =over 4
2531
2532 =item Sys::Virt::Domain::GUEST_INFO_DISK_COUNT
2533
2534 The number of disks defined on this domain as an unsigned int.
2535
2536 =item Sys::Virt::Domain::GUEST_INFO_DISK_PREFIX
2537
2538 The parameter name prefix to access each disk entry. Concatenate the
2539 prefix, the entry number formatted as an unsigned integer and one of the
2540 disk suffix parameters to form a complete parameter name.
2541
2542 =item Sys::Virt::Domain::GUEST_INFO_DISK_SUFFIX_NAME
2543
2544 Device node (Linux) or device UNC (Windows) as a string.
2545
2546 =item Sys::Virt::Domain::GUEST_INFO_DISK_SUFFIX_PARTITION
2547
2548 Whether this is a partition (true) or disk (false) as a boolean.
2549
2550 =item Sys::Virt::Domain::GUEST_INFO_DISK_SUFFIX_DEPENDENCY_COUNT
2551
2552 e.g. for LVs of the LVM this will hold the list of PVs, for LUKS encrypted
2553 volume this will contain the disk where the volume is placed. (Linux).
2554
2555 =item Sys::Virt::Domain::GUEST_INFO_DISK_SUFFIX_DEPENDENCY_PREFIX
2556
2557 The parameter name prefix to access each dependency entry. Concatenate the
2558 disk prefix, the disk entry number formatted as an unsigned integer, the
2559 dependency prefix, the dependency entry number formatted as an unsigned
2560 integer and one of the dependency suffix parameters to form a complete
2561 parameter name.
2562
2563 =item Sys::Virt::Domain::GUEST_INFO_DISK_SUFFIX_DEPENDENCY_SUFFIX_NAME
2564
2565 A dependency name as a string.
2566
2567 =item Sys::Virt::Domain::GUEST_INFO_DISK_SUFFIX_SERIAL
2568
2569 Optional disk serial number as a string.
2570
2571 =item Sys::Virt::Domain::GUEST_INFO_DISK_SUFFIX_ALIAS
2572
2573 The device alias of the disk (e.g. sda) as a string.
2574
2575 =item Sys::Virt::Domain::GUEST_INFO_DISK_SUFFIX_GUEST_ALIAS
2576
2577 Optional alias assigned to the disk, on Linux this is a name assigned by
2578 device mapper, as a string.
2579
2580 =item Sys::Virt::Domain::GUEST_INFO_DISK_SUFFIX_GUEST_BUS
2581
2582 Disk bus as reported by the guest OS.
2583
2584 =back
2585
2586 =item Sys::Virt::Domain::GUEST_INFO_INTERFACES
2587
2588 Network interfaces information.
2589
2590 The following keys will be used for the returned parameters
2591
2592 =over 4
2593
2594 =item Sys::Virt::Domain::GUEST_INFO_IF_COUNT
2595
2596 The number of interfaces defined on this domain as an unsigned int.
2597
2598 =item Sys::Virt::Domain::GUEST_INFO_IF_PREFIX
2599
2600 The parameter name prefix to access each interface entry. Concatenate the
2601 prefix, the entry number formatted as an unsigned integer and one of the
2602 interface suffix parameters to form a complete parameter name.
2603
2604 =item Sys::Virt::Domain::GUEST_INFO_IF_SUFFIX_NAME
2605
2606 Name in the guest (e.g. ``eth0``) for the interface as a string.
2607
2608 =item Sys::Virt::Domain::GUEST_INFO_IF_SUFFIX_HWADDR
2609
2610 Hardware address in the guest of the interface as a string.
2611
2612 =item Sys::Virt::Domain::GUEST_INFO_IF_SUFFIX_ADDR_COUNT
2613
2614 The number of IP addresses of interface as an unsigned int.
2615
2616 =item Sys::Virt::Domain::GUEST_INFO_IF_SUFFIX_ADDR_PREFIX
2617
2618 The parameter name prefix to access each address entry. Concatenate the
2619 interface prefix, the interface entry number formatted as an unsigned
2620 integer, the address prefix, the address entry number formatted as an
2621 unsigned integer and one of the address suffix parameters to form a
2622 complete parameter name.
2623
2624 =item Sys::Virt::Domain::GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_TYPE
2625
2626 The IP address type (e.g. ipv4) as a string.
2627
2628 =item Sys::Virt::Domain::GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_ADDR
2629
2630 The IP address as a string.
2631
2632 =item Sys::Virt::Domain::GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_PREFIX
2633
2634 The prefix of IP address as an unsigned int.
2635
2636 =back
2637
2638 =item Sys::Virt::Domain::GUEST_INFO_LOAD
2639
2640 System load information.
2641
2642 The following keys will be used for the returned parameters
2643
2644 =over 4
2645
2646 =item Sys::Virt::Domain::GUEST_INFO_LOAD_1M
2647
2648 The guest load averaged over 1 minute as a double
2649
2650 =item Sys::Virt::Domain::GUEST_INFO_LOAD_5M
2651
2652 The guest load averaged over 5 minutes as a double
2653
2654 =item Sys::Virt::Domain::GUEST_INFO_LOAD_15M
2655
2656 The guest load averaged over 15 minutes as a double
2657
2658 =back
2659
2660 =item Sys::Virt::Domain::GUEST_INFO_DEVICES
2661
2662 Guest devices information.
2663
2664 =over 4
2665
2666 =item Sys::Virt::Domain::GUEST_INFO_DEVICE_COUNT
2667
2668 The number of guest devices that detailed information is fetched for as
2669 unsigned int.
2670
2671 =item Sys::Virt::Domain::GUEST_INFO_DEVICE_PREFIX
2672
2673 The parameter name prefix to access each device entry. Concatenate the
2674 prefix, the entry number formatted as an unsigned integer and one of the
2675 device suffix parameters to form a complete parameter name.
2676
2677 =item Sys::Virt::Domain::GUEST_INFO_DEVICE_SUFFIX_DRIVER_DATE
2678
2679 Driver release date in seconds since the epoch (e.g. 1736726400) as long
2680 long.
2681
2682 =item Sys::Virt::Domain::GUEST_INFO_DEVICE_SUFFIX_DRIVER_NAME
2683
2684 Name of the device driver (e.g. ``VirtIO Balloon Driver``) as a string.
2685
2686 =item Sys::Virt::Domain::GUEST_INFO_DEVICE_SUFFIX_DRIVER_VERSION
2687
2688 Driver version (e.g. ``100.100.104.27100``) as a string.
2689
2690 =item Sys::Virt::Domain::GUEST_INFO_DEVICE_SUFFIX_ID_TYPE
2691
2692 Device identification (e.g. ``pci``) as a string.
2693
2694 =item Sys::Virt::Domain::GUEST_INFO_DEVICE_SUFFIX_PCI_DEVICE
2695
2696 PCI device (a device with GUEST_INFO_DEVICE_SUFFIX_ID_TYPE equal to
2697 ``pci``) device id (e.g. 4165) as a unsigned int.
2698
2699 =item Sys::Virt::Domain::GUEST_INFO_DEVICE_SUFFIX_PCI_VENDOR
2700
2701 PCI device (a device with GUEST_INFO_DEVICE_SUFFIX_ID_TYPE equal to
2702 ``pci``) vendor id (e.g. 6900) as a unsigned int.
2703
2704 =back
2705
2706 =back
2707
2708 C<$flags> is currently unused and defaults to zero.
2709
2710 =item $dom->set_agent_response_timeout($timeout, $flags=0)
2711
2712 Set the amount of time to wait for the agent to respond to a
2713 command. C<$timeout> is a positive integer representing the
2714 number of seconds to wait, or one of the constants:
2715
2716 =over 4
2717
2718 =item Sys::Virt::Domain::AGENT_RESPONSE_TIMEOUT_BLOCK
2719
2720 Wait forever with no timeout
2721
2722 =item Sys::Virt::Domain::AGENT_RESPONSE_TIMEOUT_NOWAIT
2723
2724 Don't want at all, return immediately
2725
2726 =item Sys::Virt::Domain::AGENT_RESPONSE_TIMEOUT_DEFAULT
2727
2728 Use the hypervisor driver's default timeout
2729
2730 =back
2731
2732 The C<$flags> parameter is currently unused and defaults
2733 to zero.
2734
2735 =item my @keys = $dom->authorized_ssh_keys_get($user, $flags=0)
2736
2737 Retrieve the list of authorized SSH keys for the user account C<$user>.
2738 The C<$flags> parameter is currently unused and defaults to zero.
2739
2740 =item $dom->authorized_ssh_keys_set($user, \@keys, $flags=0)
2741
2742 Update the list of authorized SSH keys for the user account C<$user>.
2743 The C<@keys> parameter should be an array reference containing the
2744 new keys, if any. The default behaviour is to set the authorized
2745 SSH keys to the exact set specified in C<@keys>. This can be modified
2746 via the C<$flags> parameter which takes the following constants
2747
2748 =over 4
2749
2750 =item Sys::Virt::Domain::AUTHORIZED_SSH_KEYS_SET_APPEND
2751
2752 Append C<@keys> to the current set of keys, rather than replacing
2753 the existing keys.
2754
2755 =item Sys::Virt::Domain::AUTHORIZED_SSH_KEYS_SET_REMOVE
2756
2757 Remove C<@keys> from the current set of keys, rather than replacing
2758 the existing keys. It is not an error if the keys do not exist.
2759
2760 =back
2761
2762 =item my @msgs = $dom->get_messages($flags=0)
2763
2764 Retrieve a list of messages associated with the domain. The
2765 optional C<$flags> parameter can accept zero or more of
2766
2767 =over 4
2768
2769 =item Sys::Virt::Domain::MESSAGE_DEPRECATION
2770
2771 Warnings about use of deprecated features
2772
2773 =item Sys::Virt::Domain::MESSAGE_TAINTING
2774
2775 Warnings about actions that have tainting the domain
2776
2777 =item Sys::Virt::Domain::MESSAGE_IOERRORS
2778
2779 Warnings about I/O errors that have occurred on the domain
2780
2781 =back
2782
2783 =item $dom->start_dirty_rate_calc($dom, $secs, $flags=0)
2784
2785 Request calculation of the domain's memory dirty rate over
2786 the next C<$secs> seconds. C<$flags> accepts one or more
2787 of
2788
2789 =over 4
2790
2791 =item Sys::Virt::Domain::DIRTYRATE_MODE_PAGE_SAMPLING
2792
2793 Page sampling mode
2794
2795 =item Sys::Virt::Domain::DIRTYRATE_MODE_DIRTY_BITMAP
2796
2797 Dirty bitmap mode
2798
2799 =item Sys::Virt::Domain::DIRTYRATE_MODE_DIRTY_RING
2800
2801 Dirty ring mode
2802
2803 =back
2804
2805 =item $dom->fd_associate($name, \@fds, $flags=0)
2806
2807 Associate a set of file descriptors in C<@fds> with
2808 the domain, giving them the name C<$name>. If C<$flags>
2809 is non-zero, it can take one or more of:
2810
2811 =over 4
2812
2813 =item Sys::Virt::Domain::FD_ASSOCIATE_SECLABEL_RESTORE
2814
2815 Attempt to restore the label when shutting down
2816
2817 =item Sys::Virt::Domain::FD_ASSOCIATE_SECLABEL_WRITABLE
2818
2819 Label the FD to permit the guest to write to it.
2820
2821 =back
2822
2823 =item $dom->graphics_reload($type, $flags=0)
2824
2825 Request a reload of graphics backend state. The C<$type>
2826 parameter specifies what type of graphics backend to reload
2827 if there are multiple present. It takes one of the constants:
2828
2829 =over 4
2830
2831 =item Sys::Virt::Domain::GRAPHICS_RELOAD_TYPE_ANY
2832
2833 Reload state for any graphics backend type
2834
2835 =item Sys::Virt::Domain::GRAPHICS_RELOAD_TYPE_VNC
2836
2837 Reload state for only VNC graphics backends
2838
2839 =back
2840
2841 The C<$flags> parameter is currently unused and defaults
2842 to zero.
2843
2844 =item $dom->del_throttle_group($group, $flags=0)
2845
2846 Delete an throttlegroup from the domain. The C<$group> to be
2847 deleted must not have a throttlefilter associated with it and can
2848 be any of the current valid group.
2849
2850 =item $dom->set_throttle_group($group, $params, $flags=0)
2851
2852 Add throttlegroup or change all of the throttlegroup options
2853 within specific domain. The C<$params> should be a hash reference
2854 whose keys are one of the BLKIO TUNING PARAMETERS constants.
2855
2856 =item $dom->announce_interface($device, $params, $flags=0)
2857
2858 Cause this domain to "announce" its network interfaces by
2859 injecting a series of "gratuitous ARP" packets into the outgoing
2860 data stream for the interface matching C<$device> (or all
2861 interfaces). This should cause local switches to direct traffic
2862 for that MAC address correctly after a topology change.
2863 The C<$params> should be a hash reference whose keys are one of the
2864 INTERFACE ANNOUNCE PARAMETERS constants.
2865
2866 =back
2867
2868
2869 =head1 CONSTANTS
2870
2871 A number of the APIs take a C<flags> parameter. In most cases
2872 passing a value of zero will be satisfactory. Some APIs, however,
2873 accept named constants to alter their behaviour. This section
2874 documents the current known constants.
2875
2876 =head2 DOMAIN STATE
2877
2878 The domain state constants are useful in interpreting the
2879 C<state> key in the hash returned by the C<get_info> method.
2880
2881 =over 4
2882
2883 =item Sys::Virt::Domain::STATE_NOSTATE
2884
2885 The domain is active, but is not running / blocked (e.g. idle)
2886
2887 =item Sys::Virt::Domain::STATE_RUNNING
2888
2889 The domain is active and running
2890
2891 =item Sys::Virt::Domain::STATE_BLOCKED
2892
2893 The domain is active, but execution is blocked
2894
2895 =item Sys::Virt::Domain::STATE_PAUSED
2896
2897 The domain is active, but execution has been paused
2898
2899 =item Sys::Virt::Domain::STATE_SHUTDOWN
2900
2901 The domain is active, but in the shutdown phase
2902
2903 =item Sys::Virt::Domain::STATE_SHUTOFF
2904
2905 The domain is inactive, and shut down.
2906
2907 =item Sys::Virt::Domain::STATE_CRASHED
2908
2909 The domain is inactive, and crashed.
2910
2911 =item Sys::Virt::Domain::STATE_PMSUSPENDED
2912
2913 The domain is active, but in power management suspend state
2914
2915 =back
2916
2917
2918 =head2 CONTROL INFO
2919
2920 The following constants can be used to determine what the
2921 guest domain control channel status is
2922
2923 =over 4
2924
2925 =item Sys::Virt::Domain::CONTROL_ERROR
2926
2927 The control channel has a fatal error
2928
2929 =item Sys::Virt::Domain::CONTROL_OK
2930
2931 The control channel is ready for jobs
2932
2933 =item Sys::Virt::Domain::CONTROL_OCCUPIED
2934
2935 The control channel is busy
2936
2937 =item Sys::Virt::Domain::CONTROL_JOB
2938
2939 The control channel is busy with a job
2940
2941 =back
2942
2943 If the status is C<Sys::Virt::Domain::CONTROL_ERROR>, then one
2944 of the following constants describes the reason
2945
2946 =over 4
2947
2948 =item Sys::Virt::Domain::CONTROL_ERROR_REASON_NONE
2949
2950 There is no reason for the error available
2951
2952 =item Sys::Virt::Domain::CONTROL_ERROR_REASON_UNKNOWN
2953
2954 The reason for the error is unknown
2955
2956 =item Sys::Virt::Domain::CONTROL_ERROR_REASON_INTERNAL
2957
2958 There was an internal error in libvirt
2959
2960 =item Sys::Virt::Domain::CONTROL_ERROR_REASON_MONITOR
2961
2962 There was an error speaking to the monitor
2963
2964 =back
2965
2966 =head2 DOMAIN CREATION
2967
2968 The following constants can be used to control the behaviour
2969 of domain creation
2970
2971 =over 4
2972
2973 =item Sys::Virt::Domain::START_PAUSED
2974
2975 Keep the guest vCPUs paused after starting the guest
2976
2977 =item Sys::Virt::Domain::START_AUTODESTROY
2978
2979 Automatically destroy the guest when the connection is closed (or fails)
2980
2981 =item Sys::Virt::Domain::START_BYPASS_CACHE
2982
2983 Do not use OS I/O cache if starting a domain with a saved state image
2984
2985 =item Sys::Virt::Domain::START_FORCE_BOOT
2986
2987 Boot the guest, even if there was a saved snapshot
2988
2989 =item Sys::Virt::Domain::START_VALIDATE
2990
2991 Validate the XML document against the XML schema
2992
2993 =item Sys::Virt::Domain::START_RESET_NVRAM
2994
2995 Reset the firmware NVRAM state from its original template
2996
2997 =back
2998
2999 =head2 DOMAIN DEFINE
3000
3001 The following constants can be used to control the behaviour
3002 of domain define operations
3003
3004 =over 4
3005
3006 =item Sys::Virt::Domain::DEFINE_VALIDATE
3007
3008 Validate the XML document against the XML schema
3009
3010 =back
3011
3012 =head2 KEYCODE SETS
3013
3014 The following constants define the set of supported keycode
3015 sets
3016
3017 =over 4
3018
3019 =item Sys::Virt::Domain::KEYCODE_SET_LINUX
3020
3021 The Linux event subsystem keycodes
3022
3023 =item Sys::Virt::Domain::KEYCODE_SET_XT
3024
3025 The original XT keycodes
3026
3027 =item Sys::Virt::Domain::KEYCODE_SET_ATSET1
3028
3029 The AT Set1 keycodes (aka XT)
3030
3031 =item Sys::Virt::Domain::KEYCODE_SET_ATSET2
3032
3033 The AT Set2 keycodes (aka AT)
3034
3035 =item Sys::Virt::Domain::KEYCODE_SET_ATSET3
3036
3037 The AT Set3 keycodes (aka PS2)
3038
3039 =item Sys::Virt::Domain::KEYCODE_SET_OSX
3040
3041 The OS-X keycodes
3042
3043 =item Sys::Virt::Domain::KEYCODE_SET_XT_KBD
3044
3045 The XT keycodes from the Linux Keyboard driver
3046
3047 =item Sys::Virt::Domain::KEYCODE_SET_USB
3048
3049 The USB HID keycode set
3050
3051 =item Sys::Virt::Domain::KEYCODE_SET_WIN32
3052
3053 The Windows keycode set
3054
3055 =item Sys::Virt::Domain::KEYCODE_SET_QNUM
3056
3057 The XT keycode set, with the extended scancodes using the
3058 high bit of the first byte, instead of the low bit of the
3059 second byte.
3060
3061 =item Sys::Virt::Domain::KEYCODE_SET_RFB
3062
3063 A deprecated alias for C<Sys::Virt::Domain::KEYCODE_SET_QNUM>
3064
3065 =back
3066
3067 =head2 MEMORY PEEK
3068
3069 The following constants can be used with the C<memory_peek>
3070 method's flags parameter
3071
3072 =over 4
3073
3074 =item Sys::Virt::Domain::MEMORY_VIRTUAL
3075
3076 Indicates that the offset is using virtual memory addressing.
3077
3078 =item Sys::Virt::Domain::MEMORY_PHYSICAL
3079
3080 Indicates that the offset is using physical memory addressing.
3081
3082 =back
3083
3084
3085 =head2 VCPU STATE
3086
3087 The following constants are useful when interpreting the
3088 virtual CPU run state
3089
3090 =over 4
3091
3092 =item Sys::Virt::Domain::VCPU_OFFLINE
3093
3094 The virtual CPU is not online
3095
3096 =item Sys::Virt::Domain::VCPU_RUNNING
3097
3098 The virtual CPU is executing code
3099
3100 =item Sys::Virt::Domain::VCPU_BLOCKED
3101
3102 The virtual CPU is waiting to be scheduled
3103
3104 =back
3105
3106
3107 =head2 VCPU HOST PLACEMENT STATE
3108
3109 The following constants are useful when interpreting the
3110 virtual CPU host placement
3111
3112 =over 4
3113
3114 =item Sys::Virt::Domain::VCPU_INFO_CPU_OFFLINE
3115
3116 The virtual CPU is not online
3117
3118 =item Sys::Virt::Domain::VCPU_INFO_CPU_UNAVAILABLE
3119
3120 The virtual CPU placement is not available from this hypervisor
3121
3122 =back
3123
3124
3125 =head2 OPEN GRAPHICS CONSTANTS
3126
3127 The following constants are used when opening a connection
3128 to the guest graphics server
3129
3130 =over 4
3131
3132 =item Sys::Virt::Domain::OPEN_GRAPHICS_SKIPAUTH
3133
3134 Skip authentication of the client
3135
3136 =back
3137
3138
3139 =head2 OPEN CONSOLE CONSTANTS
3140
3141 The following constants are used when opening a connection
3142 to the guest console
3143
3144 =over 4
3145
3146 =item Sys::Virt::Domain::OPEN_CONSOLE_FORCE
3147
3148 Force opening of the console, disconnecting any other
3149 open session
3150
3151 =item Sys::Virt::Domain::OPEN_CONSOLE_SAFE
3152
3153 Check if the console driver supports safe operations
3154
3155 =back
3156
3157 =head2 OPEN CHANNEL CONSTANTS
3158
3159 The following constants are used when opening a connection
3160 to the guest channel
3161
3162 =over 4
3163
3164 =item Sys::Virt::Domain::OPEN_CHANNEL_FORCE
3165
3166 Force opening of the channel, disconnecting any other
3167 open session
3168
3169 =back
3170
3171 =head2 XML DUMP OPTIONS
3172
3173 The following constants are used to control the information
3174 included in the XML configuration dump
3175
3176 =over 4
3177
3178 =item Sys::Virt::Domain::XML_INACTIVE
3179
3180 Report the persistent inactive configuration for the guest, even
3181 if it is currently running.
3182
3183 =item Sys::Virt::Domain::XML_SECURE
3184
3185 Include security sensitive information in the XML dump, such as
3186 passwords.
3187
3188 =item Sys::Virt::Domain::XML_UPDATE_CPU
3189
3190 Update the CPU model definition to match the current executing
3191 state.
3192
3193 =item Sys::Virt::Domain::XML_MIGRATABLE
3194
3195 Update the XML to allow migration to older versions of libvirt
3196
3197 =back
3198
3199 =head2 DEVICE HOTPLUG OPTIONS
3200
3201 The following constants are used to control device hotplug
3202 operations
3203
3204 =over 4
3205
3206 =item Sys::Virt::Domain::DEVICE_MODIFY_CURRENT
3207
3208 Modify the domain in its current state
3209
3210 =item Sys::Virt::Domain::DEVICE_MODIFY_LIVE
3211
3212 Modify only the live state of the domain
3213
3214 =item Sys::Virt::Domain::DEVICE_MODIFY_CONFIG
3215
3216 Modify only the persistent config of the domain
3217
3218 =item Sys::Virt::Domain::DEVICE_MODIFY_FORCE
3219
3220 Force the device to be modified
3221
3222 =back
3223
3224 =head2 MEMORY OPTIONS
3225
3226 The following constants are used to control memory change
3227 operations
3228
3229 =over 4
3230
3231 =item Sys::Virt::Domain::MEM_CURRENT
3232
3233 Modify the current state
3234
3235 =item Sys::Virt::Domain::MEM_LIVE
3236
3237 Modify only the live state of the domain
3238
3239 =item Sys::Virt::Domain::MEM_CONFIG
3240
3241 Modify only the persistent config of the domain
3242
3243 =item Sys::Virt::Domain::MEM_MAXIMUM
3244
3245 Modify the maximum memory value
3246
3247 =back
3248
3249 =head2 CONFIG OPTIONS
3250
3251 The following constants are used to control what configuration
3252 a domain update changes
3253
3254 =over 4
3255
3256 =item Sys::Virt::Domain::AFFECT_CURRENT
3257
3258 Modify the current state
3259
3260 =item Sys::Virt::Domain::AFFECT_LIVE
3261
3262 Modify only the live state of the domain
3263
3264 =item Sys::Virt::Domain::AFFECT_CONFIG
3265
3266 Modify only the persistent config of the domain
3267
3268 =back
3269
3270 =head2 SETVCPU OPTIONS
3271
3272 The following constants are used to control what setting vCPUs
3273 changes.
3274
3275 =over 4
3276
3277 =item Sys::Virt::Domain::SETVCPU_AFFECT_CURRENT
3278
3279 Modify the current state
3280
3281 =item Sys::Virt::Domain::SETVCPU_AFFECT_LIVE
3282
3283 Modify only the live state of the domain
3284
3285 =item Sys::Virt::Domain::SETVCPU_AFFECT_CONFIG
3286
3287 Modify only the persistent config of the domain
3288
3289 =item Sys::Virt::Domain::SETVCPU_ASYNC_UNPLUG
3290
3291 Do not wait for the guest to comply with the request
3292
3293 =back
3294
3295 =head2 MIGRATE OPTIONS
3296
3297 The following constants are used to control how migration
3298 is performed
3299
3300 =over 4
3301
3302 =item Sys::Virt::Domain::MIGRATE_LIVE
3303
3304 Migrate the guest without interrupting its execution on the source
3305 host.
3306
3307 =item Sys::Virt::Domain::MIGRATE_PEER2PEER
3308
3309 Manage the migration process over a direct peer-2-peer connection between
3310 the source and destination host libvirtd daemons.
3311
3312 =item Sys::Virt::Domain::MIGRATE_TUNNELLED
3313
3314 Tunnel the migration data over the libvirt daemon connection, rather
3315 than the native hypervisor data transport. Requires PEER2PEER flag to
3316 be set.
3317
3318 =item Sys::Virt::Domain::MIGRATE_PERSIST_DEST
3319
3320 Make the domain persistent on the destination host, defining its
3321 configuration file upon completion of migration.
3322
3323 =item Sys::Virt::Domain::MIGRATE_UNDEFINE_SOURCE
3324
3325 Remove the domain's persistent configuration after migration
3326 completes successfully.
3327
3328 =item Sys::Virt::Domain::MIGRATE_PAUSED
3329
3330 Do not re-start execution of the guest CPUs on the destination
3331 host after migration completes.
3332
3333 =item Sys::Virt::Domain::MIGRATE_NON_SHARED_DISK
3334
3335 Copy the complete contents of the disk images during migration
3336
3337 =item Sys::Virt::Domain::MIGRATE_NON_SHARED_INC
3338
3339 Copy the incrementally changed contents of the disk images
3340 during migration
3341
3342 =item Sys::Virt::Domain::MIGRATE_CHANGE_PROTECTION
3343
3344 Do not allow changes to the virtual domain configuration while
3345 migration is taking place. This option is automatically implied
3346 if doing a peer-2-peer migration.
3347
3348 =item Sys::Virt::Domain::MIGRATE_UNSAFE
3349
3350 Migrate even if the compatibility check indicates the migration
3351 will be unsafe to the guest.
3352
3353 =item Sys::Virt::Domain::MIGRATE_OFFLINE
3354
3355 Migrate the guest config if the guest is not currently running
3356
3357 =item Sys::Virt::Domain::MIGRATE_COMPRESSED
3358
3359 Enable compression of the migration data stream
3360
3361 =item Sys::Virt::Domain::MIGRATE_ABORT_ON_ERROR
3362
3363 Abort if an I/O error occurs on the disk
3364
3365 =item Sys::Virt::Domain::MIGRATE_AUTO_CONVERGE
3366
3367 Force convergence of the migration operation by
3368 throttling guest runtime
3369
3370 =item Sys::Virt::Domain::MIGRATE_RDMA_PIN_ALL
3371
3372 Pin memory for RDMA transfer
3373
3374 =item Sys::Virt::Domain::MIGRATE_POSTCOPY
3375
3376 Enable support for post-copy migration
3377
3378 =item Sys::Virt::Domain::MIGRATE_TLS
3379
3380 Setting this flag will cause the migration to attempt to use the
3381 TLS environment configured by the hypervisor in order to perform
3382 the migration. If incorrectly configured on either source or
3383 destination, the migration will fail.
3384
3385 =item Sys::Virt::Domain::MIGRATE_PARALLEL
3386
3387 Send memory pages to the destination host through several network
3388 connections. See C<Sys::Virt::Domain::MIGRATE_PARAM_PARALLEL_*>
3389 parameters for configuring the parallel migration.
3390
3391 =item Sys::Virt::Domain::MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES
3392
3393 Force the guest writes which happen when copying disk images for
3394 non-shared storage migration to be synchronously written to the
3395 destination. This ensures the storage migration converges for VMs
3396 doing heavy I/O on fast local storage and slow mirror.
3397
3398 =item Sys::Virt::Domain::MIGRATE_POSTCOPY_RESUME
3399
3400 Resume migration which failed in post-copy phase.
3401
3402 =item Sys::Virt::Domain::MIGRATE_ZEROCOPY
3403
3404 Attempt to avoid copying data. This is a request, not a guarantee
3405 and may apply to either one or both directions of data transfer
3406 at discretion of the hypervisor implementation.
3407
3408 =back
3409
3410 =head2 UNDEFINE CONSTANTS
3411
3412 The following constants can be used when undefining virtual
3413 domain configurations
3414
3415 =over 4
3416
3417 =item Sys::Virt::Domain::UNDEFINE_MANAGED_SAVE
3418
3419 Also remove any managed save image when undefining the virtual
3420 domain
3421
3422 =item Sys::Virt::Domain::UNDEFINE_SNAPSHOTS_METADATA
3423
3424 Also remove any snapshot metadata when undefining the virtual
3425 domain.
3426
3427 =item Sys::Virt::Domain::UNDEFINE_NVRAM
3428
3429 Also remove any NVRAM state file when undefining the virtual
3430 domain.
3431
3432 =item Sys::Virt::Domain::UNDEFINE_KEEP_NVRAM
3433
3434 keep NVRAM state file when undefining the virtual
3435 domain.
3436
3437 =item Sys::Virt::Domain::UNDEFINE_CHECKPOINTS_METADATA
3438
3439 Also remove any checkpoint metadata when undefining the virtual
3440 domain.
3441
3442 =item Sys::Virt::Domain::UNDEFINE_TPM
3443
3444 Also remove any TPM state when undefining the virtual domain.
3445
3446 =item Sys::Virt::Domain::UNDEFINE_KEEP_TPM
3447
3448 Keep TPM state when undefining the virtual domain.
3449
3450 =back
3451
3452 =head2 JOB TYPES
3453
3454 The following constants describe the different background job
3455 types.
3456
3457 =over 4
3458
3459 =item Sys::Virt::Domain::JOB_NONE
3460
3461 No job is active
3462
3463 =item Sys::Virt::Domain::JOB_BOUNDED
3464
3465 A job with a finite completion time is active
3466
3467 =item Sys::Virt::Domain::JOB_UNBOUNDED
3468
3469 A job with an unbounded completion time is active
3470
3471 =item Sys::Virt::Domain::JOB_COMPLETED
3472
3473 The job has finished, but isn't cleaned up
3474
3475 =item Sys::Virt::Domain::JOB_FAILED
3476
3477 The job has hit an error, but isn't cleaned up
3478
3479 =item Sys::Virt::Domain::JOB_CANCELLED
3480
3481 The job was aborted at user request, but isn't cleaned up
3482
3483 =back
3484
3485
3486 =head2 MEMORY PARAMETERS
3487
3488 The following constants are useful when getting/setting
3489 memory parameters for guests
3490
3491 =over 4
3492
3493 =item Sys::Virt::Domain::MEMORY_HARD_LIMIT
3494
3495 The maximum memory the guest can use.
3496
3497 =item Sys::Virt::Domain::MEMORY_SOFT_LIMIT
3498
3499 The memory upper limit enforced during memory contention.
3500
3501 =item Sys::Virt::Domain::MEMORY_MIN_GUARANTEE
3502
3503 The minimum memory guaranteed to be reserved for the guest.
3504
3505 =item Sys::Virt::Domain::MEMORY_SWAP_HARD_LIMIT
3506
3507 The maximum swap the guest can use.
3508
3509 =item Sys::Virt::Domain::MEMORY_PARAM_UNLIMITED
3510
3511 The value of an unlimited memory parameter
3512
3513 =back
3514
3515
3516 =head2 BLKIO PARAMETERS
3517
3518 The following parameters control I/O tuning for the domain
3519 as a whole
3520
3521 =over 4
3522
3523 =item Sys::Virt::Domain::BLKIO_WEIGHT
3524
3525 The I/O weight parameter
3526
3527 =item Sys::Virt::Domain::BLKIO_DEVICE_WEIGHT
3528
3529 The per-device I/O weight parameter
3530
3531 =item Sys::Virt::Domain::BLKIO_DEVICE_READ_BPS
3532
3533 The per-device I/O bytes read per second
3534
3535 =item Sys::Virt::Domain::BLKIO_DEVICE_READ_IOPS
3536
3537 The per-device I/O operations read per second
3538
3539 =item Sys::Virt::Domain::BLKIO_DEVICE_WRITE_BPS
3540
3541 The per-device I/O bytes write per second
3542
3543 =item Sys::Virt::Domain::BLKIO_DEVICE_WRITE_IOPS
3544
3545 The per-device I/O operations write per second
3546
3547 =back
3548
3549 =head2 BLKIO TUNING PARAMETERS
3550
3551 The following parameters control I/O tuning for an individual
3552 guest disk.
3553
3554 =over 4
3555
3556 =item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_BYTES_SEC
3557
3558 The total bytes processed per second.
3559
3560 =item Sys::Virt::Domain::BLOCK_IOTUNE_READ_BYTES_SEC
3561
3562 The bytes read per second.
3563
3564 =item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_BYTES_SEC
3565
3566 The bytes written per second.
3567
3568 =item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_IOPS_SEC
3569
3570 The total I/O operations processed per second.
3571
3572 =item Sys::Virt::Domain::BLOCK_IOTUNE_READ_IOPS_SEC
3573
3574 The I/O operations read per second.
3575
3576 =item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_IOPS_SEC
3577
3578 The I/O operations written per second.
3579
3580 =item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX
3581
3582 The maximum total bytes processed per second.
3583
3584 =item Sys::Virt::Domain::BLOCK_IOTUNE_READ_BYTES_SEC_MAX
3585
3586 The maximum bytes read per second.
3587
3588 =item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX
3589
3590 The maximum bytes written per second.
3591
3592 =item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX
3593
3594 The maximum total I/O operations processed per second.
3595
3596 =item Sys::Virt::Domain::BLOCK_IOTUNE_READ_IOPS_SEC_MAX
3597
3598 The maximum I/O operations read per second.
3599
3600 =item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX
3601
3602 The maximum I/O operations written per second.
3603
3604 =item Sys::Virt::Domain::BLOCK_IOTUNE_SIZE_IOPS_SEC
3605
3606 The maximum I/O operations per second
3607
3608 =item Sys::Virt::Domain::BLOCK_IOTUNE_GROUP_NAME
3609
3610 A string representing a group name to allow sharing of I/O
3611 throttling quota between multiple drives
3612
3613 =item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH
3614
3615 The duration in seconds allowed for maximum total bytes processed per second.
3616
3617 =item Sys::Virt::Domain::BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH
3618
3619 The duration in seconds allowed for maximum bytes read per second.
3620
3621 =item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH
3622
3623 The duration in seconds allowed for maximum bytes written per second.
3624
3625 =item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH
3626
3627 The duration in seconds allowed for maximum total I/O operations processed
3628 per second.
3629
3630 =item Sys::Virt::Domain::BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH
3631
3632 The duration in seconds allowed for maximum I/O operations read per second.
3633
3634 =item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH
3635
3636 The duration in seconds allowed for maximum I/O operations written per second.
3637
3638 =back
3639
3640 =head2 SCHEDULER CONSTANTS
3641
3642 =over 4
3643
3644 =item Sys::Virt::Domain::SCHEDULER_CAP
3645
3646 The VM cap tunable
3647
3648 =item Sys::Virt::Domain::SCHEDULER_CPU_SHARES
3649
3650 The CPU shares tunable
3651
3652 =item Sys::Virt::Domain::SCHEDULER_LIMIT
3653
3654 The VM limit tunable
3655
3656 =item Sys::Virt::Domain::SCHEDULER_RESERVATION
3657
3658 The VM reservation tunable
3659
3660 =item Sys::Virt::Domain::SCHEDULER_SHARES
3661
3662 The VM shares tunable
3663
3664 =item Sys::Virt::Domain::SCHEDULER_VCPU_PERIOD
3665
3666 The VCPU period tunable
3667
3668 =item Sys::Virt::Domain::SCHEDULER_VCPU_QUOTA
3669
3670 The VCPU quota tunable
3671
3672 =item Sys::Virt::Domain::SCHEDULER_GLOBAL_PERIOD
3673
3674 The VM global period tunable
3675
3676 =item Sys::Virt::Domain::SCHEDULER_GLOBAL_QUOTA
3677
3678 The VM global quota tunable
3679
3680 =item Sys::Virt::Domain::SCHEDULER_WEIGHT
3681
3682 The VM weight tunable
3683
3684 =back
3685
3686 =head2 NUMA PARAMETERS
3687
3688 The following constants are useful when getting/setting the
3689 guest NUMA memory policy
3690
3691 =over 4
3692
3693 =item Sys::Virt::Domain::NUMA_MODE
3694
3695 The NUMA policy mode
3696
3697 =item Sys::Virt::Domain::NUMA_NODESET
3698
3699 The NUMA nodeset mask
3700
3701 =back
3702
3703 The following constants are useful when interpreting the
3704 C<Sys::Virt::Domain::NUMA_MODE> parameter value
3705
3706 =over 4
3707
3708 =item Sys::Virt::Domain::NUMATUNE_MEM_STRICT
3709
3710 Allocation is mandatory from the mask nodes
3711
3712 =item Sys::Virt::Domain::NUMATUNE_MEM_PREFERRED
3713
3714 Allocation is preferred from the masked nodes
3715
3716 =item Sys::Virt::Domain::NUMATUNE_MEM_INTERLEAVE
3717
3718 Allocation is interleaved across all masked nodes
3719
3720 =item Sys::Virt::Domain::NUMATUNE_MEM_RESTRICTIVE
3721
3722 Allocation is determined by the host using the masked
3723 nodes.
3724
3725 =back
3726
3727 =head2 INTERFACE PARAMETERS
3728
3729 The following constants are useful when getting/setting the
3730 per network interface tunable parameters
3731
3732 =over 4
3733
3734 =item Sys::Virt::Domain::BANDWIDTH_IN_AVERAGE
3735
3736 The average inbound bandwidth
3737
3738 =item Sys::Virt::Domain::BANDWIDTH_IN_PEAK
3739
3740 The peak inbound bandwidth
3741
3742 =item Sys::Virt::Domain::BANDWIDTH_IN_BURST
3743
3744 The burstable inbound bandwidth
3745
3746 =item Sys::Virt::Domain::BANDWIDTH_IN_FLOOR
3747
3748 The minimum inbound bandwidth
3749
3750 =item Sys::Virt::Domain::BANDWIDTH_OUT_AVERAGE
3751
3752 The average outbound bandwidth
3753
3754 =item Sys::Virt::Domain::BANDWIDTH_OUT_PEAK
3755
3756 The peak outbound bandwidth
3757
3758 =item Sys::Virt::Domain::BANDWIDTH_OUT_BURST
3759
3760 The burstable outbound bandwidth
3761
3762 =back
3763
3764 =head2 INTERFACE ANNOUNCE PARAMETERS
3765
3766 The following constants are useful when calling the
3767 C<Sys::Virt::Domain::announce_interface> function.
3768
3769 =over 4
3770
3771 =item Sys::Virt::Domain::ANNOUNCE_INTERFACE_INITIAL
3772
3773 Initial delay in milliseconds before the first announce packet is
3774 sent.
3775
3776 =item Sys::Virt::Domain::ANNOUNCE_INTERFACE_MAX
3777
3778 Maximum delay in milliseconds between packets.
3779
3780 =item Sys::Virt::Domain::ANNOUNCE_INTERFACE_ROUNDS
3781
3782 The number of packets to send.
3783
3784 =item Sys::Virt::Domain::ANNOUNCE_INTERFACE_STEP
3785
3786 Increment added to the delay (in milliseconds) after each packet
3787 is sent.
3788
3789 =back
3790
3791 =head2 PERF EVENTS
3792
3793 The following constants defined performance events
3794 which can be monitored for a guest
3795
3796 =over 4
3797
3798 =item Sys::Virt::Domain::PERF_PARAM_CMT
3799
3800 The CMT event counter which can be used to measure the usage of
3801 cache (bytes) by applications running on the platform. It
3802 corresponds to the "perf.cmt" field in the *Stats APIs.
3803
3804 =item Sys::Virt::Domain::PERF_PARAM_MBML
3805
3806 The MBML event counter which can be used to monitor the amount of
3807 data (bytes/s) sent through the memory controller on the socket.
3808 It corresponds to the "perf.mbml" field in the *Stats APIs.
3809
3810 =item Sys::Virt::Domain::PERF_PARAM_MBMT
3811
3812 The MBMT event counter which can be used to monitor total system
3813 bandwidth (bytes/s) from one level of cache to another. It
3814 corresponds to the "perf.mbmt" field in the *Stats APIs.
3815
3816 =item Sys::Virt::Domain::PERF_PARAM_CACHE_MISSES
3817
3818 The cache_misses perf event counter which can be used to measure
3819 the count of cache misses by applications running on the
3820 platform. It corresponds to the "perf.cache_misses" field in the
3821 *Stats APIs.
3822
3823 =item Sys::Virt::Domain::PERF_PARAM_CACHE_REFERENCES
3824
3825 The cache_references perf event counter which can be used to
3826 measure the count of cache hits by applications running on the
3827 platform. It corresponds to the "perf.cache_references" field in
3828 the *Stats APIs.
3829
3830 =item Sys::Virt::Domain::PERF_PARAM_CPU_CYCLES
3831
3832 The cpu_cycles perf event counter which can be used to measure
3833 how many cpu cycles one instruction needs. It corresponds to the
3834 "perf.cpu_cycles" field in the *Stats APIs.
3835
3836 =item Sys::Virt::Domain::PERF_PARAM_INSTRUCTIONS
3837
3838 The instructions perf event counter which can be used to measure
3839 the count of instructions by applications running on the
3840 platform. It corresponds to the "perf.instructions" field in the
3841 *Stats APIs.
3842
3843 =item Sys::Virt::Domain::PERF_PARAM_BRANCH_INSTRUCTIONS
3844
3845 The branch_instructions perf event counter which can be used to measure
3846 the count of instructions by applications running on the
3847 platform. It corresponds to the "perf.branch_instructions" field in the
3848 *Stats APIs.
3849
3850 =item Sys::Virt::Domain::PERF_PARAM_BRANCH_MISSES
3851
3852 The branch_misses perf event which can be used to measure the
3853 count of branch misses by applications running on the platform.
3854 It corresponds to the "perf.branch_misses" field in the *Stats
3855 APIs.
3856
3857 =item Sys::Virt::Domain::PERF_PARAM_BUS_CYCLES
3858
3859 The bus_cycles perf event counter which can be used to measure
3860 the count of bus cycles by applications running on the platform.
3861 It corresponds to the "perf.bus_cycles" field in the *Stats APIs.
3862
3863 =item Sys::Virt::Domain::PERF_PARAM_STALLED_CYCLES_FRONTEND
3864
3865 The stalled_cycles_frontend perf event counter which can be used
3866 to measure the count of stalled cpu cycles in the frontend of the
3867 instruction processor pipeline by applications running on the
3868 platform. It corresponds to the "perf.stalled_cycles_frontend"
3869 field in the *Stats APIs.
3870
3871 =item Sys::Virt::Domain::PERF_PARAM_STALLED_CYCLES_BACKEND
3872
3873 The stalled_cycles_backend perf event counter which can be used
3874 to measure the count of stalled cpu cycles in the backend of the
3875 instruction processor pipeline by application running on the
3876 platform. It corresponds to the "perf.stalled_cycles_backend"
3877 field in the *Stats APIs.
3878
3879 =item Sys::Virt::Domain::PERF_PARAM_REF_CPU_CYCLES
3880
3881 The ref_cpu_cycles perf event counter which can be used to
3882 measure the count of total cpu cycles not affected by CPU
3883 frequency scaling by applications running on the platform.
3884 It corresponds to the "perf.ref_cpu_cycles" field in the
3885 *Stats APIs.
3886
3887 =item Sys::Virt::Domain::PERF_PARAM_CPU_CLOCK
3888
3889 The cpu_clock perf event counter which can be used to
3890 measure the count of cpu clock time by applications
3891 running on the platform. It corresponds to the
3892 "perf.cpu_clock" field in the *Stats APIs.
3893
3894 =item Sys::Virt::Domain::PERF_PARAM_TASK_CLOCK
3895
3896 The task_clock perf event counter which can be used to
3897 measure the count of task clock time by applications
3898 running on the platform. It corresponds to the
3899 "perf.task_clock" field in the *Stats APIs.
3900
3901 =item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS
3902
3903 The page_faults perf event counter which can be used to
3904 measure the count of page faults by applications running
3905 on the platform. It corresponds to the "perf.page_faults"
3906 field in the *Stats APIs.
3907
3908 =item Sys::Virt::Domain::PERF_PARAM_CONTEXT_SWITCHES
3909
3910 The context_switches perf event counter which can be used to
3911 measure the count of context switches by applications running
3912 on the platform. It corresponds to the "perf.context_switches"
3913 field in the *Stats APIs.
3914
3915 =item Sys::Virt::Domain::PERF_PARAM_CPU_MIGRATIONS
3916
3917 The cpu_migrations perf event counter which can be used to
3918 measure the count of cpu migrations by applications running
3919 on the platform. It corresponds to the "perf.cpu_migrations"
3920 field in the *Stats APIs.
3921
3922 =item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MIN
3923
3924 The page_faults_min perf event counter which can be used to
3925 measure the count of minor page faults by applications running
3926 on the platform. It corresponds to the "perf.page_faults_min"
3927 field in the *Stats APIs.
3928
3929 =item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MAJ
3930
3931 The page_faults_maj perf event counter which can be used to
3932 measure the count of major page faults by applications running
3933 on the platform. It corresponds to the "perf.page_faults_maj"
3934 field in the *Stats APIs.
3935
3936 =item Sys::Virt::Domain::PERF_PARAM_ALIGNMENT_FAULTS
3937
3938 The alignment_faults perf event counter which can be used to
3939 measure the count of alignment faults by applications running
3940 on the platform. It corresponds to the "perf.alignment_faults"
3941 field in the *Stats APIs.
3942
3943 =item Sys::Virt::Domain::PERF_PARAM_EMULATION_FAULTS
3944
3945 The emulation_faults perf event counter which can be used to
3946 measure the count of emulation faults by applications running
3947 on the platform. It corresponds to the "perf.emulation_faults"
3948 field in the *Stats APIs.
3949
3950 =back
3951
3952 =head2 IOTHREAD STATS
3953
3954 The following constants defined IOThread statistics which
3955 can be monitored for a guest
3956
3957 =over 4
3958
3959 =item Sys::Virt::Domain::IOTHREAD_PARAM_POLL_MAX_NS
3960
3961 The maximum polling time that can be used by polling algorithm in ns.
3962 The polling time starts at 0 (zero) and is the time spent by the guest
3963 to process IOThread data before returning the CPU to the host. The
3964 polling time will be dynamically modified over time based on the
3965 poll_grow and poll_shrink parameters provided.
3966
3967 =item Sys::Virt::Domain::IOTHREAD_PARAM_POLL_GROW
3968
3969 This provides a value for the dynamic polling adjustment algorithm to
3970 use to grow its polling interval up to the poll_max_ns value.
3971
3972 =item Sys::Virt::Domain::IOTHREAD_PARAM_POLL_SHRINK
3973
3974 This provides a value for the dynamic polling adjustment algorithm to
3975 use to shrink its polling interval when the polling interval exceeds
3976 the poll_max_ns value.
3977
3978 =item Sys::Virt::Domain::IOTHREAD_PARAM_POLL_WEIGHT
3979
3980 This provides a shift value for the adaptive polling algorithm to control
3981 how much the most recent event interval affects the next polling duration
3982 calculation. Larger values decrease the weight of the current interval,
3983 enabling more gradual adjustments. Valid range is 0-63. A value of 0 lets
3984 the hypervisor select a default weight.
3985
3986 =item Sys::Virt::Domain::IOTHREAD_PARAM_THREAD_POOL_MIN
3987
3988 Sets the lower bound for thread pool size. A value of -1 disables this bound
3989 leaving hypervisor use its default value, though this value is not accepted
3990 for running domains. Due to internal implementation it's recommended to set
3991 lower and upper bounds separately.
3992
3993 =item Sys::Virt::Domain::IOTHREAD_PARAM_THREAD_POOL_MAX
3994
3995 Sets the upper bound for thread pool size. A value of -1 disables this bound
3996 leaving hypervisor use its default value, though this value is not accepted
3997 for running domains. Since the upper band has to be equal to or greater than
3998 lower bound value of 0 is not accepted. Due to internal implementation it's
3999 recommended to set lower and upper bounds separately.
4000
4001 =back
4002
4003 =head2 VCPU FLAGS
4004
4005 The following constants are useful when getting/setting the
4006 VCPU count for a guest
4007
4008 =over 4
4009
4010 =item Sys::Virt::Domain::VCPU_LIVE
4011
4012 Flag to request the live value
4013
4014 =item Sys::Virt::Domain::VCPU_CONFIG
4015
4016 Flag to request the persistent config value
4017
4018 =item Sys::Virt::Domain::VCPU_CURRENT
4019
4020 Flag to request the current config value
4021
4022 =item Sys::Virt::Domain::VCPU_MAXIMUM
4023
4024 Flag to request adjustment of the maximum vCPU value
4025
4026 =item Sys::Virt::Domain::VCPU_GUEST
4027
4028 Flag to request the guest VCPU mask
4029
4030 =item Sys::Virt::Domain::VCPU_HOTPLUGGABLE
4031
4032 Flag to make vcpus added hot(un)pluggable
4033
4034 =item Sys::Virt::Domain::VCPU_ASYNC_UNPLUG
4035
4036 Flag to not wait for the guest to comply with unplug request(s)
4037
4038 =back
4039
4040 =head2 STATE CHANGE EVENTS
4041
4042 The following constants allow domain state change events to be
4043 interpreted. The events contain both a state change, and a
4044 reason.
4045
4046 =over 4
4047
4048 =item Sys::Virt::Domain::EVENT_DEFINED
4049
4050 Indicates that a persistent configuration has been defined for
4051 the domain.
4052
4053 =over 4
4054
4055 =item Sys::Virt::Domain::EVENT_DEFINED_ADDED
4056
4057 The defined configuration is newly added
4058
4059 =item Sys::Virt::Domain::EVENT_DEFINED_UPDATED
4060
4061 The defined configuration is an update to an existing configuration
4062
4063 =item Sys::Virt::Domain::EVENT_DEFINED_RENAMED
4064
4065 The defined configuration is a rename of an existing configuration
4066
4067 =item Sys::Virt::Domain::EVENT_DEFINED_FROM_SNAPSHOT
4068
4069 The defined configuration was restored from a snapshot
4070
4071 =back
4072
4073 =item Sys::Virt::Domain::EVENT_RESUMED
4074
4075 The domain has resumed execution
4076
4077 =over 4
4078
4079 =item Sys::Virt::Domain::EVENT_RESUMED_MIGRATED
4080
4081 The domain resumed because migration has completed. This is
4082 emitted on the destination host.
4083
4084 =item Sys::Virt::Domain::EVENT_RESUMED_UNPAUSED
4085
4086 The domain resumed because the admin unpaused it.
4087
4088 =item Sys::Virt::Domain::EVENT_RESUMED_FROM_SNAPSHOT
4089
4090 The domain resumed because it was restored from a snapshot
4091
4092 =item Sys::Virt::Domain::EVENT_RESUMED_POSTCOPY
4093
4094 The domain resumed but post-copy is running in background
4095
4096 =item Sys::Virt::Domain::EVENT_RESUMED_POSTCOPY_FAILED
4097
4098 The domain is running, but migration failed in post-copy.
4099
4100 =back
4101
4102 =item Sys::Virt::Domain::EVENT_STARTED
4103
4104 The domain has started running
4105
4106 =over 4
4107
4108 =item Sys::Virt::Domain::EVENT_STARTED_BOOTED
4109
4110 The domain was booted from shutoff state
4111
4112 =item Sys::Virt::Domain::EVENT_STARTED_MIGRATED
4113
4114 The domain started due to an incoming migration
4115
4116 =item Sys::Virt::Domain::EVENT_STARTED_RESTORED
4117
4118 The domain was restored from saved state file
4119
4120 =item Sys::Virt::Domain::EVENT_STARTED_FROM_SNAPSHOT
4121
4122 The domain was restored from a snapshot
4123
4124 =item Sys::Virt::Domain::EVENT_STARTED_WAKEUP
4125
4126 The domain was woken up from suspend
4127
4128 =item Sys::Virt::Domain::EVENT_STARTED_RECREATED
4129
4130 The secure domain started after being recreated for a reboot
4131
4132 =back
4133
4134 =item Sys::Virt::Domain::EVENT_STOPPED
4135
4136 The domain has stopped running
4137
4138 =over 4
4139
4140 =item Sys::Virt::Domain::EVENT_STOPPED_CRASHED
4141
4142 The domain stopped because guest operating system has crashed
4143
4144 =item Sys::Virt::Domain::EVENT_STOPPED_DESTROYED
4145
4146 The domain stopped because administrator issued a destroy
4147 command.
4148
4149 =item Sys::Virt::Domain::EVENT_STOPPED_FAILED
4150
4151 The domain stopped because of a fault in the host virtualization
4152 environment.
4153
4154 =item Sys::Virt::Domain::EVENT_STOPPED_MIGRATED
4155
4156 The domain stopped because it was migrated to another machine.
4157
4158 =item Sys::Virt::Domain::EVENT_STOPPED_SAVED
4159
4160 The domain was saved to a state file
4161
4162 =item Sys::Virt::Domain::EVENT_STOPPED_SHUTDOWN
4163
4164 The domain stopped due to graceful shutdown of the guest.
4165
4166 =item Sys::Virt::Domain::EVENT_STOPPED_FROM_SNAPSHOT
4167
4168 The domain was stopped due to a snapshot
4169
4170 =item Sys::Virt::Domain::EVENT_STOPPED_RECREATED
4171
4172 The secure domain stopped to be recreated for a reboot
4173
4174 =back
4175
4176 =item Sys::Virt::Domain::EVENT_SHUTDOWN
4177
4178 The domain has shutdown but is not yet stopped
4179
4180 =over 4
4181
4182 =item Sys::Virt::Domain::EVENT_SHUTDOWN_FINISHED
4183
4184 The domain finished shutting down
4185
4186 =item Sys::Virt::Domain::EVENT_SHUTDOWN_HOST
4187
4188 The domain shutdown due to host trigger
4189
4190 =item Sys::Virt::Domain::EVENT_SHUTDOWN_GUEST
4191
4192 The domain shutdown due to guest trigger
4193
4194 =back
4195
4196 =item Sys::Virt::Domain::EVENT_SUSPENDED
4197
4198 The domain has stopped executing, but still exists
4199
4200 =over 4
4201
4202 =item Sys::Virt::Domain::EVENT_SUSPENDED_MIGRATED
4203
4204 The domain has been suspended due to offline migration
4205
4206 =item Sys::Virt::Domain::EVENT_SUSPENDED_PAUSED
4207
4208 The domain has been suspended due to administrator pause
4209 request.
4210
4211 =item Sys::Virt::Domain::EVENT_SUSPENDED_IOERROR
4212
4213 The domain has been suspended due to a block device I/O
4214 error.
4215
4216 =item Sys::Virt::Domain::EVENT_SUSPENDED_FROM_SNAPSHOT
4217
4218 The domain has been suspended due to resume from snapshot
4219
4220 =item Sys::Virt::Domain::EVENT_SUSPENDED_WATCHDOG
4221
4222 The domain has been suspended due to the watchdog triggering
4223
4224 =item Sys::Virt::Domain::EVENT_SUSPENDED_RESTORED
4225
4226 The domain has been suspended due to restore from saved state
4227
4228 =item Sys::Virt::Domain::EVENT_SUSPENDED_API_ERROR
4229
4230 The domain has been suspended due to an API error
4231
4232 =item Sys::Virt::Domain::EVENT_SUSPENDED_POSTCOPY
4233
4234 The domain has been suspended for post-copy migration
4235
4236 =item Sys::Virt::Domain::EVENT_SUSPENDED_POSTCOPY_FAILED
4237
4238 The domain has been suspended due post-copy migration failing
4239
4240 =item Sys::Virt::Domain::EVENT_SUSPENDED_GUEST_SHUTDOWN
4241
4242 The domain has been suspended after guest os shut-down (a long
4243 running job is preserving the VM until completion)
4244
4245 =back
4246
4247 =item Sys::Virt::Domain::EVENT_UNDEFINED
4248
4249 The persistent configuration has gone away
4250
4251 =over 4
4252
4253 =item Sys::Virt::Domain::EVENT_UNDEFINED_REMOVED
4254
4255 The domain configuration has gone away due to it being
4256 removed by administrator.
4257
4258 =item Sys::Virt::Domain::EVENT_UNDEFINED_RENAMED
4259
4260 The undefined configuration is a rename of an existing configuration
4261
4262 =back
4263
4264 =item Sys::Virt::Domain::EVENT_PMSUSPENDED
4265
4266 The domain has stopped running
4267
4268 =over 4
4269
4270 =item Sys::Virt::Domain::EVENT_PMSUSPENDED_MEMORY
4271
4272 The domain has suspend to RAM.
4273
4274 =item Sys::Virt::Domain::EVENT_PMSUSPENDED_DISK
4275
4276 The domain has suspend to Disk.
4277
4278 =back
4279
4280 =item Sys::Virt::Domain::EVENT_CRASHED
4281
4282 The domain has crashed
4283
4284 =over 4
4285
4286 =item Sys::Virt::Domain::EVENT_CRASHED_PANICKED
4287
4288 The domain has crashed due to a kernel panic
4289
4290 =item Sys::Virt::Domain::EVENT_CRASHED_CRASHLOADED
4291
4292 The domain has crashed and reloaded itself
4293
4294 =back
4295
4296 =back
4297
4298 =head2 EVENT ID CONSTANTS
4299
4300 =over 4
4301
4302 =item Sys::Virt::Domain::EVENT_ID_LIFECYCLE
4303
4304 Domain lifecycle events
4305
4306 =item Sys::Virt::Domain::EVENT_ID_REBOOT
4307
4308 Soft / warm reboot events
4309
4310 =item Sys::Virt::Domain::EVENT_ID_RTC_CHANGE
4311
4312 RTC clock adjustments
4313
4314 =item Sys::Virt::Domain::EVENT_ID_IO_ERROR
4315
4316 File IO errors, typically from disks
4317
4318 =item Sys::Virt::Domain::EVENT_ID_WATCHDOG
4319
4320 Watchdog device triggering
4321
4322 =item Sys::Virt::Domain::EVENT_ID_GRAPHICS
4323
4324 Graphics client connections.
4325
4326 =item Sys::Virt::Domain::EVENT_ID_IO_ERROR_REASON
4327
4328 File IO errors, typically from disks, with a root cause
4329
4330 =item Sys::Virt::Domain::EVENT_ID_CONTROL_ERROR
4331
4332 Errors from the virtualization control channel
4333
4334 =item Sys::Virt::Domain::EVENT_ID_BLOCK_JOB
4335
4336 Completion status of asynchronous block jobs,
4337 identified by source file name.
4338
4339 =item Sys::Virt::Domain::EVENT_ID_BLOCK_JOB_2
4340
4341 Completion status of asynchronous block jobs,
4342 identified by target device name.
4343
4344 =item Sys::Virt::Domain::EVENT_ID_DISK_CHANGE
4345
4346 Changes in disk media
4347
4348 =item Sys::Virt::Domain::EVENT_ID_TRAY_CHANGE
4349
4350 CDROM media tray state
4351
4352 =item Sys::Virt::Domain::EVENT_ID_PMSUSPEND
4353
4354 Power management initiated suspend to RAM
4355
4356 =item Sys::Virt::Domain::EVENT_ID_PMSUSPEND_DISK
4357
4358 Power management initiated suspend to Disk
4359
4360 =item Sys::Virt::Domain::EVENT_ID_PMWAKEUP
4361
4362 Power management initiated wakeup
4363
4364 =item Sys::Virt::Domain::EVENT_ID_BALLOON_CHANGE
4365
4366 Balloon target changes
4367
4368 =item Sys::Virt::Domain::EVENT_ID_DEVICE_ADDED
4369
4370 Asynchronous guest device addition
4371
4372 =item Sys::Virt::Domain::EVENT_ID_DEVICE_REMOVED
4373
4374 Asynchronous guest device removal
4375
4376 =item Sys::Virt::Domain::EVENT_ID_TUNABLE
4377
4378 Changes of any domain tuning parameters. The callback
4379 will be provided with a hash listing all changed parameters.
4380 The later DOMAIN TUNABLE constants can be useful when accessing
4381 the hash keys
4382
4383 =item Sys::Virt::Domain::EVENT_ID_AGENT_LIFECYCLE
4384
4385 Domain guest agent lifecycle events. The C<state> parameter
4386 to the callback will match one of the constants
4387
4388 =over 4
4389
4390 =item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_STATE_CONNECTED
4391
4392 The agent is now connected
4393
4394 =item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED
4395
4396 The agent is now disconnected
4397
4398 =back
4399
4400 The second parameter, C<reason>, matches one of the following
4401 constants
4402
4403 =over 4
4404
4405 =item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN
4406
4407 The reason is unknown
4408
4409 =item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED
4410
4411 The domain was initially booted
4412
4413 =item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_REASON_CHANNEL
4414
4415 The channel on a running guest changed state
4416
4417 =back
4418
4419 =item Sys::Virt::Domain::EVENT_ID_MIGRATION_ITERATION
4420
4421 Domain migration progress iteration. The C<iteration> parameter
4422 to the callback will specify the number of iterations migration
4423 has made over guest RAM.
4424
4425 =item Sys::Virt::Domain::EVENT_ID_JOB_COMPLETED
4426
4427 Domain background job completion notification. The callback
4428 provides a hash containing the job stats. The keys in the
4429 hash are the same as those used with the C<Sys::Virt::Domain::get_job_stats()>
4430 method.
4431
4432 =item Sys::Virt::Domain::EVENT_ID_DEVICE_REMOVAL_FAILED
4433
4434 Guest device removal has failed.
4435
4436 =item Sys::Virt::Domain::EVENT_ID_METADATA_CHANGE
4437
4438 The domain metadata has changed
4439
4440 =item Sys::Virt::Domain::EVENT_ID_BLOCK_THRESHOLD
4441
4442 The event occurs when the hypervisor detects that the given
4443 storage element was written beyond the point specified by
4444 threshold. The event is useful for thin-provisioned storage.
4445
4446 =item Sys::Virt::Domain::EVENT_ID_MEMORY_FAILURE
4447
4448 The event occurs when the hypervisor detects hardware
4449 memory corruption.
4450
4451 =item Sys::Virt::Domain::EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE
4452
4453 The event occurs when the guest accepts a request to change
4454 the memory device size.
4455
4456 =item Sys::Virt::Domain::EVENT_ID_NIC_MAC_CHANGE
4457
4458 The event occurs when the guest changes MAC address on one of its virtual
4459 network interfaces.
4460
4461 =item Sys::Virt::Domain::EVENT_ID_VCPU_REMOVED
4462
4463 This event occurs when a vCPU is removed from the domain.
4464
4465 =item Sys::Virt::Domain::EVENT_ID_CHANNEL_LIFECYCLE
4466
4467 Domain channel lifecycle events. The C<state> parameter
4468 to the callback will match one of the constants
4469
4470 =over 4
4471
4472 =item Sys::Virt::Domain::EVENT_CHANNEL_LIFECYCLE_STATE_CONNECTED
4473
4474 The channel is now connected
4475
4476 =item Sys::Virt::Domain::EVENT_CHANNEL_LIFECYCLE_STATE_DISCONNECTED
4477
4478 The channel is now disconnected
4479
4480 =back
4481
4482 The second parameter, C<reason>, matches one of the following
4483 constants
4484
4485 =over 4
4486
4487 =item Sys::Virt::Domain::EVENT_CHANNEL_LIFECYCLE_REASON_UNKNOWN
4488
4489 The reason is unknown
4490
4491 =item Sys::Virt::Domain::EVENT_CHANNEL_LIFECYCLE_REASON_DOMAIN_STARTED
4492
4493 The domain was initially booted
4494
4495 =item Sys::Virt::Domain::EVENT_CHANNEL_LIFECYCLE_REASON_CHANNEL
4496
4497 The channel on a running guest changed state
4498
4499 =back
4500
4501 =back
4502
4503 =head2 IO ERROR EVENT CONSTANTS
4504
4505 These constants describe what action was taken due to the
4506 IO error.
4507
4508 =over 4
4509
4510 =item Sys::Virt::Domain::EVENT_IO_ERROR_NONE
4511
4512 No action was taken, the error was ignored & reported as success to guest
4513
4514 =item Sys::Virt::Domain::EVENT_IO_ERROR_PAUSE
4515
4516 The guest is paused since the error occurred
4517
4518 =item Sys::Virt::Domain::EVENT_IO_ERROR_REPORT
4519
4520 The error has been reported to the guest OS
4521
4522 =back
4523
4524 =head2 WATCHDOG EVENT CONSTANTS
4525
4526 These constants describe what action was taken due to the
4527 watchdog firing
4528
4529 =over 4
4530
4531 =item Sys::Virt::Domain::EVENT_WATCHDOG_NONE
4532
4533 No action was taken, the watchdog was ignored
4534
4535 =item Sys::Virt::Domain::EVENT_WATCHDOG_PAUSE
4536
4537 The guest is paused since the watchdog fired
4538
4539 =item Sys::Virt::Domain::EVENT_WATCHDOG_POWEROFF
4540
4541 The guest is powered off after the watchdog fired
4542
4543 =item Sys::Virt::Domain::EVENT_WATCHDOG_RESET
4544
4545 The guest is reset after the watchdog fired
4546
4547 =item Sys::Virt::Domain::EVENT_WATCHDOG_SHUTDOWN
4548
4549 The guest attempted to gracefully shutdown after the watchdog fired
4550
4551 =item Sys::Virt::Domain::EVENT_WATCHDOG_DEBUG
4552
4553 No action was taken, the watchdog was logged
4554
4555 =item Sys::Virt::Domain::EVENT_WATCHDOG_INJECTNMI
4556
4557 An NMI was injected into the guest after the watchdog fired
4558
4559 =back
4560
4561 =head2 GRAPHICS EVENT PHASE CONSTANTS
4562
4563 These constants describe the phase of the graphics connection
4564
4565 =over 4
4566
4567 =item Sys::Virt::Domain::EVENT_GRAPHICS_CONNECT
4568
4569 The initial client connection
4570
4571 =item Sys::Virt::Domain::EVENT_GRAPHICS_INITIALIZE
4572
4573 The client has been authenticated & the connection is running
4574
4575 =item Sys::Virt::Domain::EVENT_GRAPHICS_DISCONNECT
4576
4577 The client has disconnected
4578
4579 =back
4580
4581 =head2 GRAPHICS EVENT ADDRESS CONSTANTS
4582
4583 These constants describe the format of the address
4584
4585 =over 4
4586
4587 =item Sys::Virt::Domain::EVENT_GRAPHICS_ADDRESS_IPV4
4588
4589 An IPv4 address
4590
4591 =item Sys::Virt::Domain::EVENT_GRAPHICS_ADDRESS_IPV6
4592
4593 An IPv6 address
4594
4595 =item Sys::Virt::Domain::EVENT_GRAPHICS_ADDRESS_UNIX
4596
4597 An UNIX socket path address
4598
4599 =back
4600
4601 =head2 DISK CHANGE EVENT CONSTANTS
4602
4603 These constants describe the reason for a disk change event
4604
4605 =over 4
4606
4607 =item Sys::Virt::Domain::EVENT_DISK_CHANGE_MISSING_ON_START
4608
4609 The disk media was cleared, as its source was missing when attempting to start the guest
4610
4611 =item Sys::Virt::Domain::EVENT_DISK_DROP_MISSING_ON_START
4612
4613 The disk device was dropped, as its source was missing when attempting to start the guest
4614
4615 =back
4616
4617 =head2 TRAY CHANGE CONSTANTS
4618
4619 These constants describe the reason for a tray change event
4620
4621 =over 4
4622
4623 =item Sys::Virt::Domain::EVENT_TRAY_CHANGE_CLOSE
4624
4625 The tray was closed
4626
4627 =item Sys::Virt::Domain::EVENT_TRAY_CHANGE_OPEN
4628
4629 The tray was opened
4630
4631 =back
4632
4633 =head2 DOMAIN BLOCK JOB TYPE CONSTANTS
4634
4635 The following constants identify the different types of domain
4636 block jobs
4637
4638 =over 4
4639
4640 =item Sys::Virt::Domain::BLOCK_JOB_TYPE_UNKNOWN
4641
4642 An unknown block job type
4643
4644 =item Sys::Virt::Domain::BLOCK_JOB_TYPE_PULL
4645
4646 The block pull job type
4647
4648 =item Sys::Virt::Domain::BLOCK_JOB_TYPE_COPY
4649
4650 The block copy job type
4651
4652 =item Sys::Virt::Domain::BLOCK_JOB_TYPE_COMMIT
4653
4654 The block commit job type
4655
4656 =item Sys::Virt::Domain::BLOCK_JOB_TYPE_ACTIVE_COMMIT
4657
4658 The block active commit job type
4659
4660 =item Sys::Virt::Domain::BLOCK_JOB_TYPE_BACKUP
4661
4662 The block backup job type
4663
4664 =back
4665
4666 =head2 DOMAIN BLOCK JOB COMPLETION CONSTANTS
4667
4668 The following constants can be used to determine the completion
4669 status of a block job
4670
4671 =over 4
4672
4673 =item Sys::Virt::Domain::BLOCK_JOB_COMPLETED
4674
4675 A successfully completed block job
4676
4677 =item Sys::Virt::Domain::BLOCK_JOB_FAILED
4678
4679 An unsuccessful block job
4680
4681 =item Sys::Virt::Domain::BLOCK_JOB_CANCELED
4682
4683 A block job canceled by the user
4684
4685 =item Sys::Virt::Domain::BLOCK_JOB_READY
4686
4687 A block job is running
4688
4689 =back
4690
4691 =head2 DOMAIN BLOCK REBASE CONSTANTS
4692
4693 The following constants are useful when rebasing block devices
4694
4695 =over 4
4696
4697 =item Sys::Virt::Domain::BLOCK_REBASE_SHALLOW
4698
4699 Limit copy to top of source backing chain
4700
4701 =item Sys::Virt::Domain::BLOCK_REBASE_REUSE_EXT
4702
4703 Reuse existing external file for copy
4704
4705 =item Sys::Virt::Domain::BLOCK_REBASE_COPY_RAW
4706
4707 Make destination file raw
4708
4709 =item Sys::Virt::Domain::BLOCK_REBASE_COPY
4710
4711 Start a copy job
4712
4713 =item Sys::Virt::Domain::BLOCK_REBASE_COPY_DEV
4714
4715 Treat destination as a block device instead of file
4716
4717 =item Sys::Virt::Domain::BLOCK_REBASE_RELATIVE
4718
4719 Keep backing chain referenced using relative names
4720
4721 =back
4722
4723 =head2 DOMAIN BLOCK COPY CONSTANTS
4724
4725 The following constants are useful when copying block devices
4726
4727 =over 4
4728
4729 =item Sys::Virt::Domain::BLOCK_COPY_SHALLOW
4730
4731 Limit copy to top of source backing chain
4732
4733 =item Sys::Virt::Domain::BLOCK_COPY_REUSE_EXT
4734
4735 Reuse existing external file for copy
4736
4737 =item Sys::Virt::Domain::BLOCK_COPY_TRANSIENT_JOB
4738
4739 Don't force usage of recoverable job for the copy operation
4740
4741 =item Sys::Virt::Domain::BLOCK_COPY_SYNCHRONOUS_WRITES
4742
4743 Force the copy job to synchronously propagate guest writes into
4744 the destination image, so that the copy is guaranteed to converge
4745
4746 =item Sys::Virt::Domain::BLOCK_COPY_TARGET_ZEROED
4747
4748 The target image is guaranteed to be pre-zeroed so all
4749 reads will return zeros.
4750
4751 =back
4752
4753 =head2 DOMAIN BLOCK JOB ABORT CONSTANTS
4754
4755 The following constants are useful when aborting job copy jobs
4756
4757 =over 4
4758
4759 =item Sys::Virt::Domain::BLOCK_JOB_ABORT_ASYNC
4760
4761 Request only, do not wait for completion
4762
4763 =item Sys::Virt::Domain::BLOCK_JOB_ABORT_PIVOT
4764
4765 Pivot to mirror when ending a copy job
4766
4767 =back
4768
4769 =head2 DOMAIN BLOCK COMMIT JOB CONSTANTS
4770
4771 The following constants are useful with block commit job types
4772
4773 =over 4
4774
4775 =item Sys::Virt::Domain::BLOCK_COMMIT_DELETE
4776
4777 Delete any files that are invalid after commit
4778
4779 =item Sys::Virt::Domain::BLOCK_COMMIT_SHALLOW
4780
4781 NULL base means next backing file, not whole chain
4782
4783 =item Sys::Virt::Domain::BLOCK_COMMIT_ACTIVE
4784
4785 Allow two phase commit when top is active layer
4786
4787 =item Sys::Virt::Domain::BLOCK_COMMIT_RELATIVE
4788
4789 Keep backing chain referenced using relative names
4790
4791 =back
4792
4793 =head2 DOMAIN SAVE / RESTORE FLAG CONSTANTS
4794
4795 The following constants can be used when saving or restoring
4796 virtual machines
4797
4798 =over 4
4799
4800 =item Sys::Virt::Domain::SAVE_BYPASS_CACHE
4801
4802 Do not use OS I/O cache when saving state.
4803
4804 =item Sys::Virt::Domain::SAVE_PAUSED
4805
4806 Mark the saved state as paused to prevent the guest CPUs
4807 starting upon restore.
4808
4809 =item Sys::Virt::Domain::SAVE_RUNNING
4810
4811 Mark the saved state as running to allow the guest CPUs
4812 to start upon restore.
4813
4814 =item Sys::Virt::Domain::SAVE_RESET_NVRAM
4815
4816 Reset the firmware NVRAM state from its original template
4817
4818 =back
4819
4820 =head2 SAVE / RESTORE PARAMETER CONSTANTS
4821
4822 =over 4
4823
4824 =item Sys::Virt::Domain::SAVE_PARAM_FILE
4825
4826 Specify the save state file to save to or restore from.
4827
4828 =item Sys::Virt::Domain::SAVE_PARAM_DXML
4829
4830 Used to adjust guest xml on restore, e.g. to alter a device while domain is
4831 stopped.
4832
4833 =item Sys::Virt::Domain::SAVE_PARAM_IMAGE_FORMAT
4834
4835 Specify the save state image format. This can be one of the following
4836 constant values
4837
4838 =over 4
4839
4840 =item Sys::Virt::Domain::SAVE_PARAM_IMAGE_FORMAT_RAW
4841
4842 Uncompressed raw image
4843
4844 =item Sys::Virt::Domain::SAVE_PARAM_IMAGE_FORMAT_GZIP
4845
4846 Image compressed with gzip
4847
4848 =item Sys::Virt::Domain::SAVE_PARAM_IMAGE_FORMAT_BZIP2
4849
4850 Image compressed with bzip2
4851
4852 =item Sys::Virt::Domain::SAVE_PARAM_IMAGE_FORMAT_XZ
4853
4854 Image compressed with xz
4855
4856 =item Sys::Virt::Domain::SAVE_PARAM_IMAGE_FORMAT_LZOP
4857
4858 Image compressed with lzop
4859
4860 =item Sys::Virt::Domain::SAVE_PARAM_IMAGE_FORMAT_ZSTD
4861
4862 Image compressed with zstd
4863
4864 =item Sys::Virt::Domain::SAVE_PARAM_IMAGE_FORMAT_SPARSE
4865
4866 Uncompressed sparse image
4867
4868 =back
4869
4870 =item Sys::Virt::Domain::SAVE_PARAM_PARALLEL_CHANNELS
4871
4872 Specify the number of IO channels to use during parallel save or
4873 restore.
4874
4875 =back
4876
4877 =head2 DOMAIN CORE DUMP CONSTANTS
4878
4879 The following constants can be used when triggering domain
4880 core dumps
4881
4882 =over 4
4883
4884 =item Sys::Virt::Domain::DUMP_LIVE
4885
4886 Do not pause execution while dumping the guest
4887
4888 =item Sys::Virt::Domain::DUMP_CRASH
4889
4890 Crash the guest after completing the core dump
4891
4892 =item Sys::Virt::Domain::DUMP_BYPASS_CACHE
4893
4894 Do not use OS I/O cache when writing core dump
4895
4896 =item Sys::Virt::Domain::DUMP_RESET
4897
4898 Reset the virtual machine after finishing the dump
4899
4900 =item Sys::Virt::Domain::DUMP_MEMORY_ONLY
4901
4902 Only include guest RAM in the dump, not the device
4903 state
4904
4905 =back
4906
4907 =head2 DESTROY CONSTANTS
4908
4909 The following constants are useful when terminating guests
4910 using the C<destroy> API.
4911
4912 =over 4
4913
4914 =item Sys::Virt::Domain::DESTROY_DEFAULT
4915
4916 Destroy the guest using the default approach
4917
4918 =item Sys::Virt::Domain::DESTROY_GRACEFUL
4919
4920 Destroy the guest in a graceful manner
4921
4922 =item Sys::Virt::Domain::DESTROY_REMOVE_LOGS
4923
4924 Delete log files associated with the guest
4925
4926 =back
4927
4928 =head2 SHUTDOWN CONSTANTS
4929
4930 The following constants are useful when requesting that a
4931 guest terminate using the C<shutdown> API
4932
4933 =over 4
4934
4935 =item Sys::Virt::Domain::SHUTDOWN_DEFAULT
4936
4937 Shutdown using the hypervisor's default mechanism
4938
4939 =item Sys::Virt::Domain::SHUTDOWN_GUEST_AGENT
4940
4941 Shutdown by issuing a command to a guest agent
4942
4943 =item Sys::Virt::Domain::SHUTDOWN_ACPI_POWER_BTN
4944
4945 Shutdown by injecting an ACPI power button press
4946
4947 =item Sys::Virt::Domain::SHUTDOWN_INITCTL
4948
4949 Shutdown by talking to initctl (containers only)
4950
4951 =item Sys::Virt::Domain::SHUTDOWN_SIGNAL
4952
4953 Shutdown by sending SIGTERM to the init process
4954
4955 =item Sys::Virt::Domain::SHUTDOWN_PARAVIRT
4956
4957 Shutdown by issuing a paravirt power control command
4958
4959 =back
4960
4961 =head2 REBOOT CONSTANTS
4962
4963 The following constants are useful when requesting that a
4964 guest terminate using the C<reboot> API
4965
4966 =over 4
4967
4968 =item Sys::Virt::Domain::REBOOT_DEFAULT
4969
4970 Reboot using the hypervisor's default mechanism
4971
4972 =item Sys::Virt::Domain::REBOOT_GUEST_AGENT
4973
4974 Reboot by issuing a command to a guest agent
4975
4976 =item Sys::Virt::Domain::REBOOT_ACPI_POWER_BTN
4977
4978 Reboot by injecting an ACPI power button press
4979
4980 =item Sys::Virt::Domain::REBOOT_INITCTL
4981
4982 Reboot by talking to initctl (containers only)
4983
4984 =item Sys::Virt::Domain::REBOOT_SIGNAL
4985
4986 Reboot by sending SIGHUP to the init process
4987
4988 =item Sys::Virt::Domain::REBOOT_PARAVIRT
4989
4990 Reboot by issuing a paravirt power control command
4991
4992 =back
4993
4994 =head2 METADATA CONSTANTS
4995
4996 The following constants are useful when reading/writing
4997 metadata about a guest
4998
4999 =over 4
5000
5001 =item Sys::Virt::Domain::METADATA_TITLE
5002
5003 The short human friendly title of the guest
5004
5005 =item Sys::Virt::Domain::METADATA_DESCRIPTION
5006
5007 The long free text description of the guest
5008
5009 =item Sys::Virt::Domain::METADATA_ELEMENT
5010
5011 The structured metadata elements for the guest
5012
5013 =back
5014
5015 =head2 DISK ERROR CONSTANTS
5016
5017 The following constants are useful when interpreting
5018 disk error codes
5019
5020 =over 4
5021
5022 =item Sys::Virt::Domain::DISK_ERROR_NONE
5023
5024 No error
5025
5026 =item Sys::Virt::Domain::DISK_ERROR_NO_SPACE
5027
5028 The host storage has run out of free space
5029
5030 =item Sys::Virt::Domain::DISK_ERROR_UNSPEC
5031
5032 An unspecified error has occurred.
5033
5034 =back
5035
5036 =head2 MEMORY STATISTIC CONSTANTS
5037
5038 =over 4
5039
5040 =item Sys::Virt::Domain::MEMORY_STAT_SWAP_IN
5041
5042 Swap in
5043
5044 =item Sys::Virt::Domain::MEMORY_STAT_SWAP_OUT
5045
5046 Swap out
5047
5048 =item Sys::Virt::Domain::MEMORY_STAT_MINOR_FAULT
5049
5050 Minor faults
5051
5052 =item Sys::Virt::Domain::MEMORY_STAT_MAJOR_FAULT
5053
5054 Major faults
5055
5056 =item Sys::Virt::Domain::MEMORY_STAT_RSS
5057
5058 Resident memory
5059
5060 =item Sys::Virt::Domain::MEMORY_STAT_UNUSED
5061
5062 Unused memory
5063
5064 =item Sys::Virt::Domain::MEMORY_STAT_AVAILABLE
5065
5066 Available memory
5067
5068 =item Sys::Virt::Domain::MEMORY_STAT_ACTUAL_BALLOON
5069
5070 Actual balloon limit
5071
5072 =item Sys::Virt::Domain::MEMORY_STAT_USABLE
5073
5074 Amount of usable memory
5075
5076 =item Sys::Virt::Domain::MEMORY_STAT_LAST_UPDATE
5077
5078 Time of last stats refresh from guest
5079
5080 =item Sys::Virt::Domain::MEMORY_STAT_DISK_CACHES
5081
5082 Disk cache size
5083
5084 =item Sys::Virt::Domain::MEMORY_STAT_HUGETLB_PGALLOC
5085
5086 The amount of successful huge page allocations
5087
5088 =item Sys::Virt::Domain::MEMORY_STAT_HUGETLB_PGFAIL
5089
5090 The amount of failed huge page allocations
5091
5092 =back
5093
5094 =head2 DOMAIN LIST CONSTANTS
5095
5096 The following constants can be used when listing domains
5097
5098 =over 4
5099
5100 =item Sys::Virt::Domain::LIST_ACTIVE
5101
5102 Only list domains that are currently active (running, or paused)
5103
5104 =item Sys::Virt::Domain::LIST_AUTOSTART
5105
5106 Only list domains that are set to automatically start on boot
5107
5108 =item Sys::Virt::Domain::LIST_HAS_SNAPSHOT
5109
5110 Only list domains that have a stored snapshot
5111
5112 =item Sys::Virt::Domain::LIST_INACTIVE
5113
5114 Only list domains that are currently inactive (shutoff, saved)
5115
5116 =item Sys::Virt::Domain::LIST_MANAGEDSAVE
5117
5118 Only list domains that have current managed save state
5119
5120 =item Sys::Virt::Domain::LIST_NO_AUTOSTART
5121
5122 Only list domains that are not set to automatically start on boto
5123
5124 =item Sys::Virt::Domain::LIST_NO_MANAGEDSAVE
5125
5126 Only list domains that do not have any managed save state
5127
5128 =item Sys::Virt::Domain::LIST_NO_SNAPSHOT
5129
5130 Only list domains that do not have a stored snapshot
5131
5132 =item Sys::Virt::Domain::LIST_OTHER
5133
5134 Only list domains that are not running, paused or shutoff
5135
5136 =item Sys::Virt::Domain::LIST_PAUSED
5137
5138 Only list domains that are paused
5139
5140 =item Sys::Virt::Domain::LIST_PERSISTENT
5141
5142 Only list domains which have a persistent config
5143
5144 =item Sys::Virt::Domain::LIST_RUNNING
5145
5146 Only list domains that are currently running
5147
5148 =item Sys::Virt::Domain::LIST_SHUTOFF
5149
5150 Only list domains that are currently shutoff
5151
5152 =item Sys::Virt::Domain::LIST_TRANSIENT
5153
5154 Only list domains that do not have a persistent config
5155
5156 =item Sys::Virt::Domain::LIST_HAS_CHECKPOINT
5157
5158 Only list domains that have a stored checkpoint
5159
5160 =item Sys::Virt::Domain::LIST_NO_CHECKPOINT
5161
5162 Only list domains that do not have a stored checkpoint
5163
5164 =back
5165
5166 =head2 SEND KEY CONSTANTS
5167
5168 The following constants are to be used with the C<send_key>
5169 API
5170
5171 =over 4
5172
5173 =item Sys::Virt::Domain::SEND_KEY_MAX_KEYS
5174
5175 The maximum number of keys that can be sent in a single
5176 call to C<send_key>
5177
5178 =back
5179
5180 =head2 BLOCK STATS CONSTANTS
5181
5182 The following constants provide the names of well known
5183 block stats fields
5184
5185 =over 4
5186
5187 =item Sys::Virt::Domain::BLOCK_STATS_ERRS
5188
5189 The number of I/O errors
5190
5191 =item Sys::Virt::Domain::BLOCK_STATS_FLUSH_REQ
5192
5193 The number of flush requests
5194
5195 =item Sys::Virt::Domain::BLOCK_STATS_FLUSH_TOTAL_TIMES
5196
5197 The time spent processing flush requests
5198
5199 =item Sys::Virt::Domain::BLOCK_STATS_READ_BYTES
5200
5201 The amount of data read
5202
5203 =item Sys::Virt::Domain::BLOCK_STATS_READ_REQ
5204
5205 The number of read requests
5206
5207 =item Sys::Virt::Domain::BLOCK_STATS_READ_TOTAL_TIMES
5208
5209 The time spent processing read requests
5210
5211 =item Sys::Virt::Domain::BLOCK_STATS_WRITE_BYTES
5212
5213 The amount of data written
5214
5215 =item Sys::Virt::Domain::BLOCK_STATS_WRITE_REQ
5216
5217 The number of write requests
5218
5219 =item Sys::Virt::Domain::BLOCK_STATS_WRITE_TOTAL_TIMES
5220
5221 The time spent processing write requests
5222
5223 =back
5224
5225 =head2 CPU STATS CONSTANTS
5226
5227 The following constants provide the names of well known
5228 cpu stats fields
5229
5230 =over 4
5231
5232 =item Sys::Virt::Domain::CPU_STATS_CPUTIME
5233
5234 The total CPU time, including both hypervisor and
5235 vCPU time.
5236
5237 =item Sys::Virt::Domain::CPU_STATS_USERTIME
5238
5239 THe total time in kernel
5240
5241 =item Sys::Virt::Domain::CPU_STATS_SYSTEMTIME
5242
5243 The total time in userspace
5244
5245 =item Sys::Virt::Domain::CPU_STATS_VCPUTIME
5246
5247 The total vCPU time.
5248
5249 =back
5250
5251 =head2 CPU STATS CONSTANTS
5252
5253 The following constants provide the names of well known
5254 schedular parameters
5255
5256 =over 4
5257
5258 =item Sys::Virt::SCHEDULER_EMULATOR_PERIOD
5259
5260 The duration of the time period for scheduling the emulator
5261
5262 =item Sys::Virt::SCHEDULER_EMULATOR_QUOTA
5263
5264 The quota for the emulator in one schedular time period
5265
5266 =item Sys::Virt::SCHEDULER_IOTHREAD_PERIOD
5267
5268 The duration of the time period for scheduling the iothread
5269
5270 =item Sys::Virt::SCHEDULER_IOTHREAD_QUOTA
5271
5272 The quota for the iothread in one schedular time period
5273
5274 =back
5275
5276 =head2 DOMAIN STATS FLAG CONSTANTS
5277
5278 The following constants are used as flags when requesting
5279 bulk domain stats from C<Sys::Virt::get_all_domain_stats>.
5280
5281 =over 4
5282
5283 =item Sys::Virt::Domain::GET_ALL_STATS_ACTIVE
5284
5285 Include stats for active domains
5286
5287 =item Sys::Virt::Domain::GET_ALL_STATS_INACTIVE
5288
5289 Include stats for inactive domains
5290
5291 =item Sys::Virt::Domain::GET_ALL_STATS_OTHER
5292
5293 Include stats for other domains
5294
5295 =item Sys::Virt::Domain::GET_ALL_STATS_PAUSED
5296
5297 Include stats for paused domains
5298
5299 =item Sys::Virt::Domain::GET_ALL_STATS_PERSISTENT
5300
5301 Include stats for persistent domains
5302
5303 =item Sys::Virt::Domain::GET_ALL_STATS_RUNNING
5304
5305 Include stats for running domains
5306
5307 =item Sys::Virt::Domain::GET_ALL_STATS_SHUTOFF
5308
5309 Include stats for shutoff domains
5310
5311 =item Sys::Virt::Domain::GET_ALL_STATS_TRANSIENT
5312
5313 Include stats for transient domains
5314
5315 =item Sys::Virt::Domain::GET_ALL_STATS_ENFORCE_STATS
5316
5317 Require that all requested stats fields are returned
5318
5319 =item Sys::Virt::Domain::GET_ALL_STATS_BACKING
5320
5321 Get stats for image backing files too
5322
5323 =item Sys::Virt::Domain::GET_ALL_STATS_NOWAIT
5324
5325 Skip stats if they can't be acquired without waiting
5326
5327 =back
5328
5329 =head2 DOMAIN STATS FIELD CONSTANTS
5330
5331 The following constants are used to control which fields
5332 are returned for stats queries.
5333
5334 =over
5335
5336 =item Sys::Virt::Domain::STATS_BALLOON
5337
5338 Balloon statistics.
5339
5340 The following keys will be used for the returned parameters
5341
5342 =over 4
5343
5344 =item Sys::Virt::Domain::STATS_BALLOON_CURRENT
5345
5346 The memory in kiB currently used as unsigned long long.
5347
5348 =item Sys::Virt::Domain::STATS_BALLOON_MAXIMUM
5349
5350 The maximum memory in kiB allowed as unsigned long long.
5351
5352 =item Sys::Virt::Domain::STATS_BALLOON_SWAP_IN
5353
5354 The amount of data read from swap space (in KiB) as unsigned long long.
5355
5356 =item Sys::Virt::Domain::STATS_BALLOON_SWAP_OUT
5357
5358 The amount of memory written out to swap space (in KiB) as unsigned long
5359
5360 =item Sys::Virt::Domain::STATS_BALLOON_MAJOR_FAULT
5361
5362 The number of page faults when disk IO was required as unsigned long long.
5363
5364 =item Sys::Virt::Domain::STATS_BALLOON_MINOR_FAULT
5365
5366 The number of other page faults as unsigned long long.
5367
5368 =item Sys::Virt::Domain::STATS_BALLOON_UNUSED
5369
5370 The amount of memory left unused by the system (in KiB) as unsigned long
5371
5372 =item Sys::Virt::Domain::STATS_BALLOON_AVAILABLE
5373
5374 The amount of usable memory as seen by the domain (in KiB) as unsigned long
5375
5376 =item Sys::Virt::Domain::STATS_BALLOON_RSS
5377
5378 Resident Set Size of running domain's process (in KiB) as unsigned long
5379 long.
5380
5381 =item Sys::Virt::Domain::STATS_BALLOON_USABLE
5382
5383 The amount of memory which can be reclaimed by balloon without causing host
5384 swapping (in KiB) as unsigned long long.
5385
5386 =item Sys::Virt::Domain::STATS_BALLOON_LAST_UPDATE
5387
5388 Timestamp of the last update of statistics (in seconds) as unsigned long
5389 long.
5390
5391 =item Sys::Virt::Domain::STATS_BALLOON_DISK_CACHES
5392
5393 The amount of memory that can be reclaimed without additional I/O,
5394 typically disk (in KiB) as unsigned long long.
5395
5396 =item Sys::Virt::Domain::STATS_BALLOON_HUGETLB_PGALLOC
5397
5398 The number of successful huge page allocations from inside the domain via
5399 virtio balloon as unsigned long long.
5400
5401 =item Sys::Virt::Domain::STATS_BALLOON_HUGETLB_PGFAIL
5402
5403 The number of failed huge page allocations from inside the domain via
5404 virtio balloon as unsigned long long.
5405
5406 =back
5407
5408 =item Sys::Virt::Domain::STATS_BLOCK
5409
5410 Block device info.
5411
5412 The following keys will be used for the returned parameters
5413
5414 =over 4
5415
5416 =item Sys::Virt::Domain::STATS_BLOCK_COUNT
5417
5418 Number of block devices in the subsequent list, as unsigned int.
5419
5420 =item Sys::Virt::Domain::STATS_BLOCK_PREFIX
5421
5422 The parameter name prefix to access each disk entry. Concatenate the
5423 prefix, the entry number formatted as an unsigned integer and one of the
5424 block suffix parameters to form a complete parameter name.
5425
5426 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_NAME
5427
5428 Name of the block device as string. Matches the target name (vda/sda/hda)
5429 of the block device. If the backing chain is listed, this name is the same
5430 for all host resources tied to the same guest device.
5431
5432 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_BACKINGINDEX
5433
5434 The <backingStore> index as unsigned int, only used when backing images are
5435 listed.
5436
5437 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_PATH
5438
5439 Source of the block device as a string, if it is a file or block device
5440 (omitted for network sources and drives with no media inserted).
5441
5442 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_RD_REQS
5443
5444 Number of read requests as unsigned long long.
5445
5446 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_RD_BYTES
5447
5448 Number of read bytes as unsigned long long.
5449
5450 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_RD_TIMES
5451
5452 Total time (ns) spent on reads as unsigned long long.
5453
5454 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_WR_REQS
5455
5456 Number of write requests as unsigned long long.
5457
5458 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_WR_BYTES
5459
5460 Number of written bytes as unsigned long long.
5461
5462 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_WR_TIMES
5463
5464 Total time (ns) spent on writes as unsigned long long.
5465
5466 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_FL_REQS
5467
5468 Total flush requests as unsigned long long.
5469
5470 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_FL_TIMES
5471
5472 Total time (ns) spent on cache flushing as unsigned long long.
5473
5474 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_ERRORS
5475
5476 Xen only: the 'oo_req' value as unsigned long long.
5477
5478 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_ALLOCATION
5479
5480 Offset of the highest written sector as unsigned long long.
5481
5482 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_CAPACITY
5483
5484 Logical size in bytes of the block device backing image as unsigned long
5485
5486 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_PHYSICAL
5487
5488 Physical size in bytes of the container of the backing image as unsigned
5489 long long.
5490
5491 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_THRESHOLD
5492
5493 Current threshold for delivering the VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD
5494 event in bytes as unsigned long long. See virDomainSetBlockThreshold.
5495
5496 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_DISCARD_ALIGNMENT
5497
5498 Alignment for discard requests in bytes, as unsigned long long.
5499
5500 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_DISCARD_MAX
5501
5502 Alignment for discard requests in bytes, as unsigned long long.
5503
5504 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_IOV_HW_MAX
5505
5506 Maximal number of scatter/gather elements of requests bypassing
5507 kernel IO scheduler, as unsigned long long.
5508
5509 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_IOV_MAX
5510
5511 Maximum number of scatter/gather elements, as unsigned long long.
5512
5513 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_MEMORY_ALIGNMENT_MINIMAL
5514
5515 Memory alignment in bytes so that no bounce buffer is needed, as
5516 unsigned long long.
5517
5518 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_MEMORY_ALIGNMENT_OPTIMAL
5519
5520 Memory alignment in bytes that is used for bounce buffers, as
5521 unsigned long long.
5522
5523 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_REQUEST_ALIGNMENT
5524
5525 Alignment requirement, in bytes, for offset/length of I/O
5526 requests, as unsigned long long.
5527
5528 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_HW_MAX
5529
5530 Maximal hardware transfer length of requests bypassing kernel IO
5531 scheduler in bytes, as unsigned long long.
5532
5533 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_MAX
5534
5535 Maximal transfer length in bytes, as unsigned long long.
5536
5537 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_OPTIMAL
5538
5539 Optimal transfer length in bytes, as unsigned long long.
5540
5541 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_WRITE_ZEROES_ALIGNMENT
5542
5543 Optimal alignment for write_zeroes requests in bytes, as unsigned
5544 long long.
5545
5546 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LIMITS_WRITE_ZEROES_MAX
5547
5548 Maximum number of bytes that can be zeroed out at once, as
5549 unsigned long long.
5550
5551 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_COUNT
5552
5553 Number of groups of statistics accounted in a configured time
5554 intervals as unsigned long long.
5555
5556 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_PREFIX
5557
5558 The parameter name prefix to access each group of timed stats.
5559 Concatenate the prefix, the entry number formatted as an unsigned
5560 integer and one of the timed group suffix parameters to form a
5561 complete paramter name.
5562
5563 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_AVG
5564
5565 Average latency of flush operations in the defined interval, in
5566 nanoseconds as unsigned long long.
5567
5568 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_MAX
5569
5570 Maximum latency of flush operations in the defined interval, in
5571 nanoseconds as unsigned long long.
5572
5573 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_MIN
5574
5575 Minimum latency of flush operations in the defined interval, in
5576 nanoseconds as unsigned long long.
5577
5578 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_INTERVAL
5579
5580 The time interval in seconds as unsigned long long for which the
5581 statistics in this group were collected.
5582
5583 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_LATENCY_AVG
5584
5585 Average latency of read operations in the defined interval, in
5586 nanoseconds as unsigned long long.
5587
5588 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_LATENCY_MAX
5589
5590 Maximum latency of read operations in the defined interval, in
5591 nanoseconds as unsigned long long.
5592
5593 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_LATENCY_MIN
5594
5595 Minimum latency of read operations in the defined interval, in
5596 nanoseconds as unsigned long long.
5597
5598 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_QUEUE_DEPTH_AVG
5599
5600 Average number of pending read operations in the defined interval
5601 as double.
5602
5603 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_AVG
5604
5605 Average latency of write operations in the defined interval, in
5606 nanoseconds as unsigned long long.
5607
5608 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_MAX
5609
5610 Maximum latency of write operations in the defined interval, in
5611 nanoseconds as unsigned long long.
5612
5613 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_MIN
5614
5615 Minimum latency of write operations in the defined interval, in
5616 nanoseconds as unsigned long long.
5617
5618 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_QUEUE_DEPTH_AVG
5619
5620 Average number of pending write operations in the defined interval as double.
5621
5622 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_LATENCY_AVG
5623
5624 Average latency of zone append operations in the defined
5625 interval, in nanoseconds as unsigned long long.
5626
5627 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_LATENCY_MAX
5628
5629 Maximum latency of zone append operations in the defined
5630 interval, in nanoseconds as unsigned long long.
5631
5632 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_LATENCY_MIN
5633
5634 Minimum latency of zone append operations in the defined
5635 interval, in nanoseconds as unsigned long long.
5636
5637 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_QUEUE_DEPTH_AVG
5638
5639 Average number of pending zone append operations in the defined
5640 interval as double.
5641
5642 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_FLUSH_PREFIX
5643
5644 The parameter name prefix to access 'flush' latency histograms.
5645
5646 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_READ_PREFIX
5647
5648 The parameter name prefix to access 'read' latency histograms.
5649
5650 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_WRITE_PREFIX
5651
5652 The parameter name prefix to access 'write' latency histograms.
5653
5654 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_ZONE_APPEND_PREFIX
5655
5656 The parameter name prefix to access 'zone_append' latency histograms.
5657
5658 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_SUFFIX_BIN_COUNT
5659
5660 The parameter name suffix to access number of bins in the histogram stats.
5661
5662 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_SUFFIX_BIN_PREFIX
5663
5664 The parameter name suffix to access a latency histogram bin.
5665
5666 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_SUFFIX_BIN_SUFFIX_START
5667
5668 Start of the current latency histogram bin in nanoseconds
5669
5670 =item Sys::Virt::Domain::STATS_BLOCK_SUFFIX_LATENCY_HISTOGRAM_SUFFIX_BIN_SUFFIX_VALUE
5671
5672 Current value of the number of occurences of the latency within this bin
5673
5674 =back
5675
5676 =item Sys::Virt::Domain::STATS_CPU_TOTAL
5677
5678 CPU usage info.
5679
5680 The following keys will be used for the returned parameters
5681
5682 =over 4
5683
5684
5685 =item Sys::Virt::Domain::STATS_CPU_TIME
5686
5687 Total cpu time spent for this domain in nanoseconds as unsigned long long.
5688
5689 =item Sys::Virt::Domain::STATS_CPU_USER
5690
5691 User cpu time spent in nanoseconds as unsigned long long.
5692
5693 =item Sys::Virt::Domain::STATS_CPU_SYSTEM
5694
5695 System cpu time spent in nanoseconds as unsigned long long.
5696
5697 =item Sys::Virt::Domain::STATS_CPU_HALTPOLL_SUCCESS_TIME
5698
5699 Halt-polling cpu usage about the VCPU polled until a virtual interrupt was
5700 delivered in nanoseconds as unsigned long long.
5701
5702 =item Sys::Virt::Domain::STATS_CPU_HALTPOLL_FAIL_TIME
5703
5704 Halt-polling cpu usage about the VCPU had to schedule out (either because
5705 the maximum poll time was reached or it needed to yield the CPU) in
5706 nanoseconds as unsigned long long.
5707
5708 =item Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_COUNT
5709
5710 The number of cache monitors for this domain as an unsigned int.
5711
5712 =item Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_PREFIX
5713
5714 The parameter name prefix to access each cache monitor entry. Concatenate
5715 the prefix, the entry number formatted as an unsigned integer and one of
5716 the cache monitor suffix parameters to form a complete parameter name.
5717
5718 =item Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_NAME
5719
5720 The name of cache monitor as a string.
5721
5722 =item Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_VCPUS
5723
5724 Vcpu list of cache monitor as a string.
5725
5726 =item Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_COUNT
5727
5728 The number of cache banks in cache monitor as an unsigned int.
5729
5730 =item Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_PREFIX
5731
5732 The parameter name prefix to access each cache monitor bank entry.
5733 Concatenate the cache monitor prefix, the cache monitor entry number
5734 formatted as an unsigned integer, the bank prefix, the bank entry number
5735 formatted as an unsigned integer and one of the cache monitor bank suffix
5736 parameters to form a complete parameter name.
5737
5738 =item Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_SUFFIX_ID
5739
5740 Host allocated cache id for the bank as an unsigned int.
5741
5742 =item Sys::Virt::Domain::STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_SUFFIX_BYTES
5743
5744 The number of bytes of last level cache that the domain is using as an
5745 unsigned long long.
5746
5747 =item Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_COUNT
5748
5749 The number of energy monitors for this domain, as an unsigned int.
5750
5751 =item Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_PREFIX
5752
5753 Prefix for an individual energy monitor group. Concatenate with
5754 the monitor index and one of the "cpu.energy.monitor.<i>." suffix
5755 constants below to form a full parameter name.
5756
5757 =item Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_SUFFIX_NAME
5758
5759 Name of the monitor group as a string.
5760
5761 =item Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_SUFFIX_VCPUS
5762
5763 vCPU set covered by the monitor group as a string.
5764
5765 =item Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_SUFFIX_PKG_COUNT
5766
5767 Number of PERF_PKG nodes the monitor group exposes, as an unsigned int.
5768
5769 =item Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_SUFFIX_PKG_PREFIX
5770
5771 Prefix for a single mon_PERF_PKG node inside a monitor group.
5772
5773 =item Sys::Virt::Domain::STATS_CPU_ENERGY_MONITOR_SUFFIX_PKG_SUFFIX_ID
5774
5775 Kernel-assigned mon_PERF_PKG node id, as an unsigned int.
5776
5777 =back
5778
5779 =item Sys::Virt::Domain::STATS_INTERFACE
5780
5781 Network interface info.
5782
5783 The following keys will be used for the returned parameters
5784
5785 =over 4
5786
5787 =item Sys::Virt::Domain::STATS_NET_COUNT
5788
5789 Number of network interfaces on this domain as unsigned int.
5790
5791 =item Sys::Virt::Domain::STATS_NET_PREFIX
5792
5793 The parameter name prefix to access each interface entry. Concatenate the
5794 prefix, the entry number formatted as an unsigned integer and one of the
5795 network suffix parameters to form a complete parameter name.
5796
5797 =item Sys::Virt::Domain::STATS_NET_SUFFIX_NAME
5798
5799 Name of the interface as string.
5800
5801 =item Sys::Virt::Domain::STATS_NET_SUFFIX_RX_BYTES
5802
5803 Bytes received as unsigned long long.
5804
5805 =item Sys::Virt::Domain::STATS_NET_SUFFIX_RX_PKTS
5806
5807 Packets received as unsigned long long.
5808
5809 =item Sys::Virt::Domain::STATS_NET_SUFFIX_RX_ERRS
5810
5811 Receive errors as unsigned long long.
5812
5813 =item Sys::Virt::Domain::STATS_NET_SUFFIX_RX_DROP
5814
5815 Receive packets dropped as unsigned long long.
5816
5817 =item Sys::Virt::Domain::STATS_NET_SUFFIX_TX_BYTES
5818
5819 Bytes transmitted as unsigned long long.
5820
5821 =item Sys::Virt::Domain::STATS_NET_SUFFIX_TX_PKTS
5822
5823 Packets transmitted as unsigned long long.
5824
5825 =item Sys::Virt::Domain::STATS_NET_SUFFIX_TX_ERRS
5826
5827 Transmission errors as unsigned long long.
5828
5829 =item Sys::Virt::Domain::STATS_NET_SUFFIX_TX_DROP
5830
5831 Transmit packets dropped as unsigned long long.
5832
5833 =back
5834
5835 =item Sys::Virt::Domain::STATS_STATE
5836
5837 General lifecycle state.
5838
5839 The following keys will be used for the returned parameters
5840
5841 =over 4
5842
5843 =item Sys::Virt::Domain::STATS_STATE_STATE
5844
5845 State of the VM, returned as int from virDomainState enum.
5846
5847 =item Sys::Virt::Domain::STATS_STATE_REASON
5848
5849 Reason for entering given state, returned as int from virDomain*Reason
5850 enum corresponding to given state.
5851
5852 =back
5853
5854 =item Sys::Virt::Domain::STATS_VCPU
5855
5856 Virtual CPU info.
5857
5858 The following keys will be used for the returned parameters
5859
5860 =over 4
5861
5862 =item Sys::Virt::Domain::STATS_VCPU_CURRENT
5863
5864 Current number of online virtual CPUs as unsigned int.
5865
5866 =item Sys::Virt::Domain::STATS_VCPU_MAXIMUM
5867
5868 Maximum number of online virtual CPUs as unsigned int.
5869
5870 =item Sys::Virt::Domain::STATS_VCPU_PREFIX
5871
5872 The parameter name prefix to access each vCPU entry. Concatenate the
5873 prefix, the entry number formatted as an unsigned integer and one of the
5874 vCPU suffix parameters to form a complete parameter name.
5875
5876 Due to VCPU hotplug, the array could be sparse. The actual number of
5877 entries present corresponds to VIR_DOMAIN_STATS_VCPU_CURRENT, while the
5878 array size will never exceed VIR_DOMAIN_STATS_VCPU_MAXIMUM.
5879
5880 =item Sys::Virt::Domain::STATS_VCPU_SUFFIX_STATE
5881
5882 State of the virtual CPU <num>, as int from virVcpuState enum.
5883
5884 =item Sys::Virt::Domain::STATS_VCPU_SUFFIX_TIME
5885
5886 Virtual cpu time spent by virtual CPU as unsigned long long.
5887
5888 =item Sys::Virt::Domain::STATS_VCPU_SUFFIX_WAIT
5889
5890 Time the vCPU wants to run, but the host scheduler has something else
5891 running ahead of it as unsigned long long.
5892
5893 =item Sys::Virt::Domain::STATS_VCPU_SUFFIX_HALTED
5894
5895 Virtual CPU is halted as a boolean, may indicate the processor is idle or
5896 even disabled, depending on the architecture.
5897
5898 =item Sys::Virt::Domain::STATS_VCPU_SUFFIX_DELAY
5899
5900 Time the vCPU thread was enqueued by the host scheduler, but was waiting in
5901 the queue instead of running. Exposed to the VM as a steal time. In
5902 nanoseconds as unsigned long long.
5903
5904 =back
5905
5906 =item Sys::Virt::Domain::STATS_PERF
5907
5908 Performance event counter values.
5909
5910 The following keys will be used for the returned parameters
5911
5912 =over 4
5913
5914 =item Sys::Virt::Domain::STATS_PERF_CMT
5915
5916 The usage of l3 cache (bytes) by applications running on the platform as
5917 unsigned long long. It is produced by the cmt perf event.
5918
5919 =item Sys::Virt::Domain::STATS_PERF_MBMT
5920
5921 The total system bandwidth (bytes/s) from one level of cache to another as
5922 unsigned long long. It is produced by the mbmt perf event.
5923
5924 =item Sys::Virt::Domain::STATS_PERF_MBML
5925
5926 The amount of data (bytes/s) sent through the memory controller on the
5927 socket as unsigned long long. It is produced by the mbml perf event.
5928
5929 =item Sys::Virt::Domain::STATS_PERF_CACHE_MISSES
5930
5931 The count of cache misses as unsigned long long. It is produced by the
5932 cache_misses perf event.
5933
5934 =item Sys::Virt::Domain::STATS_PERF_CACHE_REFERENCES
5935
5936 The count of cache hits as unsigned long long. It is produced by the
5937 cache_references perf event.
5938
5939 =item Sys::Virt::Domain::STATS_PERF_INSTRUCTIONS
5940
5941 The count of instructions as unsigned long long. It is produced by the
5942 instructions perf event.
5943
5944 =item Sys::Virt::Domain::STATS_PERF_CPU_CYCLES
5945
5946 The count of cpu cycles (total/elapsed) as an unsigned long long. It is
5947 produced by the cpu_cycles perf event.
5948
5949 =item Sys::Virt::Domain::STATS_PERF_BRANCH_INSTRUCTIONS
5950
5951 The count of branch instructions as unsigned long long. It is produced by
5952 the branch_instructions perf event.
5953
5954 =item Sys::Virt::Domain::STATS_PERF_BRANCH_MISSES
5955
5956 The count of branch misses as unsigned long long. It is produced by the
5957 branch_misses perf event.
5958
5959 =item Sys::Virt::Domain::STATS_PERF_BUS_CYCLES
5960
5961 The count of bus cycles as unsigned long long. It is produced by the
5962 bus_cycles perf event.
5963
5964 =item Sys::Virt::Domain::STATS_PERF_STALLED_CYCLES_FRONTEND
5965
5966 The count of stalled cpu cycles in the frontend of the instruction processor
5967 pipeline as unsigned long long. It is produced by the
5968 stalled_cycles_frontend perf event.
5969
5970 =item Sys::Virt::Domain::STATS_PERF_STALLED_CYCLES_BACKEND
5971
5972 The count of stalled cpu cycles in the backend of the instruction processor
5973 pipeline as unsigned long long. It is produced by the stalled_cycles_backend
5974 perf event.
5975
5976 =item Sys::Virt::Domain::STATS_PERF_REF_CPU_CYCLES
5977
5978 The count of total cpu cycles not affected by CPU frequency scaling by
5979 applications running as unsigned long long. It is produced by the
5980 ref_cpu_cycles perf event.
5981
5982 =item Sys::Virt::Domain::STATS_PERF_CPU_CLOCK
5983
5984 The count of cpu clock time as unsigned long long. It is produced by the
5985 cpu_clock perf event.
5986
5987 =item Sys::Virt::Domain::STATS_PERF_TASK_CLOCK
5988
5989 The count of task clock time as unsigned long long. It is produced by the
5990 task_clock perf event.
5991
5992 =item Sys::Virt::Domain::STATS_PERF_PAGE_FAULTS
5993
5994 The count of page faults as unsigned long long. It is produced by the
5995 page_faults perf event
5996
5997 =item Sys::Virt::Domain::STATS_PERF_CONTEXT_SWITCHES
5998
5999 The count of context switches as unsigned long long. It is produced by the
6000 context_switches perf event.
6001
6002 =item Sys::Virt::Domain::STATS_PERF_CPU_MIGRATIONS
6003
6004 The count of cpu migrations, from one logical processor to another, as
6005 unsigned long long. It is produced by the cpu_migrations perf event.
6006
6007 =item Sys::Virt::Domain::STATS_PERF_PAGE_FAULTS_MIN
6008
6009 The count of minor page faults as unsigned long long. It is produced by the
6010 page_faults_min perf event.
6011
6012 =item Sys::Virt::Domain::STATS_PERF_PAGE_FAULTS_MAJ
6013
6014 The count of major page faults as unsigned long long. It is produced by the
6015 page_faults_maj perf event.
6016
6017 =item Sys::Virt::Domain::STATS_PERF_ALIGNMENT_FAULTS
6018
6019 The count of alignment faults as unsigned long long. It is produced by the
6020 alignment_faults perf event
6021
6022 =item Sys::Virt::Domain::STATS_PERF_EMULATION_FAULTS
6023
6024 The count of emulation faults as unsigned long long. It is produced by the
6025 emulation_faults perf event
6026
6027 =back
6028
6029 =item Sys::Virt::Domain::STATS_IOTHREAD
6030
6031 IOThread performance statistics values.
6032
6033 The following keys will be used for the returned parameters
6034
6035 =over 4
6036
6037 =item Sys::Virt::Domain::STATS_IOTHREAD_COUNT
6038
6039 Maximum number of IOThreads in the subsequent list as unsigned int. Each
6040 IOThread in the list will will use it's iothread_id value as the array
6041 index. There may be fewer array entries than the iothread.count value if
6042 the polling values are not supported.
6043
6044 =item Sys::Virt::Domain::STATS_IOTHREAD_PREFIX
6045
6046 The parameter name prefix to access each iothread entry. Concatenate the
6047 prefix, the entry number formatted as an unsigned integer and one of the
6048 iothread suffix parameters to form a complete parameter name.
6049
6050 =item Sys::Virt::Domain::STATS_IOTHREAD_SUFFIX_POLL_MAX_NS
6051
6052 Maximum polling time in ns as an unsigned long long. A 0 (zero) means
6053 polling is disabled.
6054
6055 =item Sys::Virt::Domain::STATS_IOTHREAD_SUFFIX_POLL_GROW
6056
6057 Polling time factor as an unsigned int or unsigned long long if exceeding
6058 range of unsigned int. A 0 (zero) indicates to allow the underlying
6059 hypervisor to choose how to grow the polling time.
6060
6061 =item Sys::Virt::Domain::STATS_IOTHREAD_SUFFIX_POLL_SHRINK
6062
6063 Polling time divisor as an unsigned int or unsigned long long if exceeding
6064 range of unsigned int. A 0 (zero) indicates to allow the underlying
6065 hypervisor to choose how to shrink the polling time.
6066
6067 =item Sys::Virt::Domain::STATS_IOTHREAD_SUFFIX_POLL_WEIGHT
6068
6069 Polling weight factor as an unsigned int. This shift value controls how
6070 much the most recent event interval affects adaptive polling calculations.
6071 A 0 (zero) indicates the hypervisor's default weight is used.
6072
6073 =back
6074
6075 =item Sys::Virt::Domain::STATS_MEMORY
6076
6077 Memory bandwidth statistics values.
6078
6079 The following keys will be used for the returned parameters
6080
6081 =over 4
6082
6083 =item Sys::Virt::Domain::STATS_MEMORY_BANDWIDTH_MONITOR_COUNT
6084
6085 The number of memory bandwidth monitors for this domain as an unsigned int.
6086
6087 =item Sys::Virt::Domain::STATS_MEMORY_BANDWIDTH_MONITOR_PREFIX
6088
6089 The parameter name prefix to access each bandwith monitor entry.
6090 Concatenate the prefix, the entry number formatted as an unsigned integer
6091 and one of the memory bandwith suffix parameters to form a complete
6092 parameter name.
6093
6094 =item Sys::Virt::Domain::STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_NAME
6095
6096 The name of the bandwidth monitor as a string.
6097
6098 =item Sys::Virt::Domain::STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_VCPUS
6099
6100 The vcpu list of the bandwidth monitor as a string.
6101
6102 =item Sys::Virt::Domain::STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_NODE_COUNT
6103
6104 The number of memory controllers in the bandwidth monitor.
6105
6106 =item Sys::Virt::Domain::STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_NODE_PREFIX
6107
6108 The parameter name prefix to access each controller entry. Concatenate the
6109 bandwidth monitor prefix, the monitor entry number formatted as an unsigned
6110 integer, the controller prefix, the controller entry number formatted as an
6111 unsigned integer and one of the controller suffix parameters to form a
6112 complete parameter name.
6113
6114 =item Sys::Virt::Domain::STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_NODE_SUFFIX_ID
6115
6116 Host allocated memory controller id for the controller as an unsigned int.
6117
6118 =item Sys::Virt::Domain::STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_NODE_SUFFIX_BYTES_LOCAL
6119
6120 The accumulative bytes consumed by vcpus passing through the memory
6121 controller in the same processor that the scheduled host CPU belongs to as
6122 an unsigned long long.
6123
6124 =item Sys::Virt::Domain::STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_NODE_SUFFIX_BYTES_TOTAL
6125
6126 The accumulative bytes consumed by vcpus passing through all memory
6127 controllers, either local or remote, as an unsigned long long.
6128
6129 =back
6130
6131 =item Sys::Virt::Domain::STATS_DIRTYRATE
6132
6133 Memory dirty rate statistics.
6134
6135 The following keys will be used for the returned parameters
6136
6137 =over 4
6138
6139 =item Sys::Virt::Domain::STATS_DIRTYRATE_CALC_STATUS
6140
6141 The status of last memory dirty rate calculation as an int from the
6142 virDomainDirtyRateStatus enum.
6143
6144 =item Sys::Virt::Domain::STATS_DIRTYRATE_CALC_START_TIME
6145
6146 The start time in seconds of the last memory dirty rate calculation as long
6147 long.
6148
6149 =item Sys::Virt::Domain::STATS_DIRTYRATE_CALC_PERIOD
6150
6151 The period in seconds of last memory dirty rate calculation as int.
6152
6153 =item Sys::Virt::Domain::STATS_DIRTYRATE_MEGABYTES_PER_SECOND
6154
6155 The calculated memory dirty rate in MiB/s as long long. It is produced only
6156 if the calc_status is measured.
6157
6158 =item Sys::Virt::Domain::STATS_DIRTYRATE_CALC_MODE
6159
6160 The calculation mode used last measurement as string, either of these
6161 'page-sampling', 'dirty-bitmap' or 'dirty-ring' values returned.
6162
6163 =item Sys::Virt::Domain::STATS_DIRTYRATE_VCPU_PREFIX
6164
6165 The parameter name prefix to access each VCPU entry. Concatenate the
6166 prefix, the entry number formatted as an unsigned integer and one of the
6167 VCPU suffix parameters to form a complete parameter name.
6168
6169 =item Sys::Virt::Domain::STATS_DIRTYRATE_VCPU_SUFFIX_MEGABYTES_PER_SECOND
6170
6171 The calculated memory dirty rate for a virtual cpu as unsigned long long.
6172
6173 =back
6174
6175 =item Sys::Virt::Domain::STATS_VM
6176
6177 Hypervisor-specific stats fields for given VM.
6178
6179 The following keys will be used for the returned parameters
6180
6181 =over 4
6182
6183 =item Sys::Virt::Domain::STATS_VM_PREFIX
6184
6185 Concatenate the prefix, a hypervisor specific custom stats name and one
6186 of the VIR_DOMAIN_STATS_CUSTOM_TYPE_* constants to form a complete
6187 parameter name
6188
6189 =back
6190
6191 The C<STATS_VM> and C<STATS_VCPU> types also use the following
6192 parameters for hypervisor specific statistics:
6193
6194 =over 4
6195
6196 =item Sys::Virt::Domain::STATS_CUSTOM_SUFFIX_TYPE_CUR
6197
6198 Hypervisor specific custom data type for current instant value
6199
6200 The complete parameter name is formed by concatenating the field prefix,
6201 the array index formatted as an unsigned integer, a hypervisor specific
6202 parameter name, and this data type suffix.
6203
6204 =item Sys::Virt::Domain::STATS_CUSTOM_SUFFIX_TYPE_MAX
6205
6206 Hypervisor specific custom data type for aggregate value
6207
6208 The complete parameter name is formed by concatenating the field prefix,
6209 the array index formatted as an unsigned integer, a hypervisor specific
6210 parameter name, and this data type suffix.
6211
6212 =item Sys::Virt::Domain::STATS_CUSTOM_SUFFIX_TYPE_SUM
6213
6214 Hypervisor specific custom data type for peak value.
6215
6216 The complete parameter name is formed by concatenating the field prefix,
6217 the array index formatted as an unsigned integer, a hypervisor specific
6218 parameter name, and this data type suffix.
6219
6220 =back
6221
6222 =back
6223
6224 =head2 PROCESS SIGNALS
6225
6226 The following constants provide the names of signals
6227 which can be sent to guest processes. They mostly
6228 correspond to POSIX signal names.
6229
6230 =over 4
6231
6232 =item Sys::Virt::Domain::PROCESS_SIGNAL_NOP
6233
6234 SIGNOP
6235
6236 =item Sys::Virt::Domain::PROCESS_SIGNAL_HUP
6237
6238 SIGHUP
6239
6240 =item Sys::Virt::Domain::PROCESS_SIGNAL_INT
6241
6242 SIGINT
6243
6244 =item Sys::Virt::Domain::PROCESS_SIGNAL_QUIT
6245
6246 SIGQUIT
6247
6248 =item Sys::Virt::Domain::PROCESS_SIGNAL_ILL
6249
6250 SIGILL
6251
6252 =item Sys::Virt::Domain::PROCESS_SIGNAL_TRAP
6253
6254 SIGTRAP
6255
6256 =item Sys::Virt::Domain::PROCESS_SIGNAL_ABRT
6257
6258 SIGABRT
6259
6260 =item Sys::Virt::Domain::PROCESS_SIGNAL_BUS
6261
6262 SIGBUS
6263
6264 =item Sys::Virt::Domain::PROCESS_SIGNAL_FPE
6265
6266 SIGFPE
6267
6268 =item Sys::Virt::Domain::PROCESS_SIGNAL_KILL
6269
6270 SIGKILL
6271
6272 =item Sys::Virt::Domain::PROCESS_SIGNAL_USR1
6273
6274 SIGUSR1
6275
6276 =item Sys::Virt::Domain::PROCESS_SIGNAL_SEGV
6277
6278 SIGSEGV
6279
6280 =item Sys::Virt::Domain::PROCESS_SIGNAL_USR2
6281
6282 SIGUSR2
6283
6284 =item Sys::Virt::Domain::PROCESS_SIGNAL_PIPE
6285
6286 SIGPIPE
6287
6288 =item Sys::Virt::Domain::PROCESS_SIGNAL_ALRM
6289
6290 SIGALRM
6291
6292 =item Sys::Virt::Domain::PROCESS_SIGNAL_TERM
6293
6294 SIGTERM
6295
6296 =item Sys::Virt::Domain::PROCESS_SIGNAL_STKFLT
6297
6298 SIGSTKFLT
6299
6300 =item Sys::Virt::Domain::PROCESS_SIGNAL_CHLD
6301
6302 SIGCHLD
6303
6304 =item Sys::Virt::Domain::PROCESS_SIGNAL_CONT
6305
6306 SIGCONT
6307
6308 =item Sys::Virt::Domain::PROCESS_SIGNAL_STOP
6309
6310 SIGSTOP
6311
6312 =item Sys::Virt::Domain::PROCESS_SIGNAL_TSTP
6313
6314 SIGTSTP
6315
6316 =item Sys::Virt::Domain::PROCESS_SIGNAL_TTIN
6317
6318 SIGTTIN
6319
6320 =item Sys::Virt::Domain::PROCESS_SIGNAL_TTOU
6321
6322 SIGTTOU
6323
6324 =item Sys::Virt::Domain::PROCESS_SIGNAL_URG
6325
6326 SIGURG
6327
6328 =item Sys::Virt::Domain::PROCESS_SIGNAL_XCPU
6329
6330 SIGXCPU
6331
6332 =item Sys::Virt::Domain::PROCESS_SIGNAL_XFSZ
6333
6334 SIGXFSZ
6335
6336 =item Sys::Virt::Domain::PROCESS_SIGNAL_VTALRM
6337
6338 SIGVTALRM
6339
6340 =item Sys::Virt::Domain::PROCESS_SIGNAL_PROF
6341
6342 SIGPROF
6343
6344 =item Sys::Virt::Domain::PROCESS_SIGNAL_WINCH
6345
6346 SIGWINCH
6347
6348 =item Sys::Virt::Domain::PROCESS_SIGNAL_POLL
6349
6350 SIGPOLL
6351
6352 =item Sys::Virt::Domain::PROCESS_SIGNAL_PWR
6353
6354 SIGPWR
6355
6356 =item Sys::Virt::Domain::PROCESS_SIGNAL_SYS
6357
6358 SIGSYS
6359
6360 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT0
6361
6362 SIGRT0
6363
6364 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT1
6365
6366 SIGRT1
6367
6368 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT2
6369
6370 SIGRT2
6371
6372 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT3
6373
6374 SIGRT3
6375
6376 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT4
6377
6378 SIGRT4
6379
6380 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT5
6381
6382 SIGRT5
6383
6384 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT6
6385
6386 SIGRT6
6387
6388 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT7
6389
6390 SIGRT7
6391
6392 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT8
6393
6394 SIGRT8
6395
6396 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT9
6397
6398 SIGRT9
6399
6400 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT10
6401
6402 SIGRT10
6403
6404 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT11
6405
6406 SIGRT11
6407
6408 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT12
6409
6410 SIGRT12
6411
6412 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT13
6413
6414 SIGRT13
6415
6416 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT14
6417
6418 SIGRT14
6419
6420 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT15
6421
6422 SIGRT15
6423
6424 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT16
6425
6426 SIGRT16
6427
6428 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT17
6429
6430 SIGRT17
6431
6432 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT18
6433
6434 SIGRT18
6435
6436 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT19
6437
6438 SIGRT19
6439
6440 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT20
6441
6442 SIGRT20
6443
6444 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT21
6445
6446 SIGRT21
6447
6448 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT22
6449
6450 SIGRT22
6451
6452 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT23
6453
6454 SIGRT23
6455
6456 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT24
6457
6458 SIGRT24
6459
6460 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT25
6461
6462 SIGRT25
6463
6464 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT26
6465
6466 SIGRT26
6467
6468 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT27
6469
6470 SIGRT27
6471
6472 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT28
6473
6474 SIGRT28
6475
6476 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT29
6477
6478 SIGRT29
6479
6480 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT30
6481
6482 SIGRT30
6483
6484 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT31
6485
6486 SIGRT31
6487
6488 =item Sys::Virt::Domain::PROCESS_SIGNAL_RT32
6489
6490 SIGRT32
6491
6492 =back
6493
6494 =head2 DOMAIN TUNABLE CONSTANTS
6495
6496 The following constants are useful when accessing domain
6497 tuning parameters in APIs and events
6498
6499 =over 4
6500
6501 =item Sys::Virt::Domain::TUNABLE_CPU_CPU_SHARES
6502
6503 Proportional CPU weight
6504
6505 =item Sys::Virt::Domain::TUNABLE_CPU_EMULATORPIN
6506
6507 Emulator thread CPU pinning mask
6508
6509 =item Sys::Virt::Domain::TUNABLE_CPU_EMULATOR_PERIOD
6510
6511 Emulator thread CPU period
6512
6513 =item Sys::Virt::Domain::TUNABLE_CPU_EMULATOR_QUOTA
6514
6515 Emulator thread CPU quota
6516
6517 =item Sys::Virt::Domain::TUNABLE_CPU_IOTHREAD_PERIOD
6518
6519 Iothread thread CPU period
6520
6521 =item Sys::Virt::Domain::TUNABLE_CPU_IOTHREAD_QUOTA
6522
6523 Iothread thread CPU quota
6524
6525 =item Sys::Virt::Domain::TUNABLE_CPU_VCPUPIN
6526
6527 VCPU thread pinning mask
6528
6529 =item Sys::Virt::Domain::TUNABLE_CPU_VCPU_PERIOD
6530
6531 VCPU thread period
6532
6533 =item Sys::Virt::Domain::TUNABLE_CPU_VCPU_QUOTA
6534
6535 VCPU thread quota
6536
6537 =item Sys::Virt::Domain::TUNABLE_CPU_GLOBAL_PERIOD
6538
6539 VM global period
6540
6541 =item Sys::Virt::Domain::TUNABLE_CPU_GLOBAL_QUOTA
6542
6543 VM global quota
6544
6545 =item Sys::Virt::Domain::TUNABLE_BLKDEV_DISK
6546
6547 The name of guest disks
6548
6549 =item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_BYTES_SEC
6550
6551 Read throughput in bytes per sec
6552
6553 =item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_IOPS_SEC
6554
6555 Read throughput in I/O operations per sec
6556
6557 =item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_BYTES_SEC
6558
6559 Total throughput in bytes per sec
6560
6561 =item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_IOPS_SEC
6562
6563 Total throughput in I/O operations per sec
6564
6565 =item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_BYTES_SEC
6566
6567 Write throughput in bytes per sec
6568
6569 =item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_IOPS_SEC
6570
6571 Write throughput in I/O operations per sec
6572
6573 =item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_BYTES_SEC_MAX
6574
6575 Maximum read throughput in bytes per sec
6576
6577 =item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_IOPS_SEC_MAX
6578
6579 Maximum read throughput in I/O operations per sec
6580
6581 =item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX
6582
6583 Maximum total throughput in bytes per sec
6584
6585 =item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX
6586
6587 Maximum total throughput in I/O operations per sec
6588
6589 =item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX
6590
6591 Maximum write throughput in bytes per sec
6592
6593 =item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX
6594
6595 Maximum write throughput in I/O operations per sec
6596
6597 =item Sys::Virt::Domain::TUNABLE_BLKDEV_SIZE_IOPS_SEC
6598
6599 The maximum I/O operations per second
6600
6601 =item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH
6602
6603 The duration in seconds allowed for maximum total bytes processed per second.
6604
6605 =item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH
6606
6607 The duration in seconds allowed for maximum bytes read per second.
6608
6609 =item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH
6610
6611 The duration in seconds allowed for maximum bytes written per second.
6612
6613 =item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH
6614
6615 The duration in seconds allowed for maximum total I/O operations processed
6616 per second.
6617
6618 =item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH
6619
6620 The duration in seconds allowed for maximum I/O operations read per second.
6621
6622 =item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH
6623
6624 The duration in seconds allowed for maximum I/O operations written per second.
6625
6626 =item Sys::Virt::Domain::TUNABLE_BLKDEV_GROUP_NAME
6627
6628 The name of the blkdev group
6629
6630 =item Sys::Virt::Domain::TUNABLE_IOTHREADSPIN
6631
6632 The I/O threads pinning
6633
6634 =back
6635
6636 =head2 DOMAIN LIFECYCLE CONSTANTS
6637
6638 The following constants are useful when setting action for
6639 lifecycle events.
6640
6641 =over 4
6642
6643 =item Sys::Virt::Domain::LIFECYCLE_POWEROFF
6644
6645 The poweroff lifecycle event type
6646
6647 =item Sys::Virt::Domain::LIFECYCLE_REBOOT
6648
6649 The reboot lifecycle event type
6650
6651 =item Sys::Virt::Domain::LIFECYCLE_CRASH
6652
6653 The crash lifecycle event type
6654
6655 =back
6656
6657 =head2 DOMAIN LIFECYCLE ACTION CONSTANTS
6658
6659 =over 4
6660
6661 =item Sys::Virt::Domain::LIFECYCLE_ACTION_DESTROY
6662
6663 The destroy lifecycle action
6664
6665 =item Sys::Virt::Domain::LIFECYCLE_ACTION_RESTART
6666
6667 The restart lifecycle action
6668
6669 =item Sys::Virt::Domain::LIFECYCLE_ACTION_RESTART_RENAME
6670
6671 The restart-rename lifecycle action
6672
6673 =item Sys::Virt::Domain::LIFECYCLE_ACTION_PRESERVE
6674
6675 The preserve lifecycle action
6676
6677 =item Sys::Virt::Domain::LIFECYCLE_ACTION_COREDUMP_DESTROY
6678
6679 The coredump-destroy lifecycle action
6680
6681 =item Sys::Virt::Domain::LIFECYCLE_ACTION_COREDUMP_RESTART
6682
6683 The coredump-restart lifecycle action
6684
6685 =item Sys::Virt::Domain::LIFECYCLE_ACTION_PRESERVE_RUNNING
6686
6687 The preserve-running lifecycle action
6688
6689 =back
6690
6691 =head2 MEMORY FAILURE ACTION CONSTANTS
6692
6693 =over 4
6694
6695 =item Sys::Virt::Domain::EVENT_MEMORY_FAILURE_ACTION_IGNORE
6696
6697 The failure could be ignored
6698
6699 =item Sys::Virt::Domain::EVENT_MEMORY_FAILURE_ACTION_INJECT
6700
6701 An MCE was injected to the guest
6702
6703 =item Sys::Virt::Domain::EVENT_MEMORY_FAILURE_ACTION_FATAL
6704
6705 The failure is non-recoverable and the hypervisor was
6706 not able to handle it
6707
6708 =item Sys::Virt::Domain::EVENT_MEMORY_FAILURE_ACTION_RESET
6709
6710 The failure is non-recoverable and the guest was
6711 not able to handle it.
6712
6713 =back
6714
6715 =head2 MEMORY FAILURE RECIPIENT CONSTANTS
6716
6717 =over 4
6718
6719 =item Sys::Virt::Domain::EVENT_MEMORY_FAILURE_RECIPIENT_HYPERVISOR
6720
6721 The memory failure was in hypervisor address space
6722
6723 =item Sys::Virt::Domain::EVENT_MEMORY_FAILURE_RECIPIENT_GUEST
6724
6725 The memory failure was in guest address space
6726
6727 =back
6728
6729 =head2 MEMORY FAILURE FLAG CONSTANTS
6730
6731 =over 4
6732
6733 =item Sys::Virt::Domain::MEMORY_FAILURE_ACTION_REQUIRED
6734
6735 Whether the flag is action-required or action-optional
6736
6737 =item Sys::Virt::Domain::MEMORY_FAILURE_RECURSIVE
6738
6739 The failure occurred while the previous fault was being
6740 handled.
6741
6742 =back
6743
6744 =head2 MEMORY DIRTY RATE STATUS CONSTANTS
6745
6746 =over 4
6747
6748 =item Sys::Virt::Domain::DIRTYRATE_UNSTARTED
6749
6750 The dirty rate is not being measured currently.
6751
6752 =item Sys::Virt::Domain::DIRTYRATE_MEASURING
6753
6754 The dity rate is in the process of being measured
6755
6756 =item Sys::Virt::Domain::DIRTYRATE_MEASURED
6757
6758 The dirty rate has been measured
6759
6760 =back
6761
6762 =head1 AUTHORS
6763
6764 Daniel P. Berrange <[email protected]>
6765
6766 =head1 COPYRIGHT
6767
6768 Copyright (C) 2006 Red Hat
6769 Copyright (C) 2006-2007 Daniel P. Berrange
6770
6771 =head1 LICENSE
6772
6773 This program is free software; you can redistribute it and/or modify
6774 it under the terms of either the GNU General Public License as published
6775 by the Free Software Foundation (either version 2 of the License, or at
6776 your option any later version), or, the Artistic License, as specified
6777 in the Perl README file.
6778
6779 =head1 SEE ALSO
6780
6781 L<Sys::Virt>, L<Sys::Virt::Error>, C<http://libvirt.org>
6782
6783 =cut