File: Domain.pm

package info (click to toggle)
libsys-virt-perl 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 932 kB
  • sloc: perl: 2,035; sh: 12; makefile: 3
file content (4708 lines) | stat: -rw-r--r-- 115,152 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
# -*- perl -*-
#
# Copyright (C) 2006 Red Hat
# Copyright (C) 2006-2007 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
# it under either:
#
# a) the GNU General Public License as published by the Free
#   Software Foundation; either version 2, or (at your option) any
#   later version,
#
# or
#
# b) the "Artistic License"
#
# The file "LICENSE" distributed along with this file provides full
# details of the terms and conditions of the two licenses.

=pod

=head1 NAME

Sys::Virt::Domain - Represent & manage a libvirt guest domain

=head1 DESCRIPTION

The C<Sys::Virt::Domain> module represents a guest domain managed
by the virtual machine monitor.

=head1 METHODS

=over 4

=cut

package Sys::Virt::Domain;

use strict;
use warnings;


sub _new {
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my %params = @_;

    my $con = exists $params{connection} ? $params{connection} : die "connection parameter is required";
    my $self;
    if (exists $params{name}) {
	$self = Sys::Virt::Domain::_lookup_by_name($con,  $params{name});
    } elsif (exists $params{id}) {
	$self = Sys::Virt::Domain::_lookup_by_id($con,  $params{id});
    } elsif (exists $params{uuid}) {
	if (length($params{uuid}) == 16) {
	    $self = Sys::Virt::Domain::_lookup_by_uuid($con,  $params{uuid});
	} elsif (length($params{uuid}) == 32 ||
		 length($params{uuid}) == 36) {
	    $self = Sys::Virt::Domain::_lookup_by_uuid_string($con,  $params{uuid});
	} else {
	    die "UUID must be either 16 unsigned bytes, or 32/36 hex characters long";
	}
    } elsif (exists $params{xml}) {
	if ($params{nocreate}) {
	    $self = Sys::Virt::Domain::_define_xml($con,  $params{xml}, $params{flags});
	} else {
	    if (exists $params{fds}) {
		$self = Sys::Virt::Domain::_create_with_files($con,  $params{xml},
							      $params{fds}, $params{flags});
	    } else {
		$self = Sys::Virt::Domain::_create($con,  $params{xml}, $params{flags});
	    }
	}
    } else {
	die "address, id or uuid parameters are required";
    }

    bless $self, $class;

    return $self;
}


=item my $id = $dom->get_id()

Returns an integer with a locally unique identifier for the
domain.

=item my $uuid = $dom->get_uuid()

Returns a 16 byte long string containing the raw globally unique identifier
(UUID) for the domain.

=item my $uuid = $dom->get_uuid_string()

Returns a printable string representation of the raw UUID, in the format
'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'.

=item my $name = $dom->get_name()

Returns a string with a locally unique name of the domain

=item my $hostname = $dom->get_hostname()

Returns a string representing the hostname of the guest

=item my $str = $dom->get_metadata($type, $uri, $flags =0)

Returns the metadata element of type C<$type> associated
with the domain. If C<$type> is C<Sys::Virt::Domain::METADATA_ELEMENT>
then the C<$uri> parameter specifies the XML namespace to
retrieve, otherwise C<$uri> should be C<undef>. The optional
C<$flags> parameter defaults to zero.

=item $dom->set_metadata($type, $val, $key, $uri, $flags=0)

Sets the metadata element of type C<$type> to hold the value
C<$val>. If C<$type> is  C<Sys::Virt::Domain::METADATA_ELEMENT>
then the C<$key> and C<$uri> elements specify an XML namespace
to use, otherwise they should both be C<undef>. The optional
C<$flags> parameter defaults to zero.

=item $dom->is_active()

Returns a true value if the domain is currently running

=item $dom->is_persistent()

Returns a true value if the domain has a persistent configuration
file defined

=item $dom->is_updated()

Returns a true value if the domain is running and has a persistent
configuration file defined that is out of date compared to the
current live config.

=item my $xml = $dom->get_xml_description($flags=0)

Returns an XML document containing a complete description of
the domain's configuration. The optional $flags parameter
controls generation of the XML document, defaulting to 0 if
omitted. It can be one or more of the XML DUMP constants
listed later in this document.

=item my $type = $dom->get_os_type()

Returns a string containing the name of the OS type running
within the domain.

=item $dom->create($flags)

Start a domain whose configuration was previously defined using the
C<define_domain> method in L<Sys::Virt>. The C<$flags> parameter
accepts one of the DOMAIN CREATION constants documented later, and
defaults to 0 if omitted.

=item $dom->create_with_files($fds, $flags)

Start a domain whose configuration was previously defined using the
C<define_domain> method in L<Sys::Virt>. The C<$fds> parameter is an
array of UNIX file descriptors which will be passed to the init
process of the container. This is only supported with container based
virtualization.The C<$flags> parameter accepts one of the DOMAIN
CREATION constants documented later, and defaults to 0 if omitted.

=item $dom->undefine()

Remove the configuration associated with a domain previously defined
with the C<define_domain> method in L<Sys::Virt>. If the domain is
running, you probably want to use the C<shutdown> or C<destroy>
methods instead.

=item $dom->suspend()

Temporarily stop execution of the domain, allowing later continuation
by calling the C<resume> method.

=item $dom->resume()

Resume execution of a domain previously halted with the C<suspend>
method.

=item $dom->pm_wakeup()

Wakeup the guest from power management suspend state

=item $dom->pm_suspend_for_duration($target, $duration, $flags=0)

Tells the guest OS to enter the power management suspend state
identified by C<$target>. The C<$target> parameter should be
one of the NODE SUSPEND CONTANTS listed in C<Sys::Virt>. The
C<$duration> specifies when the guest should automatically
wakeup. The C<$flags> parameter is optional and defaults to
zero.

=item $dom->save($filename)

Take a snapshot of the domain's state and save the information to
the file named in the C<$filename> parameter. The domain can later
be restored from this file with the C<restore_domain> method on
the L<Sys::Virt> object.

=item $dom->managed_save($flags=0)

Take a snapshot of the domain's state and save the information to
a managed save location. The domain will be automatically restored
with this state when it is next started. The C<$flags> parameter is
unused and defaults to zero.

=item $bool = $dom->has_managed_save_image($flags=0)

Return a non-zero value if the domain has a managed save image
that will be used at next start. The C<$flags> parameter is
unused and defaults to zero.

=item $dom->managed_save_remove($flags=0)

Remove the current managed save image, causing the guest to perform
a full boot next time it is started. The C<$flags> parameter is
unused and defaults to zero.

=item $dom->managed_save_define_xml($xml, $flags=0)

Update the XML of the managed save image to C<$xml>. The C<$flags>
parameter is unused and defaults to zero.

=item $xml = $dom->managed_save_get_xml_description($flags=0)

Get the XML in the managed save image. The C<$flags>
parameter is unused and defaults to zero.

=item $dom->core_dump($filename[, $flags])

Trigger a core dump of the guest virtual machine, saving its memory
image to C<$filename> so it can be analysed by tools such as C<crash>.
The optional C<$flags> flags parameter is currently unused and if
omitted will default to 0.

=item $dom->core_dump_format($filename, $format, [, $flags])

Trigger a core dump of the guest virtual machine, saving its memory
image to C<$filename> so it can be analysed by tools such as C<crash>.
The C<$format> parameter is one of the core dump format constants.
The optional C<$flags> flags parameter is currently unused and if
omitted will default to 0.

=over 4

=item Sys::Virt::Domain::CORE_DUMP_FORMAT_RAW

The raw ELF format

=item Sys::Virt::Domain::CORE_DUMP_FORMAT_KDUMP_ZLIB

The zlib compressed ELF format

=item Sys::Virt::Domain::CORE_DUMP_FORMAT_KDUMP_SNAPPY

The snappy compressed ELF format

=item Sys::Virt::Domain::CORE_DUMP_FORMAT_KDUMP_LZO

The lzo compressed ELF format

=back

=item $dom->destroy()

Immediately poweroff the machine. This is equivalent to removing the
power plug. The guest OS is given no time to cleanup / save state.
For a clean poweroff sequence, use the C<shutdown> method instead.

=item my $info = $dom->get_info()

Returns a hash reference summarising the execution state of the
domain. The elements of the hash are as follows:

=over 4

=item maxMem

The maximum memory allowed for this domain, in kilobytes

=item memory

The current memory allocated to the domain in kilobytes

=item cpuTime

The amount of CPU time used by the domain

=item nrVirtCpu

The current number of virtual CPUs enabled in the domain

=item state

The execution state of the machine, which will be one of the
constants &Sys::Virt::Domain::STATE_*.

=back

=item my ($state, $reason) = $dom->get_state()

Returns an array whose values specify the current state
of the guest, and the reason for it being in that state.
The C<$state> values are the same as for the C<get_info>
API, and the C<$reason> values come from:

=over 4

=item Sys::Virt::Domain::STATE_CRASHED_UNKNOWN

It is not known why the domain has crashed

=item Sys::Virt::Domain::STATE_CRASHED_PANICKED

The domain has crashed due to a kernel panic

=item Sys::Virt::Domain::STATE_NOSTATE_UNKNOWN

It is not known why the domain has no state

=item Sys::Virt::Domain::STATE_PAUSED_DUMP

The guest is paused due to a core dump operation

=item Sys::Virt::Domain::STATE_PAUSED_FROM_SNAPSHOT

The guest is paused due to a snapshot

=item Sys::Virt::Domain::STATE_PAUSED_IOERROR

The guest is paused due to an I/O error

=item Sys::Virt::Domain::STATE_PAUSED_MIGRATION

The guest is paused due to migration

=item Sys::Virt::Domain::STATE_PAUSED_SAVE

The guest is paused due to a save operation

=item Sys::Virt::Domain::STATE_PAUSED_UNKNOWN

It is not known why the domain has paused

=item Sys::Virt::Domain::STATE_PAUSED_USER

The guest is paused at admin request

=item Sys::Virt::Domain::STATE_PAUSED_WATCHDOG

The guest is paused due to the watchdog

=item Sys::Virt::Domain::STATE_PAUSED_SHUTTING_DOWN

The guest is paused while domain shutdown takes place

=item Sys::Virt::Domain::STATE_PAUSED_SNAPSHOT

The guest is paused while a snapshot takes place

=item Sys::Virt::Domain::STATE_PAUSED_CRASHED

The guest is paused due to a kernel panic

=item Sys::Virt::Domain::STATE_PAUSED_STARTING_UP

The guest is paused as it is being started up.

=item Sys::Virt::Domain::STATE_PAUSED_POSTCOPY

The guest is paused as post-copy migration is taking place

=item Sys::Virt::Domain::STATE_PAUSED_POSTCOPY_FAILED

The guest is paused as post-copy migration failed

=item Sys::Virt::Domain::STATE_RUNNING_BOOTED

The guest is running after being booted

=item Sys::Virt::Domain::STATE_RUNNING_FROM_SNAPSHOT

The guest is running after restore from snapshot

=item Sys::Virt::Domain::STATE_RUNNING_MIGRATED

The guest is running after migration

=item Sys::Virt::Domain::STATE_RUNNING_MIGRATION_CANCELED

The guest is running after migration abort

=item Sys::Virt::Domain::STATE_RUNNING_RESTORED

The guest is running after restore from file

=item Sys::Virt::Domain::STATE_RUNNING_SAVE_CANCELED

The guest is running after save cancel

=item Sys::Virt::Domain::STATE_RUNNING_UNKNOWN

It is not known why the domain has started

=item Sys::Virt::Domain::STATE_RUNNING_UNPAUSED

The guest is running after a resume

=item Sys::Virt::Domain::STATE_RUNNING_WAKEUP

The guest is running after wakeup from power management suspend

=item Sys::Virt::Domain::STATE_RUNNING_CRASHED

The guest was restarted after crashing

=item Sys::Virt::Domain::STATE_RUNNING_POSTCOPY

The guest is running but post-copy is taking place

=item Sys::Virt::Domain::STATE_BLOCKED_UNKNOWN

The guest is blocked for an unknown reason

=item Sys::Virt::Domain::STATE_SHUTDOWN_UNKNOWN

It is not known why the domain has shutdown

=item Sys::Virt::Domain::STATE_SHUTDOWN_USER

The guest is shutdown due to admin request

=item Sys::Virt::Domain::STATE_SHUTOFF_CRASHED

The guest is shutoff after a crash

=item Sys::Virt::Domain::STATE_SHUTOFF_DESTROYED

The guest is shutoff after being destroyed

=item Sys::Virt::Domain::STATE_SHUTOFF_FAILED

The guest is shutoff due to a virtualization failure

=item Sys::Virt::Domain::STATE_SHUTOFF_FROM_SNAPSHOT

The guest is shutoff after a snapshot

=item Sys::Virt::Domain::STATE_SHUTOFF_MIGRATED

The guest is shutoff after migration

=item Sys::Virt::Domain::STATE_SHUTOFF_SAVED

The guest is shutoff after a save

=item Sys::Virt::Domain::STATE_SHUTOFF_SHUTDOWN

The guest is shutoff due to controlled shutdown

=item Sys::Virt::Domain::STATE_SHUTOFF_UNKNOWN

It is not known why the domain has shutoff

=item Sys::Virt::Domain::STATE_SHUTOFF_DAEMON

The daemon stopped the guest due to a failure

=item Sys::Virt::Domain::STATE_PMSUSPENDED_UNKNOWN

It is not known why the domain was suspended to RAM

=item Sys::Virt::Domain::STATE_PMSUSPENDED_DISK_UNKNOWN

It is not known why the domain was suspended to disk

=back

=item my $info = $dom->get_control_info($flags=0)

Returns a hash reference providing information about
the control channel. The returned keys in the hash
are

=over 4

=item C<state>

One of the CONTROL INFO constants listed later

=item C<details>

Currently unused, always 0.

=item C<stateTime>

The elapsed time since the control channel entered
the current state.

=back

=item my $time = $dom->get_time($flags=0);

Get the current time of the guest, in seconds and nanoseconds.
The C<$flags> parameter is currently unused and defaults to
zero. The return value is an array ref with two elements,
the first contains the time in seconds, the second contains
the remaining nanoseconds.

=item $dom->set_time($secs, $nsecs, $flags=0);

Set the current time of the guest, in seconds and nanoseconds.
The C<$flags> parameter accepts one of

=over 4

=item C<Sys::Virt::Domain::TIME_SYNC>

Re-sync domain time from domain's RTC.

=back


=item $dom->set_user_password($username, $password, $flags=0);

Update the password for account C<$username> to be
C<$password>. C<$password> is the clear-text password
string unless the PASSWORD_ENCRYPTED flag is set.

=over 4

=item C<Sys::Virt::Domain::PASSWORD_ENCRYPTED>

The C<$password> is encrypted with the password scheme required
by the guest OS.

=back

=item $dom->rename($newname, $flags=0)

Change the name of an inactive guest to be C<$newname>.
The C<$flags> parameter is currently unused and defaults
to zero.

=item my @errs = $dom->get_disk_errors($flags=0)

Returns a list of all disk errors that have occurred on
the backing store for the guest's virtual disks. The
returned array elements are hash references, containing
two keys

=over 4

=item C<path>

The path of the disk with an error

=item C<error>

The error type

=back

=item $dom->send_key($keycodeset, $holdtime, \@keycodes, $flags=0)

Sends a sequence of keycodes to the guest domain. The
C<$keycodeset> should be one of the constants listed
later in the KEYCODE SET section. C<$holdtiem> is the
duration, in milliseconds, to keep the key pressed
before releasing it and sending the next keycode.
C<@keycodes> is an array reference containing the list
of keycodes to send to the guest. The elements in the
array should be keycode values from the specified
keycode set. C<$flags> is currently unused.

=item my $info = $dom->get_block_info($dev, $flags=0)

Returns a hash reference summarising the disk usage of
the host backing store for a guest block device. The
C<$dev> parameter should be the path to the backing
store on the host. C<$flags> is currently unused and
defaults to 0 if omitted. The returned hash contains
the following elements

=over 4

=item capacity

Logical size in bytes of the block device backing image *

=item allocation

Highest allocated extent in bytes of the block device backing image

=item physical

Physical size in bytes of the container of the backing image

=back

=item $dom->set_max_memory($mem)

Set the maximum memory for the domain to the value C<$mem>. The
value of the C<$mem> parameter is specified in kilobytes.

=item $mem = $dom->get_max_memory()

Returns the current maximum memory allowed for this domain in
kilobytes.

=item $dom->set_memory($mem, $flags)

Set the current memory for the domain to the value C<$mem>. The
value of the C<$mem> parameter is specified in kilobytes. This
must be less than, or equal to the domain's max memory limit.
The C<$flags> parameter can control whether the update affects
the live guest, or inactive config, defaulting to modifying
the current state.

=item $dom->set_memory_stats_period($period, $flags)

Set the period on which guests memory stats are refreshed,
with C<$period> being a value in seconds. The C<$flags>
parameter is currently unused.

=item $dom->shutdown()

Request that the guest OS perform a graceful shutdown and
poweroff. This usually requires some form of cooperation
from the guest operating system, such as responding to an
ACPI signal, or a guest agent process. For an immediate,
forceful poweroff, use the C<destroy> method instead.

=item $dom->reboot([$flags])

Request that the guest OS perform a graceful shutdown and
optionally restart. The optional C<$flags> parameter is
currently unused and if omitted defaults to zero.

=item $dom->reset([$flags])

Perform a hardware reset of the virtual machine. The guest
OS is given no opportunity to shutdown gracefully. The
optional C<$flags> parameter is currently unused and if
omitted defaults to zero.

=item $dom->get_max_vcpus()

Return the maximum number of vcpus that are configured
for the domain

=item $dom->attach_device($xml[, $flags])

Hotplug a new device whose configuration is given by C<$xml>,
to the running guest. The optional <$flags> parameter defaults
to 0, but can accept one of the device hotplug flags described
later.

=item $dom->detach_device($xml[, $flags])

Hotunplug an existing device whose configuration is given by C<$xml>,
from the running guest. The optional <$flags> parameter defaults
to 0, but can accept one of the device hotplug flags described
later.

=item $dom->detach_device_alias($alias[, $flags])

Hotunplug an existing device which is identified by C<$alias>.
The optional <$flags> parameter defaults to 0, but can accept one
of the device hotplug flags described later.

=item $dom->update_device($xml[, $flags])

Update the configuration of an existing device. The new configuration
is given by C<$xml>. The optional <$flags> parameter defaults to
0 but can accept one of the device hotplug flags described later.

=item $data = $dom->block_peek($path, $offset, $size[, $flags])

Peek into the guest disk C<$path>, at byte C<$offset> capturing
C<$size> bytes of data. The returned scalar may contain embedded
NULLs. The optional C<$flags> parameter is currently unused and
if omitted defaults to zero.

=item $data = $dom->memory_peek($offset, $size[, $flags])

Peek into the guest memory at byte C<$offset> virtual address,
capturing C<$size> bytes of memory. The return scalar may
contain embedded NULLs. The optional C<$flags> parameter is
currently unused and if omitted defaults to zero.

=item $flag = $dom->get_autostart();

Return a true value if the guest domain is configured to automatically
start upon boot. Return false, otherwise

=item $dom->set_autostart($flag)

Set the state of the autostart flag, which determines whether the
guest will automatically start upon boot of the host OS

=item $dom->set_vcpus($count, [$flags])

Set the number of virtual CPUs in the guest VM to C<$count>.
The optional C<$flags> parameter can be used to control whether
the setting changes the live config or inactive config.

=item $dom->set_vcpu($cpumap, $state, [$flags])

Set the state of the CPUs in C<$cpumap> to C<$state>. The
C<$flags> parameter defaults to zero if not present.

=item $count = $dom->get_vcpus([$flags])

Get the number of virtual CPUs in the guest VM.
The optional C<$flags> parameter can be used to control whether
to query the setting of the live config or inactive config.

=item $dom->set_guest_vcpus($cpumap, $state, [$flags=0])

Set the online status of the guest OS CPUs. The C<$cpumap>
parameter describes the set of CPUs to modify (eg "0-3,^1").
C<$state> is either B<1> to set the CPUs online, or B<0>
to set them offline. The C<$flags> parameter is currently
unused and defaults to 0.

=item $info $dom->get_guest_vcpus([$flags=0])

Query information about the guest OS CPUs. The returned
data is a hash reference with the following keys.

=over 4

=item B<vcpus>

String containing bitmap representing CPU ids reported
currently known to the guest.

=item B<online>

String containing bitmap representing CPU ids that are
currently online in the guest.

=item B<offlinable>

String containing bitmap representing CPU ids that can
be offlined in the guest.

=back

The C<$flags> parameter is currently unused and defaults to 0.

=item $type = $dom->get_scheduler_type()

Return the scheduler type for the guest domain

=item $stats = $dom->block_stats($path)

Fetch the current I/O statistics for the block device given by C<$path>.
The returned hash reference contains keys for

=over 4

=item C<rd_req>

Number of read requests

=item C<rd_bytes>

Number of bytes read

=item C<wr_req>

Number of write requests

=item C<wr_bytes>

Number of bytes written

=item C<errs>

Some kind of error count

=back

=item my $params = $dom->get_scheduler_parameters($flags=0)

Return the set of scheduler tunable parameters for the guest,
as a hash reference. The precise set of keys in the hash
are specific to the hypervisor.

=item $dom->set_scheduler_parameters($params, $flags=0)

Update the set of scheduler tunable parameters. The value names for
tunables vary, and can be discovered using the C<get_scheduler_params>
call

=item my $params = $dom->get_memory_parameters($flags=0)

Return a hash reference containing the set of memory tunable
parameters for the guest. The keys in the hash are one of the
constants MEMORY PARAMETERS described later. The C<$flags>
parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item $dom->set_memory_parameters($params, $flags=0)

Update the memory tunable parameters for the guest. The
C<$params> should be a hash reference whose keys are one
of the MEMORY PARAMETERS constants. The C<$flags>
parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item my $params = $dom->get_blkio_parameters($flags=0)

Return a hash reference containing the set of blkio tunable
parameters for the guest. The keys in the hash are one of the
constants BLKIO PARAMETERS described later. The C<$flags>
parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item $dom->set_blkio_parameters($params, $flags=0)

Update the blkio tunable parameters for the guest. The
C<$params> should be a hash reference whose keys are one
of the BLKIO PARAMETERS constants. The C<$flags>
parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item $stats = $dom->get_block_iotune($disk, $flags=0)

Return a hash reference containing the set of blkio tunable
parameters for the guest disk C<$disk>. The keys in the hash
are one of the constants BLOCK IOTUNE PARAMETERS described later.

=item $dom->set_block_iotune($disk, $params, $flags=0);

Update the blkio tunable parameters for the guest disk C<$disk>. The
C<$params> should be a hash reference whose keys are one
of the BLOCK IOTUNE PARAMETERS constants.

=item my $params = $dom->get_interface_parameters($intf, $flags=0)

Return a hash reference containing the set of interface tunable
parameters for the guest. The keys in the hash are one of the
constants INTERFACE PARAMETERS described later.

=item $dom->set_interface_parameters($intf, $params, $flags=0)

Update the interface tunable parameters for the guest. The
C<$params> should be a hash reference whose keys are one
of the INTERFACE PARAMETERS constants.

=item my $params = $dom->get_numa_parameters($flags=0)

Return a hash reference containing the set of numa tunable
parameters for the guest. The keys in the hash are one of the
constants NUMA PARAMETERS described later. The C<$flags>
parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item $dom->set_numa_parameters($params, $flags=0)

Update the numa tunable parameters for the guest. The
C<$params> should be a hash reference whose keys are one
of the NUMA PARAMETERS constants. The C<$flags>
parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item my $params = $dom->get_perf_events($flags=0)

Return a hash reference containing the set of performance
events that are available for the guest. The keys in the
hash are one of the constants PERF EVENTS described later.
The C<$flags> parameter accepts one or more the CONFIG
OPTION constants documented later, and defaults to 0 if
omitted.

=item $dom->set_perf_events($params, $flags=0)

Update the enabled state for performance events for the
guest. The C<$params> should be a hash reference whose
keys are one of the PERF EVENTS constants. The C<$flags>
parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item $dom->block_resize($disk, $newsize, $flags=0)

Resize the disk C<$disk> to have new size C<$newsize> KB. If the disk
is backed by a special image format, the actual resize is done by the
hypervisor. If the disk is backed by a raw file, or block device,
the resize must be done prior to invoking this API call, and it
merely updates the hypervisor's view of the disk size. The following
flags may be used

=over 4

=item Sys::Virt::Domain::BLOCK_RESIZE_BYTES

Treat C<$newsize> as if it were in bytes, rather than KB.

=back

=item $dom->interface_stats($path)

Fetch the current I/O statistics for the block device given by C<$path>.
The returned hash containins keys for

=over 4

=item C<rx_bytes>

Total bytes received

=item C<rx_packets>

Total packets received

=item C<rx_errs>

Total packets received with errors

=item C<rx_drop>

Total packets drop at reception

=item C<tx_bytes>

Total bytes transmitted

=item C<tx_packets>

Total packets transmitted

=item C<tx_errs>

Total packets transmitted with errors

=item C<tx_drop>

Total packets dropped at transmission.

=back

=item $dom->memory_stats($flags=0)

Fetch the current memory statistics for the guest domain. The
C<$flags> parameter is currently unused and can be omitted.
The returned hash containins keys for

=over 4

=item C<swap_in>

Data read from swap space

=item C<swap_out>

Data written to swap space

=item C<major_fault>

Page fault involving disk I/O

=item C<minor_fault>

Page fault not involving disk I/O

=item C<unused>

Memory not used by the system

=item C<available>

Total memory seen by guest

=item C<rss>

Resident set size. Size of memory resident in host RAM.

=back

=item $info = $dom->get_security_label()

Fetch information about the security label assigned to the guest
domain. The returned hash reference has two keys, C<model> gives
the name of the security model in effect (eg C<selinux>), while
C<label> provides the name of the security label applied to the
domain. This method only returns information about the first
security label. To retrieve all labels, use C<get_security_label_list>.

=item @info = $dom->get_security_label_list()

Fetches information about all security labels assigned to the
guest domain. The elements in the returned array are all
hash references, whose keys are as described for C<get_security_label>.

=item $ddom = $dom->migrate(destcon, \%params, flags=0)

Migrate a domain to an alternative host. The C<destcon> parameter
should be a C<Sys::Virt> connection to the remote target host.
The C<flags> parameter takes one or more of the C<Sys::Virt::Domain::MIGRATE_XXX>
constants described later in this document. The C<%params> parameter is
a hash reference used to set various parameters for the migration
operation, with the following valid keys.

=over 4

=item C<Sys::Virt::Domain::MIGRATE_PARAM_URI>

The URI to use for initializing the domain migration. It takes a
hypervisor specific format. The uri_transports element of the hypervisor
capabilities XML includes details of the supported URI schemes. When
omitted libvirt will auto-generate suitable default URI. It is typically
only necessary to specify this URI if the destination host has multiple
interfaces and a specific interface is required to transmit migration data.

=item C<Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME>

The name to be used for the domain on the destination host. Omitting
this parameter keeps the domain name the same. This field is only
allowed to be used with hypervisors that support domain renaming
during migration.

=item C<Sys::Virt::Domain::MIGRATE_PARAM_DEST_XML>

The new configuration to be used for the domain on the destination host.
The configuration must include an identical set of virtual devices, to
ensure a stable guest ABI across migration. Only parameters related to
host side configuration can be changed in the XML. Hypervisors which
support this field will forbid migration if the provided XML would cause
a change in the guest ABI. This field cannot be used to rename the domain
during migration (use VIR_MIGRATE_PARAM_DEST_NAME field for that purpose).
Domain name in the destination XML must match the original domain name.

Omitting this parameter keeps the original domain configuration. Using this
field with hypervisors that do not support changing domain configuration
during migration will result in a failure.

=item C<Sys::Virt::Domain::MIGRATE_PARAM_GRAPHICS_URI>

URI to use for migrating client's connection to domain's graphical console
as VIR_TYPED_PARAM_STRING. If specified, the client will be asked to
automatically reconnect using these parameters instead of the automatically
computed ones. This can be useful if, e.g., the client does not have a direct
access to the network virtualization hosts are connected to and needs to
connect through a proxy. The URI is formed as follows:

      protocol://hostname[:port]/[?parameters]

where protocol is either "spice" or "vnc" and parameters is a list of
protocol specific parameters separated by '&'. Currently recognized
parameters are "tlsPort" and "tlsSubject". For example,

      spice://target.host.com:1234/?tlsPort=4567

=item C<Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH>

The maximum bandwidth (in MiB/s) that will be used for migration. If
set to 0 or omitted, libvirt will choose a suitable default. Some
hypervisors do not support this feature and will return an error if
this field is used and is not 0.

=item C<Sys::Virt::Domain::MIGRATE_PARAM_LISTEN_ADDRESS>

The address on which to listen for incoming migration connections.
If omitted, libvirt will listen on the wildcard address (0.0.0.0
or ::). This default may be a security risk if guests, or other
untrusted users have the ability to connect to the virtualization
host, thus use of an explicit restricted listen address is recommended.

=item C<Sys::Virt::Domain::MIGRATE_PARAM_DISK_PORT>

Port that destination server should use for incoming disks migration. Type is
VIR_TYPED_PARAM_INT. If set to 0 or omitted, libvirt will choose a suitable
default. At the moment this is only supported by the QEMU driver.

=item C<Sys::Virt::Domain::MIGRATE_PARAM_MIGRATE_DISKS>

The list of disks to migrate when doing block storage migration.
In contrast to other parameters whose values are plain strings,
the parameter value should be an array reference, whose elements
are in turn strings representing the disk target names.

=item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION>

The type of compression method use use, either C<xbzrle> or
C<mt>.

=item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_THREADS>

The number of compression threads to use

=item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_DTHREADS>

The number of decompression threads

=item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_MT_LEVEL>

The compression level from 0 (no compression) to 9 (maximum
compression)

=item C<Sys::Virt::Domain::MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE>

The size of the cache for xbzrle compression

=item C<Sys::Virt::Domain::MIGRATE_PARAM_PERSIST_XML>

The alternative persistent XML config to copy

=item C<Sys::Virt::Domain::MIGRATE_PARAM_AUTO_CONVERGE_INITIAL>

The initial percentage to throttle guest vCPUs

=item C<Sys::Virt::Domain::MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT>

The additional percentage step size to throttle guest vCPUs if
progress is not made

=back

=item $ddom = $dom->migrate(destcon, flags=0, dname=undef, uri=undef, bandwidth=0)

Migrate a domain to an alternative host. Use of positional parameters
with C<migrate> is deprecated in favour of passing a hash reference
as described above.

=cut

sub migrate {
    my $dom = shift;
    my $destcon = shift;

    if (ref $_[0] &&
	ref $_[0] eq "HASH") {
	my $params = shift;
	my $flags = shift;

	return $dom->_migrate($destcon, $params, $flags);
    } else {
	my $flags = shift;
	my $dname = shift;
	my $uri = shift;
	my $bandwidth = shift;
	my $params = {};

	$params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME} = $dname
	    if defined $dname;
	$params->{&Sys::Virt::Domain::MIGRATE_PARAM_URI} = $uri
	    if defined $uri;
	$params->{&Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH} = $bandwidth
	    if defined $bandwidth;

	return $dom->_migrate($destcon, $params, $flags);
    }
}


=item $ddom = $dom->migrate2(destcon, dxml, flags, dname, uri, bandwidth)

Migrate a domain to an alternative host. This method is deprecated in
favour of passing a hash ref to C<migrate>.

=cut

sub migrate2 {
    my $dom = shift;
    my $destcon = shift;
    my $dxml = shift;
    my $flags = shift;
    my $dname = shift;
    my $uri = shift;
    my $bandwidth = shift;
    my $params = {};

    $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_XML} = $dxml
	if defined $dxml;
    $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME} = $dname
	if defined $dname;
    $params->{&Sys::Virt::Domain::MIGRATE_PARAM_URI} = $uri
	if defined $uri;
    $params->{&Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH} = $bandwidth
	if defined $bandwidth;

    return $dom->_migrate($destcon, $params, $flags);
}


=item $ddom = $dom->migrate_to_uri(desturi, \%params, flags=0)

Migrate a domain to an alternative host. The C<desturi> parameter
should be a valid libvirt connection URI for the remote target host.
The C<flags> parameter takes one or more of the C<Sys::Virt::Domain::MIGRATE_XXX>
constants described later in this document. The C<%params> parameter is
a hash reference used to set various parameters for the migration
operation, with the same keys described for the C<migrate> API.

=item $dom->migrate_to_uri(desturi, flags, dname, bandwidth)

Migrate a domain to an alternative host. Use of positional parameters
with C<migrate_to_uri> is deprecated in favour of passing a hash reference
as described above.

=cut

sub migrate_to_uri {
    my $dom = shift;
    my $desturi = shift;

    if (ref $_[0] &&
	ref $_[0] eq "HASH") {
	my $params = shift;
	my $flags = shift;

	return $dom->_migrate_to_uri($desturi, $params, $flags);
    } else {
	my $flags = shift;
	my $dname = shift;
	my $uri = shift;
	my $bandwidth = shift;
	my $params = {};

	$params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME} = $dname
	    if defined $dname;
	$params->{&Sys::Virt::Domain::MIGRATE_PARAM_URI} = $uri
	    if defined $uri;
	$params->{&Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH} = $bandwidth
	    if defined $bandwidth;

	return $dom->_migrate_to_uri($desturi, $params, $flags);
    }
}


=item $dom->migrate_to_uri2(dconnuri, miguri, dxml, flags, dname, bandwidth)

Migrate a domain to an alternative host. This method is deprecated in
favour of passing a hash ref to C<migrate_to_uri>.

=cut

sub migrate_to_uri2 {
    my $dom = shift;
    my $desturi = shift;
    my $dxml = shift;
    my $flags = shift;
    my $dname = shift;
    my $uri = shift;
    my $bandwidth = shift;
    my $params = {};

    $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_XML} = $dxml
	if defined $dxml;
    $params->{&Sys::Virt::Domain::MIGRATE_PARAM_DEST_NAME} = $dname
	if defined $dname;
    $params->{&Sys::Virt::Domain::MIGRATE_PARAM_URI} = $uri
	if defined $uri;
    $params->{&Sys::Virt::Domain::MIGRATE_PARAM_BANDWIDTH} = $bandwidth
	if defined $bandwidth;

    return $dom->_migrate_to_uri2($desturi, $params, $flags);
}


=item $dom->migrate_set_max_downtime($downtime, $flags=0)

Set the maximum allowed downtime during migration of the guest. A
longer downtime makes it more likely that migration will complete,
at the cost of longer time blackout for the guest OS at the switch
over point. The C<downtime> parameter is measured in milliseconds.
The C<$flags> parameter is currently unused and defaults to zero.

=item $downtime = $dom->migrate_get_max_downtime($flags=0)
Get the current value of the maximum downtime allowed during a
migration of a guest. The returned <downtime> value is measured
in milliseconds. The C<$flags> parameter is currently unused and
defaults to zero.

=item $dom->migrate_set_max_speed($bandwidth, $flags=0)

Set the maximum allowed bandwidth during migration of the guest.
The C<bandwidth> parameter is measured in MB/second.
The C<$flags> parameter is currently unused and defaults to zero.

=item $bandwidth = $dom->migrate_get_max_speed($flags=0)

Get the maximum allowed bandwidth during migration fo the guest.
The returned <bandwidth> value is measured in MB/second.
The C<$flags> parameter is currently unused and defaults to zero.

=item $dom->migrate_set_compression_cache($cacheSize, $flags=0)

Set the maximum allowed compression cache size during migration of
the guest. The C<cacheSize> parameter is measured in bytes.
The C<$flags> parameter is currently unused and defaults to zero.

=item $cacheSize = $dom->migrate_get_compression_cache($flags=0)

Get the maximum allowed compression cache size during migration of
the guest. The returned <bandwidth> value is measured in bytes.
The C<$flags> parameter is currently unused and defaults to zero.

=item $dom->migrate_start_post_copy($flags=0)

Switch the domain from pre-copy to post-copy mode. This requires
that the original migrate command had the C<Sys::Virt::Domain::MIGRATE_POST_COPY>
flag specified.

=item $dom->inject_nmi($flags)

Trigger an NMI in the guest virtual machine. The C<$flags> parameter
is currently unused and defaults to 0.

=item $dom->open_console($st, $devname, $flags)

Open the text console for a serial, parallel or paravirt console
device identified by C<$devname>, connecting it to the stream
C<$st>. If C<$devname> is undefined, the default console will be
opened. C<$st> must be a C<Sys::Virt::Stream> object used for
bi-directional communication with the console. C<$flags> is
currently unused, defaulting to 0.

=item $dom->open_channel($st, $devname, $flags)

Open the text console for a data channel device identified by
C<$devname>, connecting it to the stream C<$st>. C<$st> must
be a C<Sys::Virt::Stream> object used for bi-directional
communication with the channel. C<$flags> is currently unused,
defaulting to 0.

=item $dom->open_graphics($idx, $fd, $flags)

Open the graphics console for a guest, identified by C<$idx>,
counting from 0. The C<$fd> should be a file descriptor for an
anoymous socket pair. The C<$flags> argument should be one of
the constants listed at the end of this document, and defaults
to 0.

=item $fd = $dom->open_graphics_fd($idx, $flags)

Open the graphics console for a guest, identified by C<$idx>,
counting from 0. The C<$flags> argument should be one of the
constants listed at the end of this document, and defaults
to 0. The return value will be a file descriptor connected
to the console which must be closed when no longer needed.
This method is preferred over C<open_graphics> since it will
work correctly under sVirt mandatory access control policies.

=item my $mimetype = $dom->screenshot($st, $screen, $flags)

Capture a screenshot of the virtual machine's monitor. The C<$screen>
parameter controls which monitor is captured when using a multi-head
or multi-card configuration. C<$st> must be a C<Sys::Virt::Stream>
object from which the data can be read. C<$flags> is currently unused
and defaults to 0. The mimetype of the screenshot is returned

=item @vcpuinfo = $dom->get_vcpu_info($flags=0)

Obtain information about the state of all virtual CPUs in a running
guest domain. The returned list will have one element for each vCPU,
where each elements contains a hash reference. The keys in the hash
are, C<number> the vCPU number, C<cpu> the physical CPU on which the
vCPU is currently scheduled, C<cpuTime> the cumulative execution
time of the vCPU, C<state> the running state and C<affinity> giving
the allowed shedular placement. The value for C<affinity> is a
string representing a bitmask against physical CPUs, 8 cpus per
character. To extract the bits use the C<unpack> function with
the C<b*> template. NB The C<state>, C<cpuTime>, C<cpu> values are
only available if using C<$flags> value of 0, and the domain is
currently running; otherwise they will all be set to zero.

=item $dom->pin_vcpu($vcpu, $mask)

Pin the virtual CPU given by index C<$vcpu> to physical CPUs
given by C<$mask>. The C<$mask> is a string representing a bitmask
against physical CPUs, 8 cpus per character.

=item $mask = $dom->get_emulator_pin_info()

Obtain information about the CPU affinity of the emulator process.
The returned C<$mask> is a bitstring against physical CPUs, 8 cpus
per character. To extract the bits use the C<unpack> function with
the C<b*> template.

=item $dom->pin_emulator($newmask, $flags=0)

Pin the emulator threads to the physical CPUs identified by the
affinity in C<$newmask>. The C<$newmask> is a bitstring against
the physical CPUa, 8 cpus per character. To create a suitable
bitstring, use the C<vec> function with a value of C<1> for the
C<BITS> parameter.

=item @iothreadinfo = $dom->get_iothread_info($flags=0)

Obtain information about the state of all IOThreads in a running
guest domain. The returned list will have one element for each IOThread,
where each elements contains a hash reference. The keys in the hash
are, C<number> the IOThread number and C<affinity> giving the allowed
schedular placement. The value for C<affinity> is a
string representing a bitmask against physical CPUs, 8 cpus per
character. To extract the bits use the C<unpack> function with
the C<b*> template.

=item $dom->pin_iothread($iothread, $mask)

Pin the IOThread given by index C<$iothread> to physical CPUs
given by C<$mask>. The C<$mask> is a string representing a bitmask
against physical CPUs, 8 cpus per character.

=item $dom->add_iothread($iothread, $flags=0)

Add a new IOThread by the C<$iothread> value to the guest domain.
The C<$flags> parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item $dom->del_iothread($iothread, $flags=0)

Delete an existing IOThread by the C<$iothread> value from the guest domain.
The C<$flags> parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item $dom->set_iothread($iothread, $params, $nparams, $flags=0)

Set parameters for the IOThread by the C<$iothread> value on the guest domain.
The C<$params> parameter is a hash reference whose keys are the
C<IOTHREAD STATS> constants documented later.
The C<$flags> parameter accepts one or more the CONFIG OPTION constants
documented later, and defaults to 0 if omitted.

=item my @stats = $dom->get_cpu_stats($startCpu, $numCpus, $flags=0)

Requests the guests host physical CPU usage statistics, starting
from host CPU <$startCpu> counting up to C<$numCpus>. If C<$startCpu>
is -1 and C<$numCpus> is 1, then the utilization across all CPUs
is returned. Returns an array of hash references, each element
containing stats for one CPU.

=item my $info = $dom->get_job_info()

Returns a hash reference summarising the execution state of the
background job. The elements of the hash are as follows:

=over 4

=item type

The type of job, one of the JOB TYPE constants listed later in
this document.

=item timeElapsed

The elapsed time in milliseconds

=item timeRemaining

The expected remaining time in milliseconds. Only set if the
C<type> is JOB_UNBOUNDED.

=item dataTotal

The total amount of data expected to be processed by the job, in bytes.

=item dataProcessed

The current amount of data processed by the job, in bytes.

=item dataRemaining

The expected amount of data remaining to be processed by the job, in bytes.

=item memTotal

The total amount of mem expected to be processed by the job, in bytes.

=item memProcessed

The current amount of mem processed by the job, in bytes.

=item memRemaining

The expected amount of mem remaining to be processed by the job, in bytes.

=item fileTotal

The total amount of file expected to be processed by the job, in bytes.

=item fileProcessed

The current amount of file processed by the job, in bytes.

=item fileRemaining

The expected amount of file remaining to be processed by the job, in bytes.

=back

=item my ($type, $stats) = $dom->get_job_stats($flags=0)

Returns an array summarising the execution state of the
background job. The C<$type> value is one of the JOB TYPE
constants listed later in this document. The C<$stats>
value is a hash reference, whose elements are one of the
following constants.

=over 4

=item type

The type of job, one of the JOB TYPE constants listed later in
this document.

The C<$flags> parameter defaults to zero and can take one of
the following constants.

=over 4

=item Sys::Virt::Domain::JOB_STATS_COMPLETED

Return the stats of the most recently completed job.

=back

=item Sys::Virt::Domain::JOB_TIME_ELAPSED

The elapsed time in milliseconds

=item Sys::Virt::Domain::JOB_TIME_ELAPSED_NET

Time in milliseconds since the beginning of the migration job NOT
including the time required to transfer control flow from the
source host to the destination host.

=item Sys::Virt::Domain::JOB_TIME_REMAINING

The expected remaining time in milliseconds. Only set if the
C<type> is JOB_UNBOUNDED.

=item Sys::Virt::Domain::JOB_DATA_TOTAL

The total amount of data expected to be processed by the job, in bytes.

=item Sys::Virt::Domain::JOB_DATA_PROCESSED

The current amount of data processed by the job, in bytes.

=item Sys::Virt::Domain::JOB_DATA_REMAINING

The expected amount of data remaining to be processed by the job, in bytes.

=item Sys::Virt::Domain::JOB_MEMORY_TOTAL

The total amount of mem expected to be processed by the job, in bytes.

=item Sys::Virt::Domain::JOB_MEMORY_PROCESSED

The current amount of mem processed by the job, in bytes.

=item Sys::Virt::Domain::JOB_MEMORY_REMAINING

The expected amount of mem remaining to be processed by the job, in bytes.

=item Sys::Virt::Domain::JOB_MEMORY_CONSTANT

The number of pages filled with a constant byte which have
been transferred

=item Sys::Virt::Domain::JOB_MEMORY_NORMAL

The number of pages transferred without any compression

=item Sys::Virt::Domain::JOB_MEMORY_NORMAL_BYTES

The number of bytes transferred without any compression

=item Sys::Virt::Domain::JOB_MEMORY_BPS

The bytes per second transferred

=item Sys::Virt::Domain::JOB_MEMORY_DIRTY_RATE

The number of memory pages dirtied per second

=item Sys::Virt::Domain::JOB_MEMORY_PAGE_SIZE

The memory page size in bytes

=item Sys::Virt::Domain::JOB_MEMORY_ITERATION

The total number of iterations over guest memory

=item Sys::Virt::Domain::JOB_MEMORY_POSTCOPY_REQS

The number of page requests received from the destination host during post-copy migration.

=item Sys::Virt::Domain::JOB_DISK_TOTAL

The total amount of file expected to be processed by the job, in bytes.

=item Sys::Virt::Domain::JOB_DISK_PROCESSED

The current amount of file processed by the job, in bytes.

=item Sys::Virt::Domain::JOB_DISK_REMAINING

The expected amount of file remaining to be processed by the job, in bytes.

=item Sys::Virt::Domain::JOB_DISK_BPS

The bytes per second transferred

=item Sys::Virt::Domain::JOB_AUTO_CONVERGE_THROTTLE

The percentage by which vCPUs are currently throttled

=item Sys::Virt::Domain::JOB_COMPRESSION_CACHE

The size of the compression cache in bytes

=item Sys::Virt::Domain::JOB_COMPRESSION_BYTES

The number of compressed bytes transferred

=item Sys::Virt::Domain::JOB_COMPRESSION_PAGES

The number of compressed pages transferred

=item Sys::Virt::Domain::JOB_COMPRESSION_CACHE_MISSES

The number of changing pages not in compression cache

=item Sys::Virt::Domain::JOB_COMPRESSION_OVERFLOW

The number of changing pages in the compression cache but sent
uncompressed since the compressed page was larger than the
non-compressed page.

=item Sys::Virt::Domain::JOB_DOWNTIME

The number of milliseconds of downtime expected during
migration switchover.

=item Sys::Virt::Domain::JOB_DOWNTIME_NET

Real measured downtime (ms) NOT including the time required to
transfer control flow from the source host to the destination
host.

=item Sys::Virt::Domain::JOB_SETUP_TIME

The number of milliseconds of time doing setup of the job

=item Sys::Virt::Domain::JOB_OPERATION

The type of operation associated with the job

=back

The values for the Sys::Virt::Domain::JOB_OPERATION field are

=over 4

=item Sys::Virt::Domain::JOB_OPERATION_UNKNOWN

No known job type

=item Sys::Virt::Domain::JOB_OPERATION_START

The guest is starting

=item Sys::Virt::Domain::JOB_OPERATION_SAVE

The guest is saving to disk

=item Sys::Virt::Domain::JOB_OPERATION_RESTORE

The guest is restoring from disk

=item Sys::Virt::Domain::JOB_OPERATION_MIGRATION_IN

The guest is migrating in from another host

=item Sys::Virt::Domain::JOB_OPERATION_MIGRATION_OUT

The guest is migrating out to another host

=item Sys::Virt::Domain::JOB_OPERATION_SNAPSHOT

The guest is saving a snapshot

=item Sys::Virt::Domain::JOB_OPERATION_SNAPSHOT_REVERT

The guest is reverting to a snapshot

=item Sys::Virt::Domain::JOB_OPERATION_DUMP

The guest is saving a crash dump

=back

=item $dom->abort_job()

Aborts the currently executing job

=item my $info = $dom->get_block_job_info($path, $flags=0)

Returns a hash reference summarising the execution state of
the block job. The C<$path> parameter should be the fully
qualified path of the block device being changed. Valid
C<$flags> include:

=over 4

=item Sys::Virt::Domain::BLOCK_JOB_INFO_BANDWIDTH_BYTES

Treat bandwidth value as bytes instead of MiB.

=back

=item $dom->set_block_job_speed($path, $bandwidth, $flags=0)

Change the maximum I/O bandwidth used by the block job that
is currently executing for C<$path>. The C<$bandwidth> argument
is specified in MB/s.  The C<$flags> parameter
can take the bitwise union of the values:

=over 4

=item Sys::Virt::Domain::BLOCK_JOB_SPEED_BANDWIDTH_BYTES

The C<$bandwidth> parameter value is measured in bytes/s
instead of MB/s.

=back

=item $dom->abort_block_job($path, $flags=0)

Abort the current job that is executing for the block device
associated with C<$path>

=item $dom->block_pull($path, $bandwidth, $flags=0)

Merge the backing files associated with C<$path> into the
top level file. The C<$bandwidth> parameter specifies the
maximum I/O rate to allow in MB/s. The C<$flags> parameter
can take the bitwise union of the values:

=over 4

=item Sys::Virt::Domain::BLOCK_PULL_BANDWIDTH_BYTES

The C<$bandwidth> parameter value is measured in bytes/s
instead of MB/s.

=back

=item $dom->block_rebase($path, $base, $bandwidth, $flags=0)

Switch the backing path associated with C<$path> to instead
use C<$base>. The C<$bandwidth> parameter specifies the
maximum I/O rate to allow in MB/s. The C<$flags> parameter
can take the bitwise union of the values:

=over 4

=item Sys::Virt::Domain::BLOCK_REBASE_BANDWIDTH_BYTES

The C<$bandwidth> parameter value is measured in bytes/s
instead of MB/s.

=back

=item $dom->block_copy($path, $destxml, $params, $flags=0)

Copy contents of a disk image <$path> into the target volume
described by C<$destxml> which follows the schema of the
<disk> element in the domain XML. The C<$params> parameter
is a hash of optional parameters to control the process

=over 4

=item Sys::Virt::Domain::BLOCK_COPY_BANDWIDTH

The maximum bandwidth in bytes per second.

=item Sys::Virt::Domain::BLOCK_COPY_GRANULARITY

The granularity in bytes of the copy process

=item Sys::Virt::Domain::BLOCK_COPY_BUF_SIZE

The maximum amount of data in flight in bytes.

=back

=item $dom->block_commit($path, $base, $top, $bandwidth, $flags=0)

Commit changes there were made to the temporary top level file C<$top>.
Takes all the differences between C<$top> and C<$base> and merge them
into C<$base>. The C<$bandwidth> parameter specifies the
maximum I/O rate to allow in MB/s.  The C<$flags> parameter
can take the bitwise union of the values:

=over 4

=item Sys::Virt::Domain::BLOCK_COMMIT_BANDWIDTH_BYTES

The C<$bandwidth> parameter value is measured in bytes
instead of MB/s.

=back

=item $count = $dom->num_of_snapshots()

Return the number of saved snapshots of the domain

=item @names = $dom->list_snapshot_names()

List the names of all saved snapshots. The names can be
used with the C<lookup_snapshot_by_name>

=item @snapshots = $dom->list_snapshots()

Return a list of all snapshots currently known to the domain. The elements
in the returned list are instances of the L<Sys::Virt::DomainSnapshot> class.
This method requires O(n) RPC calls, so the C<list_all_snapshots> method is
recommended as a more efficient alternative.

=cut


sub list_snapshots {
    my $self = shift;

    my $nnames = $self->num_of_snapshots();
    my @names = $self->list_snapshot_names($nnames);

    my @snapshots;
    foreach my $name (@names) {
	eval {
	    push @snapshots, Sys::Virt::DomainSnapshot->_new(domain => $self, name => $name);
	};
	if ($@) {
	    # nada - snapshot went away before we could look it up
	};
    }
    return @snapshots;
}



=item my @snapshots = $dom->list_all_snapshots($flags)

Return a list of all domain snapshots associated with this domain.
The elements in the returned list are instances of the
L<Sys::Virt::DomainSnapshot> class. The C<$flags> parameter can be
used to filter the list of return domain snapshots.

=item my $snapshot = $dom->get_snapshot_by_name($name)

Return the domain snapshot with a name of C<$name>. The returned object is
an instance of the L<Sys::Virt::DomainSnapshot> class.

=cut

sub get_snapshot_by_name {
    my $self = shift;
    my $name = shift;

    return Sys::Virt::DomainSnapshot->_new(domain => $self, name => $name);
}

=item $dom->has_current_snapshot()

Returns a true value if the domain has a currently active snapshot

=item $snapshot = $dom->current_snapshot()

Returns the currently active snapshot for the domain.

=item $snapshot = $dom->create_snapshot($xml[, $flags])

Create a new snapshot from the C<$xml>. The C<$flags> parameter accepts
the B<SNAPSHOT CREATION> constants listed in C<Sys::Virt::DomainSnapshots>.

=cut

sub create_snapshot {
    my $self = shift;
    my $xml = shift;
    my $flags = shift;

    my $snapshot = Sys::Virt::DomainSnapshot->_new(domain => $self, xml => $xml, flags => $flags);

    return $snapshot;
}

1;

=item $dom->fs_trim($mountPoint, $minimum, $flags=0);

Issue an FS_TRIM command to the device at C<$mountPoint>
to remove chunks of unused space that are at least
C<$minimum> bytes in length. C<$flags> is currently
unused and defaults to zero.

=item $dom->fs_freeze(\@mountPoints, $flags=0);

Freeze all the filesystems associated with the C<@mountPoints>
array reference. If <@mountPoints> is an empty list, then all
filesystems will be frozen. C<$flags> is currently
unused and defaults to zero.

=item $dom->fs_thaw(\@mountPoints, $flags=0);

Thaw all the filesystems associated with the C<@mountPoints>
array reference. If <@mountPoints> is an empty list, then all
filesystems will be thawed. C<$flags> is currently
unused and defaults to zero.

=item @fslist = $dom->get_fs_info($flags=0);

Obtain a list of all guest filesystems. The returned list will
contain one element for each filesystem, whose value will be
a hash reference with the following keys

=over 4

=item name

The name of the guest device that is mounted

=item fstype

The filesystem type (eg 'ext4', 'fat', 'ntfs', etc)

=item mountpoint

The location in the filesystem tree of the mount

=item devalias

An array reference containing list of device aliases
associated with the guest device. The device aliases
correspond to disk target names in the guest XML
configuration

=back

=item @nics = $dom->get_interface_addresses($src, $flags=0);

Obtain a list of all guest network interfaces. The C<$src>
parameter is one of the constants

=over 4

=item Sys::Virt::Domain::INTERFACE_ADDRESSES_SRC_LEASE

Extract the DHCP server lease information

=item Sys::Virt::Domain::INTERFACE_ADDRESSES_SRC_AGENT

Query the guest OS via an agent

=item Sys::Virt::Domain::INTERFACE_ADDRESSES_SRC_ARP

Extract from the local ARP tables

=back

The returned list will contain one element for each interface.
The values in the list will be a hash reference with the
following keys

=over 4

=item name

The name of the guest interface that is mounted

=item hwaddr

The hardware address, aka MAC, if available.

=item addrs

An array reference containing list of IP addresses
associated with the guest NIC. Each element in the
array is a further hash containing

=over 4

=item addr

The IP address string

=item prefix

The IP address network prefix

=item type

The IP address type (IPv4 vs IPv6)

=back

=back

=item $dom->send_process_signal($pid, $signum, $flags=0);

Send the process C<$pid> the signal C<$signum>. The
C<$signum> value must be one of the constants listed
later, not a POSIX or Linux signal value. C<$flags>
is currently unused and defaults to zero.

=item $dom->set_block_threshold($dev, $threshold, $flags=0);

Set the threshold level for delivering the
EVENT_ID_BLOCK_THRESHOLD if the device or backing chain element
described by C<$dev> is written beyond the set C<$threshold>
level. The threshold level is unset once the event fires. The
event might not be delivered at all if libvirtd was not running
at the moment when the threshold was reached.

=item $dom->set_lifecycle_action($type, $action, $flags=0)

Changes the actions of lifecycle events for domain represented as
<on_$type>$action</on_$type> in the domain XML.

=item $info = $dom->get_launch_security_info($flags=0)

Get information about the domaim launch security policy. C<$flags>
is currently unused and defaults to zero. The returned hash may
contain the following keys

=over 4

=item Sys::Virt::Domain::LAUNCH_SECURITY_SEV_MEASUREMENT

The AMD SEV launch measurement

=back

=back

=head1 CONSTANTS

A number of the APIs take a C<flags> parameter. In most cases
passing a value of zero will be satisfactory. Some APIs, however,
accept named constants to alter their behaviour. This section
documents the current known constants.

=head2 DOMAIN STATE

The domain state constants are useful in interpreting the
C<state> key in the hash returned by the C<get_info> method.

=over 4

=item Sys::Virt::Domain::STATE_NOSTATE

The domain is active, but is not running / blocked (eg idle)

=item Sys::Virt::Domain::STATE_RUNNING

The domain is active and running

=item Sys::Virt::Domain::STATE_BLOCKED

The domain is active, but execution is blocked

=item Sys::Virt::Domain::STATE_PAUSED

The domain is active, but execution has been paused

=item Sys::Virt::Domain::STATE_SHUTDOWN

The domain is active, but in the shutdown phase

=item Sys::Virt::Domain::STATE_SHUTOFF

The domain is inactive, and shut down.

=item Sys::Virt::Domain::STATE_CRASHED

The domain is inactive, and crashed.

=item Sys::Virt::Domain::STATE_PMSUSPENDED

The domain is active, but in power management suspend state

=back


=head2 CONTROL INFO

The following constants can be used to determine what the
guest domain control channel status is

=over 4

=item Sys::Virt::Domain::CONTROL_ERROR

The control channel has a fatal error

=item Sys::Virt::Domain::CONTROL_OK

The control channel is ready for jobs

=item Sys::Virt::Domain::CONTROL_OCCUPIED

The control channel is busy

=item Sys::Virt::Domain::CONTROL_JOB

The control channel is busy with a job

=back

If the status is C<Sys::Virt::Domain::CONTROL_ERROR>, then one
of the following constants describes the reason

=over 4

=item Sys::Virt::Domain::CONTROL_ERROR_REASON_NONE

There is no reason for the error available

=item Sys::Virt::Domain::CONTROL_ERROR_REASON_UNKNOWN

The reason for the error is unknown

=item Sys::Virt::Domain::CONTROL_ERROR_REASON_INTERNAL

There was an internal error in libvirt

=item Sys::Virt::Domain::CONTROL_ERROR_REASON_MONITOR

There was an error speaking to the monitor

=back

=head2 DOMAIN CREATION

The following constants can be used to control the behaviour
of domain creation

=over 4

=item Sys::Virt::Domain::START_PAUSED

Keep the guest vCPUs paused after starting the guest

=item Sys::Virt::Domain::START_AUTODESTROY

Automatically destroy the guest when the connection is closed (or fails)

=item Sys::Virt::Domain::START_BYPASS_CACHE

Do not use OS I/O cache if starting a domain with a saved state image

=item Sys::Virt::Domain::START_FORCE_BOOT

Boot the guest, even if there was a saved snapshot

=item Sys::Virt::Domain::START_VALIDATE

Validate the XML document against the XML schema

=back

=head2 DOMAIN DEFINE

The following constants can be used to control the behaviour
of domain define operations

=over 4

=item Sys::Virt::Domain::DEFINE_VALIDATE

Validate the XML document against the XML schema

=back

=head2 KEYCODE SETS

The following constants define the set of supported keycode
sets

=over 4

=item Sys::Virt::Domain::KEYCODE_SET_LINUX

The Linux event subsystem keycodes

=item Sys::Virt::Domain::KEYCODE_SET_XT

The original XT keycodes

=item Sys::Virt::Domain::KEYCODE_SET_ATSET1

The AT Set1 keycodes (aka XT)

=item Sys::Virt::Domain::KEYCODE_SET_ATSET2

The AT Set2 keycodes (aka AT)

=item Sys::Virt::Domain::KEYCODE_SET_ATSET3

The AT Set3 keycodes (aka PS2)

=item Sys::Virt::Domain::KEYCODE_SET_OSX

The OS-X keycodes

=item Sys::Virt::Domain::KEYCODE_SET_XT_KBD

The XT keycodes from the Linux Keyboard driver

=item Sys::Virt::Domain::KEYCODE_SET_USB

The USB HID keycode set

=item Sys::Virt::Domain::KEYCODE_SET_WIN32

The Windows keycode set

=item Sys::Virt::Domain::KEYCODE_SET_QNUM

The XT keycode set, with the extended scancodes using the
high bit of the first byte, instead of the low bit of the
second byte.

=item Sys::Virt::Domain::KEYCODE_SET_RFB

A deprecated alias for C<Sys::Virt::Domain::KEYCODE_SET_QNUM>

=back

=head2 MEMORY PEEK

The following constants can be used with the C<memory_peek>
method's flags parameter

=over 4

=item Sys::Virt::Domain::MEMORY_VIRTUAL

Indicates that the offset is using virtual memory addressing.

=item Sys::Virt::Domain::MEMORY_PHYSICAL

Indicates that the offset is using physical memory addressing.

=back


=head2 VCPU STATE

The following constants are useful when interpreting the
virtual CPU run state

=over 4

=item Sys::Virt::Domain::VCPU_OFFLINE

The virtual CPU is not online

=item Sys::Virt::Domain::VCPU_RUNNING

The virtual CPU is executing code

=item Sys::Virt::Domain::VCPU_BLOCKED

The virtual CPU is waiting to be scheduled

=back


=head2 OPEN GRAPHICS CONSTANTS

The following constants are used when opening a connection
to the guest graphics server

=over 4

=item Sys::Virt::Domain::OPEN_GRAPHICS_SKIPAUTH

Skip authentication of the client

=back


=head2 OPEN CONSOLE CONSTANTS

The following constants are used when opening a connection
to the guest console

=over 4

=item Sys::Virt::Domain::OPEN_CONSOLE_FORCE

Force opening of the console, disconnecting any other
open session

=item Sys::Virt::Domain::OPEN_CONSOLE_SAFE

Check if the console driver supports safe operations

=back

=head2 OPEN CHANNEL CONSTANTS

The following constants are used when opening a connection
to the guest channel

=over 4

=item Sys::Virt::Domain::OPEN_CHANNEL_FORCE

Force opening of the channel, disconnecting any other
open session

=back

=head2 XML DUMP OPTIONS

The following constants are used to control the information
included in the XML configuration dump

=over 4

=item Sys::Virt::Domain::XML_INACTIVE

Report the persistent inactive configuration for the guest, even
if it is currently running.

=item Sys::Virt::Domain::XML_SECURE

Include security sensitive information in the XML dump, such as
passwords.

=item Sys::Virt::Domain::XML_UPDATE_CPU

Update the CPU model definition to match the current executing
state.

=item Sys::Virt::Domain::XML_MIGRATABLE

Update the XML to allow migration to older versions of libvirt

=back

=head2 DEVICE HOTPLUG OPTIONS

The following constants are used to control device hotplug
operations

=over 4

=item Sys::Virt::Domain::DEVICE_MODIFY_CURRENT

Modify the domain in its current state

=item Sys::Virt::Domain::DEVICE_MODIFY_LIVE

Modify only the live state of the domain

=item Sys::Virt::Domain::DEVICE_MODIFY_CONFIG

Modify only the persistent config of the domain

=item Sys::Virt::Domain::DEVICE_MODIFY_FORCE

Force the device to be modified

=back

=head2 MEMORY OPTIONS

The following constants are used to control memory change
operations

=over 4

=item Sys::Virt::Domain::MEM_CURRENT

Modify the current state

=item Sys::Virt::Domain::MEM_LIVE

Modify only the live state of the domain

=item Sys::Virt::Domain::MEM_CONFIG

Modify only the persistent config of the domain

=item Sys::Virt::Domain::MEM_MAXIMUM

Modify the maximum memory value

=back

=head2 CONFIG OPTIONS

The following constants are used to control what configuration
a domain update changes

=over 4

=item Sys::Virt::Domain::AFFECT_CURRENT

Modify the current state

=item Sys::Virt::Domain::AFFECT_LIVE

Modify only the live state of the domain

=item Sys::Virt::Domain::AFFECT_CONFIG

Modify only the persistent config of the domain

=back

=head2 MIGRATE OPTIONS

The following constants are used to control how migration
is performed

=over 4

=item Sys::Virt::Domain::MIGRATE_LIVE

Migrate the guest without interrupting its execution on the source
host.

=item Sys::Virt::Domain::MIGRATE_PEER2PEER

Manage the migration process over a direct peer-2-peer connection between
the source and destination host libvirtd daemons.

=item Sys::Virt::Domain::MIGRATE_TUNNELLED

Tunnel the migration data over the libvirt daemon connection, rather
than the native hypervisor data transport. Requires PEER2PEER flag to
be set.

=item Sys::Virt::Domain::MIGRATE_PERSIST_DEST

Make the domain persistent on the destination host, defining its
configuration file upon completion of migration.

=item Sys::Virt::Domain::MIGRATE_UNDEFINE_SOURCE

Remove the domain's persistent configuration after migration
completes successfully.

=item Sys::Virt::Domain::MIGRATE_PAUSED

Do not re-start execution of the guest CPUs on the destination
host after migration completes.

=item Sys::Virt::Domain::MIGRATE_NON_SHARED_DISK

Copy the complete contents of the disk images during migration

=item Sys::Virt::Domain::MIGRATE_NON_SHARED_INC

Copy the incrementally changed contents of the disk images
during migration

=item Sys::Virt::Domain::MIGRATE_CHANGE_PROTECTION

Do not allow changes to the virtual domain configuration while
migration is taking place. This option is automatically implied
if doing a peer-2-peer migration.

=item Sys::Virt::Domain::MIGRATE_UNSAFE

Migrate even if the compatibility check indicates the migration
will be unsafe to the guest.

=item Sys::Virt::Domain::MIGRATE_OFFLINE

Migrate the guest config if the guest is not currently running

=item Sys::Virt::Domain::MIGRATE_COMPRESSED

Enable compression of the migration data stream

=item Sys::Virt::Domain::MIGRATE_ABORT_ON_ERROR

Abort if an I/O error occurrs on the disk

=item Sys::Virt::Domain::MIGRATE_AUTO_CONVERGE

Force convergance of the migration operation by
throttling guest runtime

=item Sys::Virt::Domain::MIGRATE_RDMA_PIN_ALL

Pin memory for RDMA transfer

=item Sys::Virt::Domain::MIGRATE_POSTCOPY

Enable support for post-copy migration

=item Sys::Virt::Domain::MIGRATE_TLS

Setting this flag will cause the migration to attempt to use the
TLS environment configured by the hypervisor in order to perform
the migration. If incorrectly configured on either source or
destination, the migration will fail.

=back

=head2 UNDEFINE CONSTANTS

The following constants can be used when undefining virtual
domain configurations

=over 4

=item Sys::Virt::Domain::UNDEFINE_MANAGED_SAVE

Also remove any managed save image when undefining the virtual
domain

=item Sys::Virt::Domain::UNDEFINE_SNAPSHOTS_METADATA

Also remove any snapshot metadata when undefining the virtual
domain.

=item Sys::Virt::Domain::UNDEFINE_NVRAM

Also remove any NVRAM state file when undefining the virtual
domain.

=item Sys::Virt::Domain::UNDEFINE_KEEP_NVRAM

keep NVRAM state file when undefining the virtual
domain.

=back

=head2 JOB TYPES

The following constants describe the different background job
types.

=over 4

=item Sys::Virt::Domain::JOB_NONE

No job is active

=item Sys::Virt::Domain::JOB_BOUNDED

A job with a finite completion time is active

=item Sys::Virt::Domain::JOB_UNBOUNDED

A job with an unbounded completion time is active

=item Sys::Virt::Domain::JOB_COMPLETED

The job has finished, but isn't cleaned up

=item Sys::Virt::Domain::JOB_FAILED

The job has hit an error, but isn't cleaned up

=item Sys::Virt::Domain::JOB_CANCELLED

The job was aborted at user request, but isn't cleaned up

=back


=head2 MEMORY PARAMETERS

The following constants are useful when getting/setting
memory parameters for guests

=over 4

=item Sys::Virt::Domain::MEMORY_HARD_LIMIT

The maximum memory the guest can use.

=item Sys::Virt::Domain::MEMORY_SOFT_LIMIT

The memory upper limit enforced during memory contention.

=item Sys::Virt::Domain::MEMORY_MIN_GUARANTEE

The minimum memory guaranteed to be reserved for the guest.

=item Sys::Virt::Domain::MEMORY_SWAP_HARD_LIMIT

The maximum swap the guest can use.

=item Sys::Virt::Domain::MEMORY_PARAM_UNLIMITED

The value of an unlimited memory parameter

=back


=head2 BLKIO PARAMETERS

The following parameters control I/O tuning for the domain
as a whole

=over 4

=item Sys::Virt::Domain::BLKIO_WEIGHT

The I/O weight parameter

=item Sys::Virt::Domain::BLKIO_DEVICE_WEIGHT

The per-device I/O weight parameter

=item Sys::Virt::Domain::BLKIO_DEVICE_READ_BPS

The per-device I/O bytes read per second

=item Sys::Virt::Domain::BLKIO_DEVICE_READ_IOPS

The per-device I/O operations read per second

=item Sys::Virt::Domain::BLKIO_DEVICE_WRITE_BPS

The per-device I/O bytes write per second

=item Sys::Virt::Domain::BLKIO_DEVICE_WRITE_IOPS

The per-device I/O operations write per second

=back

=head2 BLKIO TUNING PARAMETERS

The following parameters control I/O tuning for an individual
guest disk.

=over 4

=item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_BYTES_SEC

The total bytes processed per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_READ_BYTES_SEC

The bytes read per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_BYTES_SEC

The bytes written per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_IOPS_SEC

The total I/O operations processed per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_READ_IOPS_SEC

The I/O operations read per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_IOPS_SEC

The I/O operations written per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX

The maximum total bytes processed per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_READ_BYTES_SEC_MAX

The maximum bytes read per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX

The maximum bytes written per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX

The maximum total I/O operations processed per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_READ_IOPS_SEC_MAX

The maximum I/O operations read per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX

The maximum I/O operations written per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_SIZE_IOPS_SEC

The maximum I/O operations per second

=item Sys::Virt::Domain::BLOCK_IOTUNE_GROUP_NAME

A string representing a group name to allow sharing of I/O
throttling quota between multiple drives

=item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH

The duration in seconds allowed for maximum total bytes processed per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH

The duration in seconds allowed for maximum bytes read per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH

The duration in seconds allowed for maximum bytes written per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH

The duration in seconds allowed for maximum total I/O operations processed
per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH

The duration in seconds allowed for maximum I/O operations read per second.

=item Sys::Virt::Domain::BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH

The duration in seconds allowed for maximum I/O operations written per second.

=back

=head2 SCHEDULER CONSTANTS

=over 4

=item Sys::Virt::Domain::SCHEDULER_CAP

The VM cap tunable

=item Sys::Virt::Domain::SCHEDULER_CPU_SHARES

The CPU shares tunable

=item Sys::Virt::Domain::SCHEDULER_LIMIT

The VM limit tunable

=item Sys::Virt::Domain::SCHEDULER_RESERVATION

The VM reservation tunable

=item Sys::Virt::Domain::SCHEDULER_SHARES

The VM shares tunable

=item Sys::Virt::Domain::SCHEDULER_VCPU_PERIOD

The VCPU period tunable

=item Sys::Virt::Domain::SCHEDULER_VCPU_QUOTA

The VCPU quota tunable

=item Sys::Virt::Domain::SCHEDULER_GLOBAL_PERIOD

The VM global period tunable

=item Sys::Virt::Domain::SCHEDULER_GLOBAL_QUOTA

The VM global quota tunable

=item Sys::Virt::Domain::SCHEDULER_WEIGHT

The VM weight tunable

=back

=head2 NUMA PARAMETERS

The following constants are useful when getting/setting the
guest NUMA memory policy

=over 4

=item Sys::Virt::Domain::NUMA_MODE

The NUMA policy mode

=item Sys::Virt::Domain::NUMA_NODESET

The NUMA nodeset mask

=back

The following constants are useful when interpreting the
C<Sys::Virt::Domain::NUMA_MODE> parameter value

=over 4

=item Sys::Virt::Domain::NUMATUNE_MEM_STRICT

Allocation is mandatory from the mask nodes

=item Sys::Virt::Domain::NUMATUNE_MEM_PREFERRED

Allocation is preferred from the masked nodes

=item Sys::Virt::Domain::NUMATUNE_MEM_INTERLEAVE

Allocation is interleaved across all masked nods

=back

=head2 INTERFACE PARAMETERS

The following constants are useful when getting/setting the
per network interface tunable parameters

=over 4

=item Sys::Virt::Domain::BANDWIDTH_IN_AVERAGE

The average inbound bandwidth

=item Sys::Virt::Domain::BANDWIDTH_IN_PEAK

The peak inbound bandwidth

=item Sys::Virt::Domain::BANDWIDTH_IN_BURST

The burstable inbound bandwidth

=item Sys::Virt::Domain::BANDWIDTH_IN_FLOOR

The minimum inbound bandwidth

=item Sys::Virt::Domain::BANDWIDTH_OUT_AVERAGE

The average outbound bandwidth

=item Sys::Virt::Domain::BANDWIDTH_OUT_PEAK

The peak outbound bandwidth

=item Sys::Virt::Domain::BANDWIDTH_OUT_BURST

The burstable outbound bandwidth

=back

=head2 PERF EVENTS

The following constants defined performance events
which can be monitored for a guest

=over 4

=item Sys::Virt::Domain::PERF_PARAM_CMT

The CMT event counter which can be used to measure the usage of
cache (bytes) by applications running on the platform. It
corresponds to the "perf.cmt" field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_MBML

The MBML event counter which can be used to monitor the amount of
data (bytes/s) sent through the memory controller on the socket.
It corresponds to the "perf.mbml" field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_MBMT

The MBMT event counter which can be used to monitor total system
bandwidth (bytes/s) from one level of cache to another. It
corresponds to the "perf.mbmt" field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_CACHE_MISSES

The cache_misses perf event counter which can be used to measure
the count of cache misses by applications running on the
platform. It corresponds to the "perf.cache_misses" field in the
*Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_CACHE_REFERENCES

The cache_references perf event counter which can be used to
measure the count of cache hits by applications running on the
platform. It corresponds to the "perf.cache_references" field in
the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_CPU_CYCLES

The cpu_cycles perf event counter which can be used to measure
how many cpu cycles one instruction needs.  It corresponds to the
"perf.cpu_cycles" field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_INSTRUCTIONS

The instructions perf event counter which can be used to measure
the count of instructions by applications running on the
platform. It corresponds to the "perf.instructions" field in the
*Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_BRANCH_INSTRUCTIONS

The branch_instructions perf event counter which can be used to measure
the count of instructions by applications running on the
platform. It corresponds to the "perf.branch_instructions" field in the
*Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_BRANCH_MISSES

The branch_misses perf event which can be used to measure the
count of branch misses by applications running on the platform.
It corresponds to the "perf.branch_misses" field in the *Stats
APIs.

=item Sys::Virt::Domain::PERF_PARAM_BUS_CYCLES
The bus_cycles perf event counter which can be used to measure
the count of bus cycles by applications running on the platform.
It corresponds to the "perf.bus_cycles" field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_STALLED_CYCLES_FRONTEND
The stalled_cycles_frontend perf event counter which can be used
to measure the count of stalled cpu cycles in the frontend of the
instruction processor pipeline by applications running on the
platform. It corresponds to the "perf.stalled_cycles_frontend"
field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_STALLED_CYCLES_BACKEND
The stalled_cycles_backend perf event counter which can be used
to measure the count of stalled cpu cycles in the backend of the
instruction processor pipeline by application running on the
platform. It corresponds to the "perf.stalled_cycles_backend"
field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_REF_CPU_CYCLES
The ref_cpu_cycles perf event counter which can be used to
measure the count of total cpu cycles not affected by CPU
frequency scaling by applications running on the platform.
It corresponds to the "perf.ref_cpu_cycles" field in the
*Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_CPU_CLOCK
The cpu_clock perf event counter which can be used to
measure the count of cpu clock time by applications
running on the platform. It corresponds to the
"perf.cpu_clock" field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_TASK_CLOCK
The task_clock perf event counter which can be used to
measure the count of task clock time by applications
running on the platform. It corresponds to the
"perf.task_clock" field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS
The page_faults perf event counter which can be used to
measure the count of page faults by applications running
on the platform. It corresponds to the "perf.page_faults"
field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_CONTEXT_SWITCHES
The context_switches perf event counter which can be used to
measure the count of context switches by applications running
on the platform. It corresponds to the "perf.context_switches"
field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_CPU_MIGRATIONS
The cpu_migrations perf event counter which can be used to
measure the count of cpu migrations by applications running
on the platform. It corresponds to the "perf.cpu_migrations"
field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MIN
The page_faults_min perf event counter which can be used to
measure the count of minor page faults by applications running
on the platform. It corresponds to the "perf.page_faults_min"
field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MAJ
The page_faults_maj perf event counter which can be used to
measure the count of major page faults by applications running
on the platform. It corresponds to the "perf.page_faults_maj"
field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_ALIGNMENT_FAULTS
The alignment_faults perf event counter which can be used to
measure the count of alignment faults by applications running
on the platform. It corresponds to the "perf.alignment_faults"
field in the *Stats APIs.

=item Sys::Virt::Domain::PERF_PARAM_EMULATION_FAULTS
The emulation_faults perf event counter which can be used to
measure the count of emulation faults by applications running
on the platform. It corresponds to the "perf.emulation_faults"
field in the *Stats APIs.

=back

=head2 IOTHREAD STATS

The following constants defined IOThread statistics which
can be monitored for a guest

=over 4

=item Sys::Virt::Domain::IOTHREAD_PARAM_POLL_MAX_NS

The maximum polling time that can be used by polling algorithm in ns.
The polling time starts at 0 (zero) and is the time spent by the guest
to process IOThread data before returning the CPU to the host. The
polling time will be dynamically modified over time based on the
poll_grow and poll_shrink parameters provided.

=item Sys::Virt::Domain::IOTHREAD_PARAM_POLL_GROW

This provides a value for the dynamic polling adjustment algorithm to
use to grow its polling interval up to the poll_max_ns value.

=item Sys::Virt::Domain::IOTHREAD_PARAM_POLL_SHRINK

This provides a value for the dynamic polling adjustment algorithm to
use to shrink its polling interval when the polling interval exceeds
the poll_max_ns value.

=back

=head2 VCPU FLAGS

The following constants are useful when getting/setting the
VCPU count for a guest

=over 4

=item Sys::Virt::Domain::VCPU_LIVE

Flag to request the live value

=item Sys::Virt::Domain::VCPU_CONFIG

Flag to request the persistent config value

=item Sys::Virt::Domain::VCPU_CURRENT

Flag to request the current config value

=item Sys::Virt::Domain::VCPU_MAXIMUM

Flag to request adjustment of the maximum vCPU value

=item Sys::Virt::Domain::VCPU_GUEST

Flag to request the guest VCPU mask

=item Sys::Virt::Domain::VCPU_HOTPLUGGABLE

Flag to make vcpus added hot(un)pluggable

=back

=head2 STATE CHANGE EVENTS

The following constants allow domain state change events to be
interpreted. The events contain both a state change, and a
reason.

=over 4

=item Sys::Virt::Domain::EVENT_DEFINED

Indicates that a persistent configuration has been defined for
the domain.

=over 4

=item Sys::Virt::Domain::EVENT_DEFINED_ADDED

The defined configuration is newly added

=item Sys::Virt::Domain::EVENT_DEFINED_UPDATED

The defined configuration is an update to an existing configuration

=item Sys::Virt::Domain::EVENT_DEFINED_RENAMED

The defined configuration is a rename of an existing configuration

=item Sys::Virt::Domain::EVENT_DEFINED_FROM_SNAPSHOT

The defined configuration was restored from a snapshot

=back

=item Sys::Virt::Domain::EVENT_RESUMED

The domain has resumed execution

=over 4

=item Sys::Virt::Domain::EVENT_RESUMED_MIGRATED

The domain resumed because migration has completed. This is
emitted on the destination host.

=item Sys::Virt::Domain::EVENT_RESUMED_UNPAUSED

The domain resumed because the admin unpaused it.

=item Sys::Virt::Domain::EVENT_RESUMED_FROM_SNAPSHOT

The domain resumed because it was restored from a snapshot

=item Sys::Virt::Domain::EVENT_RESUMED_POSTCOPY

The domain resumed but post-copy is running in background

=back

=item Sys::Virt::Domain::EVENT_STARTED

The domain has started running

=over 4

=item Sys::Virt::Domain::EVENT_STARTED_BOOTED

The domain was booted from shutoff state

=item Sys::Virt::Domain::EVENT_STARTED_MIGRATED

The domain started due to an incoming migration

=item Sys::Virt::Domain::EVENT_STARTED_RESTORED

The domain was restored from saved state file

=item Sys::Virt::Domain::EVENT_STARTED_FROM_SNAPSHOT

The domain was restored from a snapshot

=item Sys::Virt::Domain::EVENT_STARTED_WAKEUP

The domain was woken up from suspend

=back

=item Sys::Virt::Domain::EVENT_STOPPED

The domain has stopped running

=over 4

=item Sys::Virt::Domain::EVENT_STOPPED_CRASHED

The domain stopped because guest operating system has crashed

=item Sys::Virt::Domain::EVENT_STOPPED_DESTROYED

The domain stopped because administrator issued a destroy
command.

=item Sys::Virt::Domain::EVENT_STOPPED_FAILED

The domain stopped because of a fault in the host virtualization
environment.

=item Sys::Virt::Domain::EVENT_STOPPED_MIGRATED

The domain stopped because it was migrated to another machine.

=item Sys::Virt::Domain::EVENT_STOPPED_SAVED

The domain was saved to a state file

=item Sys::Virt::Domain::EVENT_STOPPED_SHUTDOWN

The domain stopped due to graceful shutdown of the guest.

=item Sys::Virt::Domain::EVENT_STOPPED_FROM_SNAPSHOT

The domain was stopped due to a snapshot

=back

=item Sys::Virt::Domain::EVENT_SHUTDOWN

The domain has shutdown but is not yet stopped

=over 4

=item Sys::Virt::Domain::EVENT_SHUTDOWN_FINISHED

The domain finished shutting down

=item Sys::Virt::Domain::EVENT_SHUTDOWN_HOST

The domain shutdown due to host trigger

=item Sys::Virt::Domain::EVENT_SHUTDOWN_GUEST

The domain shutdown due to guest trigger

=back

=item Sys::Virt::Domain::EVENT_SUSPENDED

The domain has stopped executing, but still exists

=over 4

=item Sys::Virt::Domain::EVENT_SUSPENDED_MIGRATED

The domain has been suspended due to offline migration

=item Sys::Virt::Domain::EVENT_SUSPENDED_PAUSED

The domain has been suspended due to administrator pause
request.

=item Sys::Virt::Domain::EVENT_SUSPENDED_IOERROR

The domain has been suspended due to a block device I/O
error.

=item Sys::Virt::Domain::EVENT_SUSPENDED_FROM_SNAPSHOT

The domain has been suspended due to resume from snapshot

=item Sys::Virt::Domain::EVENT_SUSPENDED_WATCHDOG

The domain has been suspended due to the watchdog triggering

=item Sys::Virt::Domain::EVENT_SUSPENDED_RESTORED

The domain has been suspended due to restore from saved state

=item Sys::Virt::Domain::EVENT_SUSPENDED_API_ERROR

The domain has been suspended due to an API error

=item Sys::Virt::Domain::EVENT_SUSPENDED_POSTCOPY

The domain has been suspended for post-copy migration

=item Sys::Virt::Domain::EVENT_SUSPENDED_POSTCOPY_FAILED

The domain has been suspended due post-copy migration failing

=back

=item Sys::Virt::Domain::EVENT_UNDEFINED

The persistent configuration has gone away

=over 4

=item Sys::Virt::Domain::EVENT_UNDEFINED_REMOVED

The domain configuration has gone away due to it being
removed by administrator.

=item Sys::Virt::Domain::EVENT_UNDEFINED_RENAMED

The undefined configuration is a rename of an existing configuration

=back

=item Sys::Virt::Domain::EVENT_PMSUSPENDED

The domain has stopped running

=over 4

=item Sys::Virt::Domain::EVENT_PMSUSPENDED_MEMORY

The domain has suspend to RAM.

=item Sys::Virt::Domain::EVENT_PMSUSPENDED_DISK

The domain has suspend to Disk.

=back

=item Sys::Virt::Domain::EVENT_CRASHED

The domain has crashed

=over 4

=item Sys::Virt::Domain::EVENT_CRASHED_PANICKED

The domain has crashed due to a kernel panic

=back

=back

=head2 EVENT ID CONSTANTS

=over 4

=item Sys::Virt::Domain::EVENT_ID_LIFECYCLE

Domain lifecycle events

=item Sys::Virt::Domain::EVENT_ID_REBOOT

Soft / warm reboot events

=item Sys::Virt::Domain::EVENT_ID_RTC_CHANGE

RTC clock adjustments

=item Sys::Virt::Domain::EVENT_ID_IO_ERROR

File IO errors, typically from disks

=item Sys::Virt::Domain::EVENT_ID_WATCHDOG

Watchdog device triggering

=item Sys::Virt::Domain::EVENT_ID_GRAPHICS

Graphics client connections.

=item Sys::Virt::Domain::EVENT_ID_IO_ERROR_REASON

File IO errors, typically from disks, with a root cause

=item Sys::Virt::Domain::EVENT_ID_CONTROL_ERROR

Errors from the virtualization control channel

=item Sys::Virt::Domain::EVENT_ID_BLOCK_JOB

Completion status of asynchronous block jobs,
identified by source file name.

=item Sys::Virt::Domain::EVENT_ID_BLOCK_JOB_2

Completion status of asynchronous block jobs,
identified by target device name.

=item Sys::Virt::Domain::EVENT_ID_DISK_CHANGE

Changes in disk media

=item Sys::Virt::Domain::EVENT_ID_TRAY_CHANGE

CDROM media tray state

=item Sys::Virt::Domain::EVENT_ID_PMSUSPEND

Power management initiated suspend to RAM

=item Sys::Virt::Domain::EVENT_ID_PMSUSPEND_DISK

Power management initiated suspend to Disk

=item Sys::Virt::Domain::EVENT_ID_PMWAKEUP

Power management initiated wakeup

=item Sys::Virt::Domain::EVENT_ID_BALLOON_CHANGE

Balloon target changes

=item Sys::Virt::Domain::EVENT_ID_DEVICE_ADDED

Asynchronous guest device addition

=item Sys::Virt::Domain::EVENT_ID_DEVICE_REMOVED

Asynchronous guest device removal

=item Sys::Virt::Domain::EVENT_ID_TUNABLE

Changes of any domain tuning parameters. The callback
will be provided with a hash listing all changed parameters.
The later DOMAIN TUNABLE constants can be useful when accessing
the hash keys

=item Sys::Virt::Domain::EVENT_ID_AGENT_LIFECYCLE

Domain guest agent lifecycle events. The C<state> parameter
to the callback will match one of the constants

=over 4

=item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_STATE_CONNECTED

The agent is now connected

=item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED

The agent is now disconnected

=back

The second parameter, C<reason>, matches one of the following
constants

=item Sys::Virt::Domain::EVENT_ID_MIGRATION_ITERATION

Domain migration progress iteration. The C<iteration> parameter
to the callback will specify the number of iterations migration
has made over guest RAM.

=over 4

=item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN

The reason is unknown

=item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED

The domain was initially booted

=item Sys::Virt::Domain::EVENT_AGENT_LIFECYCLE_REASON_CHANNEL

The channel on a running guest changed state

=back

=item Sys::Virt::Domain::EVENT_ID_JOB_COMPLETED

Domain background job completion notification. The callback
provides a hash containing the job stats. The keyus in the
hash are the same as those used with the C<Sys::Virt::Domain::get_job_stats()>
method.

=item Sys::Virt::Domain::EVENT_ID_DEVICE_REMOVAL_FAILED

Guest device removal has failed.

=item Sys::Virt::Domain::EVENT_ID_METADATA_CHANGE

The domain metadata has changed

=item Sys::Virt::Domain::EVENT_ID_BLOCK_THRESHOLD

The event occurs when the hypervisor detects that the given
storage element was written beyond the point specified by
threshold. The event is useful for thin-provisioned storage.

=back

=head2 IO ERROR EVENT CONSTANTS

These constants describe what action was taken due to the
IO error.

=over 4

=item Sys::Virt::Domain::EVENT_IO_ERROR_NONE

No action was taken, the error was ignored & reported as success to guest

=item Sys::Virt::Domain::EVENT_IO_ERROR_PAUSE

The guest is paused since the error occurred

=item Sys::Virt::Domain::EVENT_IO_ERROR_REPORT

The error has been reported to the guest OS

=back

=head2 WATCHDOG EVENT CONSTANTS

These constants describe what action was taken due to the
watchdog firing

=over 4

=item Sys::Virt::Domain::EVENT_WATCHDOG_NONE

No action was taken, the watchdog was ignored

=item Sys::Virt::Domain::EVENT_WATCHDOG_PAUSE

The guest is paused since the watchdog fired

=item Sys::Virt::Domain::EVENT_WATCHDOG_POWEROFF

The guest is powered off after the watchdog fired

=item Sys::Virt::Domain::EVENT_WATCHDOG_RESET

The guest is reset after the watchdog fired

=item Sys::Virt::Domain::EVENT_WATCHDOG_SHUTDOWN

The guest attempted to gracefully shutdown after the watchdog fired

=item Sys::Virt::Domain::EVENT_WATCHDOG_DEBUG

No action was taken, the watchdog was logged

=item Sys::Virt::Domain::EVENT_WATCHDOG_INJECTNMI

An NMI was injected into the guest after the watchdog fired

=back

=head2 GRAPHICS EVENT PHASE CONSTANTS

These constants describe the phase of the graphics connection

=over 4

=item Sys::Virt::Domain::EVENT_GRAPHICS_CONNECT

The initial client connection

=item Sys::Virt::Domain::EVENT_GRAPHICS_INITIALIZE

The client has been authenticated & the connection is running

=item Sys::Virt::Domain::EVENT_GRAPHICS_DISCONNECT

The client has disconnected

=back

=head2 GRAPHICS EVENT ADDRESS CONSTANTS

These constants describe the format of the address

=over 4

=item Sys::Virt::Domain::EVENT_GRAPHICS_ADDRESS_IPV4

An IPv4 address

=item Sys::Virt::Domain::EVENT_GRAPHICS_ADDRESS_IPV6

An IPv6 address

=item Sys::Virt::Domain::EVENT_GRAPHICS_ADDRESS_UNIX

An UNIX socket path address

=back

=head2 DISK CHANGE EVENT CONSTANTS

These constants describe the reason for a disk change event

=over 4

=item Sys::Virt::Domain::EVENT_DISK_CHANGE_MISSING_ON_START

The disk media was cleared, as its source was missing when attempting to start the guest

=item Sys::Virt::Domain::EVENT_DISK_DROP_MISSING_ON_START

The disk device was dropped, as its source was missing when  attempting to start the guest

=back

=head2 TRAY CHANGE CONSTANTS

These constants describe the reason for a tray change event

=over 4

=item Sys::Virt::Domain::EVENT_TRAY_CHANGE_CLOSE

The tray was closed

=item Sys::Virt::Domain::EVENT_TRAY_CHANGE_OPEN

The tray was opened

=back

=head2 DOMAIN BLOCK JOB TYPE CONSTANTS

The following constants identify the different types of domain
block jobs

=over 4

=item Sys::Virt::Domain::BLOCK_JOB_TYPE_UNKNOWN

An unknown block job type

=item Sys::Virt::Domain::BLOCK_JOB_TYPE_PULL

The block pull job type

=item Sys::Virt::Domain::BLOCK_JOB_TYPE_COPY

The block copy job type

=item Sys::Virt::Domain::BLOCK_JOB_TYPE_COMMIT

The block commit job type

=item Sys::Virt::Domain::BLOCK_JOB_TYPE_ACTIVE_COMMIT

The block active commit job type

=back

=head2 DOMAIN BLOCK JOB COMPLETION CONSTANTS

The following constants can be used to determine the completion
status of a block job

=over 4

=item Sys::Virt::Domain::BLOCK_JOB_COMPLETED

A successfully completed block job

=item Sys::Virt::Domain::BLOCK_JOB_FAILED

An unsuccessful block job

=item Sys::Virt::Domain::BLOCK_JOB_CANCELED

A block job canceled byy the user

=item Sys::Virt::Domain::BLOCK_JOB_READY

A block job is running

=back

=head2 DOMAIN BLOCK REBASE CONSTANTS

The following constants are useful when rebasing block devices

=over 4

=item Sys::Virt::Domain::BLOCK_REBASE_SHALLOW

Limit copy to top of source backing chain

=item Sys::Virt::Domain::BLOCK_REBASE_REUSE_EXT

Reuse existing external file for copy

=item Sys::Virt::Domain::BLOCK_REBASE_COPY_RAW

Make destination file raw

=item Sys::Virt::Domain::BLOCK_REBASE_COPY

Start a copy job

=item Sys::Virt::Domain::BLOCK_REBASE_COPY_DEV

Treat destination as a block device instead of file

=item Sys::Virt::Domain::BLOCK_REBASE_RELATIVE

Keep backing chain referenced using relative names

=back

=head2 DOMAIN BLOCK COPY CONSTANTS

The following constants are useful when copying block devices

=over 4

=item Sys::Virt::Domain::BLOCK_COPY_SHALLOW

Limit copy to top of source backing chain

=item Sys::Virt::Domain::BLOCK_COPY_REUSE_EXT

Reuse existing external file for copy

=item Sys::Virt::Domain::BLOCK_COPY_TRANSIENT_JOB

Don't force usage of recoverable job for the copy operation

=back

=head2 DOMAIN BLOCK JOB ABORT CONSTANTS

The following constants are useful when aborting job copy jobs

=over 4

=item Sys::Virt::Domain::BLOCK_JOB_ABORT_ASYNC

Request only, do not wait for completion

=item Sys::Virt::Domain::BLOCK_JOB_ABORT_PIVOT

Pivot to mirror when ending a copy job

=back

=head2 DOMAIN BLOCK COMMIT JOB CONSTANTS

The following constants are useful with block commit job types

=over 4

=item Sys::Virt::Domain::BLOCK_COMMIT_DELETE

Delete any files that are invalid after commit

=item Sys::Virt::Domain::BLOCK_COMMIT_SHALLOW

NULL base means next backing file, not whole chain

=item Sys::Virt::Domain::BLOCK_COMMIT_ACTIVE

Allow two phase commit when top is active layer

=item Sys::Virt::Domain::BLOCK_COMMIT_RELATIVE

Keep backing chain referenced using relative names

=back

=head2 DOMAIN SAVE / RESTORE CONSTANTS

The following constants can be used when saving or restoring
virtual machines

=over 4

=item Sys::Virt::Domain::SAVE_BYPASS_CACHE

Do not use OS I/O cache when saving state.

=item Sys::Virt::Domain::SAVE_PAUSED

Mark the saved state as paused to prevent the guest CPUs
starting upon restore.

=item Sys::Virt::Domain::SAVE_RUNNING

Mark the saved state as running to allow the guest CPUs
to start upon restore.

=back

=head2 DOMAIN CORE DUMP CONSTANTS

The following constants can be used when triggering domain
core dumps

=over 4

=item Sys::Virt::Domain::DUMP_LIVE

Do not pause execution while dumping the guest

=item Sys::Virt::Domain::DUMP_CRASH

Crash the guest after completing the core dump

=item Sys::Virt::Domain::DUMP_BYPASS_CACHE

Do not use OS I/O cache when writing core dump

=item Sys::Virt::Domain::DUMP_RESET

Reset the virtual machine after finishing the dump

=item Sys::Virt::Domain::DUMP_MEMORY_ONLY

Only include guest RAM in the dump, not the device
state

=back

=head2 DESTROY CONSTANTS

The following constants are useful when terminating guests
using the C<destroy> API.

=over 4

=item Sys::Virt::Domain::DESTROY_DEFAULT

Destroy the guest using the default approach

=item Sys::Virt::Domain::DESTROY_GRACEFUL

Destroy the guest in a graceful manner

=back

=head2 SHUTDOWN CONSTANTS

The following constants are useful when requesting that a
guest terminate using the C<shutdown> API

=over 4

=item Sys::Virt::Domain::SHUTDOWN_DEFAULT

Shutdown using the hypervisor's default mechanism

=item Sys::Virt::Domain::SHUTDOWN_GUEST_AGENT

Shutdown by issuing a command to a guest agent

=item Sys::Virt::Domain::SHUTDOWN_ACPI_POWER_BTN

Shutdown by injecting an ACPI power button press

=item Sys::Virt::Domain::SHUTDOWN_INITCTL

Shutdown by talking to initctl (containers only)

=item Sys::Virt::Domain::SHUTDOWN_SIGNAL

Shutdown by sending SIGTERM to the init process

=item Sys::Virt::Domain::SHUTDOWN_PARAVIRT

Shutdown by issuing a paravirt power control command

=back

=head2 REBOOT CONSTANTS

The following constants are useful when requesting that a
guest terminate using the C<reboot> API

=over 4

=item Sys::Virt::Domain::REBOOT_DEFAULT

Reboot using the hypervisor's default mechanism

=item Sys::Virt::Domain::REBOOT_GUEST_AGENT

Reboot by issuing a command to a guest agent

=item Sys::Virt::Domain::REBOOT_ACPI_POWER_BTN

Reboot by injecting an ACPI power button press

=item Sys::Virt::Domain::REBOOT_INITCTL

Reboot by talking to initctl (containers only)

=item Sys::Virt::Domain::REBOOT_SIGNAL

Reboot by sending SIGHUP to the init process

=item Sys::Virt::Domain::REBOOT_PARAVIRT

Reboot by issuing a paravirt power control command

=back

=head2 METADATA CONSTANTS

The following constants are useful when reading/writing
metadata about a guest

=over 4

=item Sys::Virt::Domain::METADATA_TITLE

The short human friendly title of the guest

=item Sys::Virt::Domain::METADATA_DESCRIPTION

The long free text description of the guest

=item Sys::Virt::Domain::METADATA_ELEMENT

The structured metadata elements for the guest

=back

=head2 DISK ERROR CONSTANTS

The following constants are useful when interpreting
disk error codes

=over 4

=item Sys::Virt::Domain::DISK_ERROR_NONE

No error

=item Sys::Virt::Domain::DISK_ERROR_NO_SPACE

The host storage has run out of free space

=item Sys::Virt::Domain::DISK_ERROR_UNSPEC

An unspecified error has occurred.

=back

=head2 MEMORY STATISTIC CONSTANTS

=over 4

=item Sys::Virt::Domain::MEMORY_STAT_SWAP_IN

Swap in

=item Sys::Virt::Domain::MEMORY_STAT_SWAP_OUT

Swap out

=item Sys::Virt::Domain::MEMORY_STAT_MINOR_FAULT

Minor faults

=item Sys::Virt::Domain::MEMORY_STAT_MAJOR_FAULT

Major faults

=item Sys::Virt::Domain::MEMORY_STAT_RSS

Resident memory

=item Sys::Virt::Domain::MEMORY_STAT_UNUSED

Unused memory

=item Sys::Virt::Domain::MEMORY_STAT_AVAILABLE

Available memory

=item Sys::Virt::Domain::MEMORY_STAT_ACTUAL_BALLOON

Actual balloon limit

=item Sys::Virt::Domain::MEMORY_STAT_USABLE

Amount of usable memory

=item Sys::Virt::Domain::MEMORY_STAT_LAST_UPDATE

Time of last stats refresh from guest

=item Sys::Virt::Domain::MEMORY_STAT_DISK_CACHES

Disk cache size

=back

=head2 DOMAIN LIST CONSTANTS

The following constants can be used when listing domains

=over 4

=item Sys::Virt::Domain::LIST_ACTIVE

Only list domains that are currently active (running, or paused)

=item Sys::Virt::Domain::LIST_AUTOSTART

Only list domains that are set to automatically start on boot

=item Sys::Virt::Domain::LIST_HAS_SNAPSHOT

Only list domains that have a stored snapshot

=item Sys::Virt::Domain::LIST_INACTIVE

Only list domains that are currently inactive (shutoff, saved)

=item Sys::Virt::Domain::LIST_MANAGEDSAVE

Only list domains that have current managed save state

=item Sys::Virt::Domain::LIST_NO_AUTOSTART

Only list domains that are not set to automatically start on boto

=item Sys::Virt::Domain::LIST_NO_MANAGEDSAVE

Only list domains that do not have any managed save state

=item Sys::Virt::Domain::LIST_NO_SNAPSHOT

Only list domains that do not have a stored snapshot

=item Sys::Virt::Domain::LIST_OTHER

Only list domains that are not running, paused or shutoff

=item Sys::Virt::Domain::LIST_PAUSED

Only list domains that are paused

=item Sys::Virt::Domain::LIST_PERSISTENT

Only list domains which have a persistent config

=item Sys::Virt::Domain::LIST_RUNNING

Only list domains that are currently running

=item Sys::Virt::Domain::LIST_SHUTOFF

Only list domains that are currently shutoff

=item Sys::Virt::Domain::LIST_TRANSIENT

Only list domains that do not have a persistent config

=back

=head2 SEND KEY CONSTANTS

The following constants are to be used with the C<send_key>
API

=over 4

=item Sys::Virt::Domain::SEND_KEY_MAX_KEYS

The maximum number of keys that can be sent in a single
call to C<send_key>

=back

=head2 BLOCK STATS CONSTANTS

The following constants provide the names of well known
block stats fields

=over 4

=item Sys::Virt::Domain::BLOCK_STATS_ERRS

The number of I/O errors

=item Sys::Virt::Domain::BLOCK_STATS_FLUSH_REQ

The number of flush requests

=item Sys::Virt::Domain::BLOCK_STATS_FLUSH_TOTAL_TIMES

The time spent processing flush requests

=item Sys::Virt::Domain::BLOCK_STATS_READ_BYTES

The amount of data read

=item Sys::Virt::Domain::BLOCK_STATS_READ_REQ

The number of read requests

=item Sys::Virt::Domain::BLOCK_STATS_READ_TOTAL_TIMES

The time spent processing read requests

=item Sys::Virt::Domain::BLOCK_STATS_WRITE_BYTES

The amount of data written

=item Sys::Virt::Domain::BLOCK_STATS_WRITE_REQ

The number of write requests

=item Sys::Virt::Domain::BLOCK_STATS_WRITE_TOTAL_TIMES

The time spent processing write requests

=back

=head2 CPU STATS CONSTANTS

The following constants provide the names of well known
cpu stats fields

=over 4

=item Sys::Virt::Domain::CPU_STATS_CPUTIME

The total CPU time, including both hypervisor and
vCPU time.

=item Sys::Virt::Domain::CPU_STATS_USERTIME

THe total time in kernel

=item Sys::Virt::Domain::CPU_STATS_SYSTEMTIME

The total time in userspace

=item Sys::Virt::Domain::CPU_STATS_VCPUTIME

The total vCPU time.

=back

=head2 CPU STATS CONSTANTS

The following constants provide the names of well known
schedular parameters

=over 4

=item Sys::Virt::SCHEDULER_EMULATOR_PERIOD

The duration of the time period for scheduling the emulator

=item Sys::Virt::SCHEDULER_EMULATOR_QUOTA

The quota for the emulator in one schedular time period

=item Sys::Virt::SCHEDULER_IOTHREAD_PERIOD

The duration of the time period for scheduling the iothread

=item Sys::Virt::SCHEDULER_IOTHREAD_QUOTA

The quota for the iothread in one schedular time period

=back

=head2 DOMAIN STATS FLAG CONSTANTS

The following constants are used as flags when requesting
bulk domain stats from C<Sys::Virt::get_all_domain_stats>.

=over 4

=item Sys::Virt::Domain::GET_ALL_STATS_ACTIVE

Include stats for active domains

=item Sys::Virt::Domain::GET_ALL_STATS_INACTIVE

Include stats for inactive domains

=item Sys::Virt::Domain::GET_ALL_STATS_OTHER

Include stats for other domains

=item Sys::Virt::Domain::GET_ALL_STATS_PAUSED

Include stats for paused domains

=item Sys::Virt::Domain::GET_ALL_STATS_PERSISTENT

Include stats for persistent domains

=item Sys::Virt::Domain::GET_ALL_STATS_RUNNING

Include stats for running domains

=item Sys::Virt::Domain::GET_ALL_STATS_SHUTOFF

Include stats for shutoff domains

=item Sys::Virt::Domain::GET_ALL_STATS_TRANSIENT

Include stats for transient domains

=item Sys::Virt::Domain::GET_ALL_STATS_ENFORCE_STATS

Require that all requested stats fields are returned

=item Sys::Virt::Domain::GET_ALL_STATS_BACKING

Get stats for image backing files too

=item Sys::Virt::Domain::GET_ALL_STATS_NOWAIT

Skip stats if they can't be acquired without waiting

=back

=head2 DOMAIN STATS FIELD CONSTANTS

The following constants are used to control which fields
are returned for stats queries.

=over

=item Sys::Virt::Domain::STATS_BALLOON

Balloon statistics

=item Sys::Virt::Domain::STATS_BLOCK

Block device info

=item Sys::Virt::Domain::STATS_CPU_TOTAL

CPU usage info

=item Sys::Virt::Domain::STATS_INTERFACE

Network interface info

=item Sys::Virt::Domain::STATS_STATE

General lifecycle state

=item Sys::Virt::Domain::STATS_VCPU

Virtual CPU info

=item Sys::Virt::Domain::STATS_PERF

Performance event counter values

=item Sys::Virt::Domain::STATS_IOTHREAD

IOThread performance statistics values

=back

=head2 PROCESS SIGNALS

The following constants provide the names of signals
which can be sent to guest processes. They mostly
correspond to POSIX signal names.

=over 4

=item Sys::Virt::Domain::PROCESS_SIGNAL_NOP

SIGNOP

=item Sys::Virt::Domain::PROCESS_SIGNAL_HUP

SIGHUP

=item Sys::Virt::Domain::PROCESS_SIGNAL_INT

SIGINT

=item Sys::Virt::Domain::PROCESS_SIGNAL_QUIT

SIGQUIT

=item Sys::Virt::Domain::PROCESS_SIGNAL_ILL

SIGILL

=item Sys::Virt::Domain::PROCESS_SIGNAL_TRAP

SIGTRAP

=item Sys::Virt::Domain::PROCESS_SIGNAL_ABRT

SIGABRT

=item Sys::Virt::Domain::PROCESS_SIGNAL_BUS

SIGBUS

=item Sys::Virt::Domain::PROCESS_SIGNAL_FPE

SIGFPE

=item Sys::Virt::Domain::PROCESS_SIGNAL_KILL

SIGKILL

=item Sys::Virt::Domain::PROCESS_SIGNAL_USR1

SIGUSR1

=item Sys::Virt::Domain::PROCESS_SIGNAL_SEGV

SIGSEGV

=item Sys::Virt::Domain::PROCESS_SIGNAL_USR2

SIGUSR2

=item Sys::Virt::Domain::PROCESS_SIGNAL_PIPE

SIGPIPE

=item Sys::Virt::Domain::PROCESS_SIGNAL_ALRM

SIGALRM

=item Sys::Virt::Domain::PROCESS_SIGNAL_TERM

SIGTERM

=item Sys::Virt::Domain::PROCESS_SIGNAL_STKFLT

SIGSTKFLT

=item Sys::Virt::Domain::PROCESS_SIGNAL_CHLD

SIGCHLD

=item Sys::Virt::Domain::PROCESS_SIGNAL_CONT

SIGCONT

=item Sys::Virt::Domain::PROCESS_SIGNAL_STOP

SIGSTOP

=item Sys::Virt::Domain::PROCESS_SIGNAL_TSTP

SIGTSTP

=item Sys::Virt::Domain::PROCESS_SIGNAL_TTIN

SIGTTIN

=item Sys::Virt::Domain::PROCESS_SIGNAL_TTOU

SIGTTOU

=item Sys::Virt::Domain::PROCESS_SIGNAL_URG

SIGURG

=item Sys::Virt::Domain::PROCESS_SIGNAL_XCPU

SIGXCPU

=item Sys::Virt::Domain::PROCESS_SIGNAL_XFSZ

SIGXFSZ

=item Sys::Virt::Domain::PROCESS_SIGNAL_VTALRM

SIGVTALRM

=item Sys::Virt::Domain::PROCESS_SIGNAL_PROF

SIGPROF

=item Sys::Virt::Domain::PROCESS_SIGNAL_WINCH

SIGWINCH

=item Sys::Virt::Domain::PROCESS_SIGNAL_POLL

SIGPOLL

=item Sys::Virt::Domain::PROCESS_SIGNAL_PWR

SIGPWR

=item Sys::Virt::Domain::PROCESS_SIGNAL_SYS

SIGSYS

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT0

SIGRT0

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT1

SIGRT1

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT2

SIGRT2

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT3

SIGRT3

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT4

SIGRT4

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT5

SIGRT5

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT6

SIGRT6

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT7

SIGRT7

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT8

SIGRT8

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT9

SIGRT9

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT10

SIGRT10

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT11

SIGRT11

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT12

SIGRT12

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT13

SIGRT13

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT14

SIGRT14

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT15

SIGRT15

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT16

SIGRT16

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT17

SIGRT17

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT18

SIGRT18

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT19

SIGRT19

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT20

SIGRT20

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT21

SIGRT21

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT22

SIGRT22

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT23

SIGRT23

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT24

SIGRT24

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT25

SIGRT25

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT26

SIGRT26

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT27

SIGRT27

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT28

SIGRT28

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT29

SIGRT29

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT30

SIGRT30

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT31

SIGRT31

=item Sys::Virt::Domain::PROCESS_SIGNAL_RT32

SIGRT32

=back

=head2 DOMAIN TUNABLE CONSTANTS

The following constants are useful when accessing domain
tuning parameters in APIs and events

=over 4

=item Sys::Virt::Domain::TUNABLE_CPU_CPU_SHARES

Proportional CPU weight

=item Sys::Virt::Domain::TUNABLE_CPU_EMULATORPIN

Emulator thread CPU pinning mask

=item Sys::Virt::Domain::TUNABLE_CPU_EMULATOR_PERIOD

Emulator thread CPU period

=item Sys::Virt::Domain::TUNABLE_CPU_EMULATOR_QUOTA

Emulator thread CPU quota

=item Sys::Virt::Domain::TUNABLE_CPU_IOTHREAD_PERIOD

Iothread thread CPU period

=item Sys::Virt::Domain::TUNABLE_CPU_IOTHREAD_QUOTA

Iothread thread CPU quota

=item Sys::Virt::Domain::TUNABLE_CPU_VCPUPIN

VCPU thread pinning mask

=item Sys::Virt::Domain::TUNABLE_CPU_VCPU_PERIOD

VCPU thread period

=item Sys::Virt::Domain::TUNABLE_CPU_VCPU_QUOTA

VCPU thread quota

=item Sys::Virt::Domain::TUNABLE_CPU_GLOBAL_PERIOD

VM global period

=item Sys::Virt::Domain::TUNABLE_CPU_GLOBAL_QUOTA

VM global quota

=item Sys::Virt::Domain::TUNABLE_BLKDEV_DISK

The name of guest disks

=item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_BYTES_SEC

Read throughput in bytes per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_IOPS_SEC

Read throughput in I/O operations per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_BYTES_SEC

Total throughput in bytes per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_IOPS_SEC

Total throughput in I/O operations per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_BYTES_SEC

Write throughput in bytes per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_IOPS_SEC

Write throughput in I/O operations per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_BYTES_SEC_MAX

Maximum read throughput in bytes per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_IOPS_SEC_MAX

Maximum read throughput in I/O operations per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX

Maximum total throughput in bytes per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX

Maximum total throughput in I/O operations per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX

Maximum write throughput in bytes per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX

Maximum write throughput in I/O operations per sec

=item Sys::Virt::Domain::TUNABLE_BLKDEV_SIZE_IOPS_SEC

The maximum I/O operations per second

=item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH

The duration in seconds allowed for maximum total bytes processed per second.

=item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH

The duration in seconds allowed for maximum bytes read per second.

=item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH

The duration in seconds allowed for maximum bytes written per second.

=item Sys::Virt::Domain::TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH

The duration in seconds allowed for maximum total I/O operations processed
per second.

=item Sys::Virt::Domain::TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH

The duration in seconds allowed for maximum I/O operations read per second.

=item Sys::Virt::Domain::TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH

The duration in seconds allowed for maximum I/O operations written per second.

=item Sys::Virt::Domain::TUNABLE_BLKDEV_GROUP_NAME

The name of the blkdev group

=item Sys::Virt::Domain::TUNABLE_IOTHREADSPIN

The I/O threads pinning

=back

=head2 DOMAIN LIFECYCLE CONSTANTS

The following constants are useful when setting action for
lifecycle events.

=over 4

=item Sys::Virt::Domain::LIFECYCLE_POWEROFF

The poweroff lifecycle event type

=item Sys::Virt::Domain::LIFECYCLE_REBOOT

The reboot lifecycle event type

=item Sys::Virt::Domain::LIFECYCLE_CRASH

The crash lifecycle event type

=back

=head2 DOMAIN LIFECYCLE ACTION CONSTANTS

=over 4

=item Sys::Virt::Domain::LIFECYCLE_ACTION_DESTROY

The destroy lifecycle action

=item Sys::Virt::Domain::LIFECYCLE_ACTION_RESTART

The restart lifecycle action

=item Sys::Virt::Domain::LIFECYCLE_ACTION_RESTART_RENAME

The restart-rename lifecycle action

=item Sys::Virt::Domain::LIFECYCLE_ACTION_PRESERVE

The preserve lifecycle action

=item Sys::Virt::Domain::LIFECYCLE_ACTION_COREDUMP_DESTROY

The coredump-destroy lifecycle action

=item Sys::Virt::Domain::LIFECYCLE_ACTION_COREDUMP_RESTART

The coredump-restart lifecycle action

=back

=head1 AUTHORS

Daniel P. Berrange <berrange@redhat.com>

=head1 COPYRIGHT

Copyright (C) 2006 Red Hat
Copyright (C) 2006-2007 Daniel P. Berrange

=head1 LICENSE

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

=head1 SEE ALSO

L<Sys::Virt>, L<Sys::Virt::Error>, C<http://libvirt.org>

=cut