summaryrefslogblamecommitdiffstats
path: root/src/main/resources/libvirt/rng/domaincommon.rng
blob: a2e5c50c1d778d6995f172dc57706a70a8836a0c (plain) (tree)
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
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
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
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
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
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370















































































                                                                                                                  


                                       






































































































































































































                                                                           
















                                                









































































































































































































































































































































































































































































































































































































































































































































































































































                                                                        
                                            































                                              
                                          

























































































                                           
                                       






















































































































































































































                                                                           


                          




























































































































































































































                                                                         
                                       





























































































































































































































































































































































































































































































































                                                                                                  

















                                     





































                                                                               




                                        





































































































































































































                                                           


                            






























































































































































































































































































































                                                                             

                      


                                          






                                         




























































                                            
                    



                                   
                     


































                                          


                                    


                               


                              


































































































                                                     











                                          













































































































































































































































































































































































































































































































































































                                                                            


                          
































                                                                
                             


































                                                                           




















                                       












































































                                                                            




                                               




























                                            









                                        













































































































































































































































































































                                                                  



























                                          
                                     











                                       
                          


                                       
                            


















                                             

                                         


                                      

                                         















































































                                                                    







































































































                                                                               


                          



























































































































































































































































                                                    


                            














                                 



































































































































































                                      




                           













































































                                            
                        



                                        
                        











































































































                                             



























                                     


                          




































































                                               


                            































                                                


                            













































































                                           


                            











































                                                                         


                          


























                                          


                          





























































































                                                       







                                       

































































































                                                    


                            














                               


                            


















                                           


                            






























                                       


                            












































































                                        


                             

























































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                               









                                   





                               
                                    






























                                        


                            



























































































                                                


                            













































































































































































































































































































































































































































































































































































































































































































































                                                                                 












                                                                                
















































































































                                                                                     
                                                       


















































































































































                                                                                       


                            


















































































































































                                                                     
<?xml version="1.0"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <!-- domain-related definitions used in multiple grammars -->
  <include href="basictypes.rng"/>
  <include href="storagecommon.rng"/>
  <include href="networkcommon.rng"/>
  <include href="cputypes.rng"/>
  <include href="nwfilter_params.rng"/>

  <!--
    description and title element, may be placed anywhere under the root
    -->
  <define name="description">
    <element name="description">
      <text/>
    </element>
  </define>

  <define name="title">
    <element name="title">
      <ref name="objectNameWithSlash"/>
    </element>
  </define>

  <define name="createMode">
    <data type="unsignedInt">
      <param name="pattern">0[0-7]{3}|[0-7]{1,3}</param>
    </data>
  </define>

  <!--
      We handle only document defining a domain
    -->
  <define name="domain">
    <element name="domain">
      <ref name="hvs"/>
      <interleave>
        <ref name="ids"/>
        <optional>
          <ref name="title"/>
        </optional>
        <optional>
          <ref name="description"/>
        </optional>
        <optional>
          <ref name="metadata"/>
        </optional>
        <optional>
          <ref name="guestcpu"/>
        </optional>
        <zeroOrMore>
          <ref name="sysinfo"/>
        </zeroOrMore>
        <ref name="os"/>
        <ref name="clock"/>
        <ref name="resources"/>
        <ref name="features"/>
        <ref name="events"/>
        <optional>
          <ref name="pm"/>
        </optional>
        <optional>
          <ref name="perf"/>
        </optional>
        <optional>
          <ref name="idmap"/>
        </optional>
        <optional>
          <ref name="devices"/>
        </optional>
        <zeroOrMore>
          <ref name="seclabel"/>
        </zeroOrMore>
        <optional>
          <ref name="qemucmdline"/>
        </optional>
        <optional>
          <ref name="qemucapabilities"/>
        </optional>
        <optional>
          <ref name="qemudeprecation"/>
        </optional>
        <optional>
          <ref name="lxcsharens"/>
        </optional>
        <optional>
          <ref name="keywrap"/>
        </optional>
        <optional>
          <ref name="launchSecurity"/>
        </optional>
        <optional>
          <ref name="bhyvecmdline"/>
        </optional>
        <optional>
          <ref name="xencmdline"/>
        </optional>
        <optional>
          <ref name="vmwaredatacenterpath"/>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="seclabel">
    <element name="seclabel">
      <optional>
        <attribute name="model">
          <text/>
        </attribute>
      </optional>
      <choice>
        <group>
          <!-- with dynamic label (default), relabel must be yes, baselabel
               is optional, and label and imagelabel are output-only -->
          <optional>
            <attribute name="type">
              <value>dynamic</value>
            </attribute>
          </optional>
          <optional>
            <attribute name="relabel">
              <value>yes</value>
            </attribute>
          </optional>
          <interleave>
            <optional>
              <element name="label">
                <text/>
              </element>
            </optional>
            <optional>
              <element name="imagelabel">
                <text/>
              </element>
            </optional>
            <optional>
              <element name="baselabel">
                <text/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <!-- with static label, relabel can be either format (default
               no), label is required, imagelabel is output-only, and no
               baselabel is present -->
          <attribute name="type">
            <value>static</value>
          </attribute>
          <optional>
            <attribute name="relabel">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <interleave>
            <element name="label">
              <text/>
            </element>
            <optional>
              <element name="imagelabel">
                <text/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <!-- with none, relabel must be no if present -->
          <attribute name="type">
            <value>none</value>
          </attribute>
          <optional>
            <attribute name="relabel">
              <value>no</value>
            </attribute>
          </optional>
        </group>
      </choice>
    </element>
  </define>
  <define name="devSeclabel">
    <element name="seclabel">
      <!-- A per-device seclabel override is more limited, either
           relabel=no or a <label> must be present on input;
           output also can include labelskip=yes.  -->
      <optional>
        <attribute name="model">
          <text/>
        </attribute>
      </optional>
      <choice>
        <group>
          <attribute name="relabel">
            <value>no</value>
          </attribute>
        </group>
        <group>
          <attribute name="labelskip">
            <value>yes</value>
          </attribute>
        </group>
        <group>
          <optional>
            <attribute name="relabel">
              <value>yes</value>
            </attribute>
          </optional>
          <oneOrMore>
            <element name="label">
              <text/>
            </element>
          </oneOrMore>
        </group>
      </choice>
    </element>
  </define>
  <define name="hvs">
    <attribute name="type">
      <choice>
        <value>qemu</value>
        <value>kqemu</value>
        <value>kvm</value>
        <value>xen</value>
        <value>lxc</value>
        <value>uml</value> <!-- NOT USED ANYMORE -->
        <value>openvz</value>
        <value>test</value>
        <value>vmware</value>
        <value>hyperv</value>
        <value>vbox</value>
        <value>phyp</value> <!-- NOT USED ANYMORE -->
        <value>vz</value>
        <value>bhyve</value>
      </choice>
    </attribute>
  </define>
  <define name="os">
    <choice>
      <ref name="osxen"/>
      <ref name="oshvm"/>
      <ref name="osexe"/>
    </choice>
  </define>
  <define name="osxen">
    <choice>
      <group>
        <optional>
          <ref name="bootloader"/>
        </optional>
        <element name="os">
          <ref name="ostypexen"/>
          <ref name="osbootkernel"/>
        </element>
      </group>
      <group>
        <ref name="bootloader"/>
        <optional>
          <element name="os">
            <ref name="ostypexen"/>
            <optional>
              <ref name="osbootkernel"/>
            </optional>
          </element>
        </optional>
      </group>
    </choice>
  </define>
  <define name="oshvm">
    <optional>
      <ref name="bootloader"/>
    </optional>
    <element name="os">
      <interleave>
        <optional>
          <attribute name="firmware">
            <choice>
              <value>bios</value>
              <value>efi</value>
            </choice>
          </attribute>
        </optional>
        <ref name="ostypehvm"/>
        <optional>
          <element name="firmware">
            <oneOrMore>
              <element name="feature">
                <attribute name="enabled">
                  <ref name="virYesNo"/>
                </attribute>
                <attribute name="name">
                  <choice>
                    <value>enrolled-keys</value>
                    <value>secure-boot</value>
                  </choice>
                </attribute>
              </element>
            </oneOrMore>
          </element>
        </optional>
        <optional>
          <element name="loader">
            <optional>
              <attribute name="readonly">
                <choice>
                  <value>yes</value>
                  <value>no</value>
                </choice>
              </attribute>
            </optional>
            <optional>
              <attribute name="secure">
                <choice>
                  <value>yes</value>
                  <value>no</value>
                </choice>
              </attribute>
            </optional>
            <optional>
              <attribute name="type">
                <choice>
                  <value>rom</value>
                  <value>pflash</value>
                </choice>
              </attribute>
            </optional>
            <optional>
              <ref name="absFilePath"/>
            </optional>
          </element>
        </optional>
        <optional>
          <element name="nvram">
            <optional>
              <attribute name="template">
                <ref name="absFilePath"/>
              </attribute>
            </optional>
            <optional>
              <ref name="absFilePath"/>
            </optional>
          </element>
        </optional>
        <optional>
          <ref name="osbootkernel"/>
        </optional>
        <zeroOrMore>
          <ref name="osbootdev"/>
        </zeroOrMore>
        <optional>
          <element name="bootmenu">
            <attribute name="enable">
              <ref name="virYesNo"/>
            </attribute>
            <optional>
              <attribute name="timeout">
                <ref name="unsignedShort"/>
              </attribute>
            </optional>
          </element>
        </optional>
        <optional>
          <ref name="smbios"/>
        </optional>
        <optional>
          <ref name="bios"/>
        </optional>
        <optional>
          <ref name="acpiTable"/>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="ostypexen">
    <element name="type">
      <optional>
        <attribute name="arch">
          <choice>
            <value>i686</value>
            <value>x86_64</value>
            <value>ia64</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="machine">
          <choice>
            <value>xenpv</value>
            <value>xenfv</value>
            <value>xenpvh</value>
          </choice>
        </attribute>
      </optional>
      <choice>
        <value>xen</value>
        <value>linux</value>
        <value>xenpvh</value>
      </choice>
    </element>
  </define>
  <define name="ostypehvm">
    <element name="type">
      <optional>
        <attribute name="arch">
          <ref name="archnames"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="machine">
          <data type="string">
            <param name="pattern">[a-zA-Z0-9_\.\-]+</param>
          </data>
        </attribute>
      </optional>
      <value>hvm</value>
    </element>
  </define>

  <define name="osexe">
    <element name="os">
      <element name="type">
        <optional>
          <attribute name="arch">
            <ref name="archnames"/>
          </attribute>
        </optional>
        <value>exe</value>
      </element>
      <interleave>
        <optional>
          <element name="init">
            <ref name="absFilePath"/>
          </element>
        </optional>
        <zeroOrMore>
          <element name="initarg">
            <text/>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="initenv">
            <attribute name="name">
              <data type="string">
                <param name="pattern">[a-zA-Z_]+[a-zA-Z0-9_]*</param>
              </data>
            </attribute>
            <text/>
          </element>
        </zeroOrMore>
        <optional>
          <element name="initdir">
            <ref name="absFilePath"/>
          </element>
        </optional>
        <optional>
          <element name="inituser">
            <ref name="genericName"/>
          </element>
          <element name="initgroup">
            <ref name="genericName"/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="keywrap">
    <element name="keywrap">
      <oneOrMore>
        <element name="cipher">
          <attribute name="name">
            <choice>
              <value>aes</value>
              <value>dea</value>
            </choice>
          </attribute>
          <attribute name="state">
            <ref name="virOnOff"/>
          </attribute>
        </element>
      </oneOrMore>
    </element>
  </define>

  <define name="launchSecurity">
    <element name="launchSecurity">
      <attribute name="type">
        <value>sev</value>
      </attribute>
      <interleave>
        <optional>
          <element name="cbitpos">
            <data type="unsignedInt"/>
          </element>
        </optional>
        <optional>
          <element name="reducedPhysBits">
            <data type="unsignedInt"/>
          </element>
        </optional>
        <element name="policy">
          <ref name="hexuint"/>
        </element>
        <optional>
          <element name="handle">
            <ref name="unsignedInt"/>
          </element>
        </optional>
        <optional>
          <element name="dhCert">
            <data type="string"/>
          </element>
        </optional>
        <optional>
          <element name="session">
            <data type="string"/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <!--
      Enable or disable perf events for the domain. For each
      of the events the following rules apply:
      on: the event will be forcefully enabled
      off: the event will be forcefully disabled
      not specified: the event will be disabled by default
  -->
  <define name="perf">
    <element name="perf">
      <oneOrMore>
        <element name="event">
          <attribute name="name">
            <choice>
              <value>cmt</value>
              <value>mbmt</value>
              <value>mbml</value>
              <value>cpu_cycles</value>
              <value>instructions</value>
              <value>cache_references</value>
              <value>cache_misses</value>
              <value>branch_instructions</value>
              <value>branch_misses</value>
              <value>bus_cycles</value>
              <value>stalled_cycles_frontend</value>
              <value>stalled_cycles_backend</value>
              <value>ref_cpu_cycles</value>
              <value>cpu_clock</value>
              <value>task_clock</value>
              <value>page_faults</value>
              <value>context_switches</value>
              <value>cpu_migrations</value>
              <value>page_faults_min</value>
              <value>page_faults_maj</value>
              <value>alignment_faults</value>
              <value>emulation_faults</value>
            </choice>
          </attribute>
          <attribute name="enabled">
            <ref name="virYesNo"/>
          </attribute>
        </element>
      </oneOrMore>
    </element>
  </define>

  <!--
      The Identifiers can be:
      - an optional id attribute with a number on the domain element
      - a mandatory name
      - an optional uuid
    -->
  <define name="ids">
    <optional>
      <attribute name="id">
        <ref name="unsignedInt"/>
      </attribute>
    </optional>
    <interleave>
      <element name="name">
        <ref name="objectNameWithSlash"/>
      </element>
      <optional>
        <element name="uuid">
          <ref name="UUID"/>
        </element>
      </optional>
      <optional>
        <element name="genid">
          <choice>
            <ref name="UUID"/>
            <empty/>
          </choice>
        </element>
      </optional>
    </interleave>
  </define>
  <define name="idmap">
    <element name="idmap">
      <interleave>
        <zeroOrMore>
          <element name="uid">
            <attribute name="start">
              <ref name="unsignedInt"/>
            </attribute>
            <attribute name="target">
              <ref name="unsignedInt"/>
            </attribute>
            <attribute name="count">
              <ref name="unsignedInt"/>
            </attribute>
            <empty/>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="gid">
            <attribute name="start">
              <ref name="unsignedInt"/>
            </attribute>
            <attribute name="target">
              <ref name="unsignedInt"/>
            </attribute>
            <attribute name="count">
              <ref name="unsignedInt"/>
            </attribute>
            <empty/>
          </element>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <!--
      Resources usage defines the amount of memory (maximum and possibly
      current usage) and number of virtual CPUs used by that domain.
      We can't check here the rule that currentMemory <= memory
    -->
  <define name="resources">
    <interleave>
      <optional>
        <element name="memory">
          <ref name="scaledInteger"/>
          <optional>
            <attribute name="dumpCore">
              <ref name="virOnOff"/>
            </attribute>
          </optional>
        </element>
      </optional>
      <optional>
        <element name="maxMemory">
          <ref name="scaledInteger"/>
          <attribute name="slots">
            <ref name="unsignedInt"/>
          </attribute>
        </element>
      </optional>
      <optional>
        <element name="currentMemory">
          <ref name="scaledInteger"/>
        </element>
      </optional>
      <optional>
        <element name="memoryBacking">
          <interleave>
            <optional>
              <element name="hugepages">
                <zeroOrMore>
                  <element name="page">
                    <attribute name="size">
                      <ref name="unsignedLong"/>
                    </attribute>
                    <optional>
                      <attribute name="unit">
                        <ref name="unit"/>
                      </attribute>
                    </optional>
                    <optional>
                      <attribute name="nodeset">
                        <ref name="cpuset"/>
                      </attribute>
                    </optional>
                    <empty/>
                  </element>
                </zeroOrMore>
              </element>
            </optional>
            <optional>
              <element name="nosharepages">
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="locked">
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="source">
                <attribute name="type">
                  <choice>
                    <value>file</value>
                    <value>anonymous</value>
                    <value>memfd</value>
                  </choice>
                </attribute>
              </element>
            </optional>
            <optional>
              <element name="access">
                <attribute name="mode">
                  <choice>
                    <value>shared</value>
                    <value>private</value>
                  </choice>
                </attribute>
              </element>
            </optional>
            <optional>
              <element name="allocation">
                <attribute name="mode">
                  <choice>
                    <value>immediate</value>
                    <value>ondemand</value>
                  </choice>
                </attribute>
              </element>
            </optional>
            <optional>
              <element name="discard">
                <empty/>
              </element>
            </optional>
          </interleave>
        </element>
      </optional>

      <optional>
        <element name="vcpu">
          <optional>
            <attribute name="placement">
              <choice>
                <value>static</value>
                <value>auto</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="cpuset">
              <ref name="cpuset"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="current">
              <ref name="countCPU"/>
            </attribute>
          </optional>
          <ref name="countCPU"/>
        </element>
      </optional>

      <optional>
        <element name="vcpus">
          <zeroOrMore>
            <element name="vcpu">
              <attribute name="id">
                <ref name="unsignedInt"/>
              </attribute>
              <attribute name="enabled">
                <ref name="virYesNo"/>
              </attribute>
              <optional>
                <attribute name="hotpluggable">
                  <ref name="virYesNo"/>
                </attribute>
              </optional>
              <optional>
                <attribute name="order">
                  <ref name="unsignedInt"/>
                </attribute>
              </optional>
            </element>
          </zeroOrMore>
        </element>
      </optional>

      <optional>
        <element name="iothreads">
          <ref name="unsignedInt"/>
        </element>
      </optional>

      <optional>
        <element name="iothreadids">
          <zeroOrMore>
            <element name="iothread">
              <attribute name="id">
                <ref name="unsignedInt"/>
              </attribute>
            </element>
          </zeroOrMore>
        </element>
      </optional>

      <optional>
        <ref name="blkiotune"/>
      </optional>

      <optional>
        <ref name="memtune"/>
      </optional>

      <optional>
        <ref name="cputune"/>
      </optional>

      <optional>
        <ref name="numatune"/>
      </optional>

      <optional>
        <ref name="respartition"/>
      </optional>
    </interleave>
  </define>

  <!-- The Blkio cgroup related tunables would go in the blkiotune -->
  <define name="blkiotune">
    <element name="blkiotune">
      <interleave>
        <!-- I/O weight the VM can use -->
        <optional>
          <element name="weight">
            <ref name="weight"/>
          </element>
        </optional>
        <zeroOrMore>
          <element name="device">
            <interleave>
              <element name="path">
                <ref name="absFilePath"/>
              </element>
              <optional>
                <element name="weight">
                  <ref name="weight"/>
                </element>
              </optional>
              <optional>
                <element name="read_iops_sec">
                  <data type="unsignedInt"/>
                </element>
              </optional>
              <optional>
                <element name="write_iops_sec">
                  <data type="unsignedInt"/>
                </element>
              </optional>
              <optional>
                <element name="read_bytes_sec">
                  <data type="unsignedLong"/>
                </element>
              </optional>
              <optional>
                <element name="write_bytes_sec">
                  <data type="unsignedLong"/>
                </element>
              </optional>
            </interleave>
          </element>
        </zeroOrMore>
      </interleave>
    </element>
  </define>

  <!-- All the memory/swap related tunables would go in the memtune -->
  <define name="memtune">
    <element name="memtune">
      <!-- Maximum memory the VM can use -->
      <optional>
        <element name="hard_limit">
          <ref name="scaledInteger"/>
        </element>
      </optional>
      <!-- Minimum memory ascertained for the VM during contention -->
      <optional>
        <element name="soft_limit">
          <ref name="scaledInteger"/>
        </element>
      </optional>
      <!-- Minimum amount of memory required to start the VM -->
      <optional>
        <element name="min_guarantee">
          <ref name="scaledInteger"/>
        </element>
      </optional>
      <!-- Maximum swap area the VM can use -->
      <optional>
        <element name="swap_hard_limit">
          <ref name="scaledInteger"/>
        </element>
      </optional>
    </element>
  </define>

  <!-- All the cpu related tunables would go in the cputune -->
  <define name="cputune">
    <element name="cputune">
      <interleave>
        <optional>
          <element name="shares">
            <ref name="cpushares"/>
          </element>
        </optional>
        <optional>
          <element name="global_period">
            <ref name="cpuperiod"/>
          </element>
        </optional>
        <optional>
          <element name="global_quota">
            <ref name="cpuquota"/>
          </element>
        </optional>
        <optional>
          <element name="period">
            <ref name="cpuperiod"/>
          </element>
        </optional>
        <optional>
          <element name="quota">
            <ref name="cpuquota"/>
          </element>
        </optional>
        <optional>
          <element name="emulator_period">
            <ref name="cpuperiod"/>
          </element>
        </optional>
        <optional>
          <element name="emulator_quota">
            <ref name="cpuquota"/>
          </element>
        </optional>
        <optional>
          <element name="iothread_period">
            <ref name="cpuperiod"/>
          </element>
        </optional>
        <optional>
          <element name="iothread_quota">
            <ref name="cpuquota"/>
          </element>
        </optional>
        <zeroOrMore>
          <element name="vcpupin">
            <attribute name="vcpu">
              <ref name="vcpuid"/>
            </attribute>
            <attribute name="cpuset">
              <ref name="cpuset"/>
            </attribute>
          </element>
        </zeroOrMore>
        <optional>
          <element name="emulatorpin">
            <attribute name="cpuset">
              <ref name="cpuset"/>
            </attribute>
          </element>
        </optional>
        <zeroOrMore>
          <element name="iothreadpin">
            <attribute name="iothread">
              <ref name="unsignedInt"/>
            </attribute>
            <attribute name="cpuset">
              <ref name="cpuset"/>
            </attribute>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="vcpusched">
            <optional>
              <attribute name="vcpus">
                <ref name="cpuset"/>
              </attribute>
            </optional>
            <ref name="schedparam"/>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="iothreadsched">
            <optional>
              <attribute name="iothreads">
                <ref name="cpuset"/>
              </attribute>
            </optional>
            <ref name="schedparam"/>
          </element>
        </zeroOrMore>
        <optional>
          <element name="emulatorsched">
            <ref name="schedparam"/>
          </element>
        </optional>
        <zeroOrMore>
          <element name="cachetune">
            <attribute name="vcpus">
              <ref name="cpuset"/>
            </attribute>
            <oneOrMore>
              <choice>
                <element name="cache">
                  <attribute name="id">
                    <ref name="unsignedInt"/>
                  </attribute>
                  <attribute name="level">
                    <ref name="unsignedInt"/>
                  </attribute>
                  <attribute name="type">
                    <choice>
                      <value>both</value>
                      <value>code</value>
                      <value>data</value>
                    </choice>
                  </attribute>
                  <attribute name="size">
                    <ref name="unsignedLong"/>
                  </attribute>
                  <optional>
                    <attribute name="unit">
                      <ref name="unit"/>
                    </attribute>
                  </optional>
                </element>
                <element name="monitor">
                  <attribute name="level">
                    <ref name="unsignedInt"/>
                  </attribute>
                  <attribute name="vcpus">
                    <ref name="cpuset"/>
                  </attribute>
                </element>
              </choice>
            </oneOrMore>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="memorytune">
            <attribute name="vcpus">
              <ref name="cpuset"/>
            </attribute>
            <oneOrMore>
              <choice>
                <element name="node">
                  <attribute name="id">
                    <ref name="unsignedInt"/>
                  </attribute>
                  <attribute name="bandwidth">
                    <ref name="unsignedInt"/>
                  </attribute>
                </element>
                <element name="monitor">
                  <attribute name="vcpus">
                    <ref name="cpuset"/>
                  </attribute>
                </element>
              </choice>
            </oneOrMore>
          </element>
        </zeroOrMore>
      </interleave>
    </element>
  </define>

  <define name="schedparam">
    <choice>
      <group>
        <attribute name="scheduler">
          <choice>
            <value>batch</value>
            <value>idle</value>
          </choice>
        </attribute>
      </group>
      <group>
        <attribute name="scheduler">
          <choice>
            <value>fifo</value>
            <value>rr</value>
          </choice>
        </attribute>
        <attribute name="priority">
          <ref name="unsignedShort"/>
        </attribute>
      </group>
    </choice>
  </define>

  <!-- All the NUMA related tunables would go in the numatune -->
  <define name="numatune">
    <element name="numatune">
      <interleave>
        <optional>
          <element name="memory">
            <optional>
              <attribute name="mode">
                <choice>
                  <value>strict</value>
                  <value>preferred</value>
                  <value>interleave</value>
                  <value>restrictive</value>
                </choice>
              </attribute>
            </optional>
            <choice>
              <group>
                <optional>
                  <attribute name="placement">
                    <value>static</value>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="nodeset">
                    <ref name="cpuset"/>
                  </attribute>
                </optional>
              </group>
              <attribute name="placement">
                <value>auto</value>
              </attribute>
            </choice>
          </element>
        </optional>
        <zeroOrMore>
          <element name="memnode">
            <attribute name="cellid">
              <ref name="unsignedInt"/>
            </attribute>
            <attribute name="mode">
              <choice>
                <value>strict</value>
                <value>preferred</value>
                <value>interleave</value>
                <value>restrictive</value>
              </choice>
            </attribute>
            <attribute name="nodeset">
              <ref name="cpuset"/>
            </attribute>
          </element>
        </zeroOrMore>
      </interleave>
    </element>
  </define>

  <define name="respartition">
    <element name="resource">
      <element name="partition">
        <ref name="absFilePath"/>
      </element>
    </element>
  </define>

  <define name="clock">
    <optional>
      <element name="clock">
        <choice>
          <group>
            <attribute name="offset">
              <choice>
                <value>localtime</value>
                <value>utc</value>
              </choice>
            </attribute>
            <optional>
              <attribute name="adjustment">
                <choice>
                  <ref name="timeDelta"/>
                  <value>reset</value>
                </choice>
              </attribute>
            </optional>
          </group>
          <group>
            <attribute name="offset">
              <value>timezone</value>
            </attribute>
            <optional>
              <attribute name="timezone">
                <ref name="timeZone"/>
              </attribute>
            </optional>
          </group>
          <group>
            <attribute name="offset">
              <value>variable</value>
            </attribute>
            <optional>
              <attribute name="adjustment">
                <ref name="timeDelta"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="basis">
                <choice>
                  <value>utc</value>
                  <value>localtime</value>
                </choice>
              </attribute>
            </optional>
          </group>
        </choice>
        <zeroOrMore>
          <ref name="timer"/>
        </zeroOrMore>
      </element>
    </optional>
  </define>
  <define name="timer">
    <element name="timer">
      <choice>
        <group>
          <attribute name="name">
            <choice>
              <value>platform</value>
              <value>rtc</value>
            </choice>
          </attribute>
          <optional>
            <attribute name="track">
              <choice>
                <value>boot</value>
                <value>guest</value>
                <value>wall</value>
                <value>realtime</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <ref name="tickpolicy"/>
          </optional>
        </group>
        <group>
          <attribute name="name">
            <value>tsc</value>
          </attribute>
          <optional>
            <ref name="tickpolicy"/>
          </optional>
          <optional>
            <attribute name="frequency">
              <ref name="unsignedLong"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="mode">
              <choice>
                <value>auto</value>
                <value>native</value>
                <value>emulate</value>
                <value>paravirt</value>
                <value>smpsafe</value>
              </choice>
            </attribute>
          </optional>
        </group>
        <group>
          <attribute name="name">
            <choice>
              <value>hpet</value>
              <value>pit</value>
              <value>armvtimer</value>
            </choice>
          </attribute>
          <optional>
            <ref name="tickpolicy"/>
          </optional>
        </group>
        <group>
          <attribute name="name">
            <choice>
              <value>kvmclock</value>
              <value>hypervclock</value>
            </choice>
          </attribute>
        </group>
      </choice>
      <optional>
        <attribute name="present">
          <ref name="virYesNo"/>
        </attribute>
      </optional>
      <empty/>
    </element>
  </define>

  <define name="tickpolicy">
    <choice>
      <group>
        <attribute name="tickpolicy">
          <choice>
            <value>delay</value>
            <value>merge</value>
            <value>discard</value>
          </choice>
        </attribute>
      </group>
      <group>
        <attribute name="tickpolicy">
          <value>catchup</value>
        </attribute>
        <optional>
          <element name="catchup">
            <optional>
              <attribute name="threshold">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="slew">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="limit">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
          </element>
        </optional>
      </group>
    </choice>
  </define>
<!--
      A bootloader may be used to extract the OS information instead of
      defining the OS parameter in the instance. It points just to the
      binary or script used to extract the data from the first disk device.
    -->
  <define name="bootloader">
    <interleave>
      <optional>
        <element name="bootloader">
          <choice>
            <text/>
            <empty/>
          </choice>
        </element>
      </optional>
      <optional>
        <element name="bootloader_args">
          <text/>
        </element>
      </optional>
    </interleave>
  </define>
  <define name="osbootkernel">
    <interleave>
      <optional>
        <element name="kernel">
          <ref name="absFilePath"/>
        </element>
      </optional>
      <optional>
        <element name="initrd">
          <ref name="absFilePath"/>
        </element>
      </optional>
      <optional>
        <element name="root">
          <ref name="absFilePath"/>
        </element>
      </optional>
      <optional>
        <element name="cmdline">
          <text/>
        </element>
      </optional>
      <optional>
        <element name="dtb">
          <ref name="absFilePath"/>
        </element>
      </optional>
    </interleave>
  </define>
  <define name="osbootdev">
    <element name="boot">
      <attribute name="dev">
        <choice>
          <value>hd</value>
          <value>fd</value>
          <value>cdrom</value>
          <value>network</value>
        </choice>
      </attribute>
      <empty/>
    </element>
  </define>
  <define name="diskspec">
    <interleave>
      <optional>
        <ref name="diskDriver"/>
      </optional>
      <optional>
        <ref name="diskMirror"/>
      </optional>
      <optional>
        <ref name="diskAuth"/>
      </optional>
      <ref name="target"/>
      <optional>
        <ref name="deviceBoot"/>
      </optional>
      <optional>
        <element name="backenddomain">
          <attribute name="name">
            <ref name="objectNameWithSlash"/>
          </attribute>
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="readonly">
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="shareable">
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="transient">
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="serial">
          <ref name="diskSerial"/>
        </element>
      </optional>
      <optional>
        <ref name="encryption"/>
      </optional>
      <optional>
        <ref name="diskIoTune"/>
      </optional>
      <optional>
        <ref name="alias"/>
      </optional>
      <optional>
        <ref name="acpi"/>
      </optional>
      <optional>
        <ref name="address"/>
      </optional>
      <optional>
        <ref name="geometry"/>
      </optional>
      <optional>
        <ref name="diskBlockIo"/>
      </optional>
      <optional>
        <element name="wwn">
          <ref name="wwn"/>
        </element>
      </optional>
      <optional>
        <element name="vendor">
          <data type="string">
            <!-- All printable characters -->
            <param name="pattern">[&#x20;-&#x7E;]{0,8}</param>
          </data>
        </element>
      </optional>
      <optional>
        <element name="product">
          <data type="string">
            <!-- All printable characters -->
            <param name="pattern">[&#x20;-&#x7E;]{0,16}</param>
          </data>
        </element>
      </optional>
    </interleave>
  </define>
  <define name="snapshot">
    <attribute name="snapshot">
      <choice>
        <value>no</value>
        <value>internal</value>
        <value>external</value>
      </choice>
    </attribute>
  </define>

  <define name="lease">
    <element name="lease">
      <interleave>
        <element name="lockspace">
          <text/>
        </element>
        <element name="key">
          <text/>
        </element>
        <element name="target">
          <attribute name="path">
            <text/>
          </attribute>
          <optional>
            <attribute name="offset">
              <ref name="unsignedInt"/>
            </attribute>
          </optional>
        </element>
      </interleave>
    </element>
  </define>

  <define name="startupPolicy">
    <attribute name="startupPolicy">
      <choice>
        <value>mandatory</value>
        <value>requisite</value>
        <value>optional</value>
      </choice>
    </attribute>
  </define>

  <!--
      A disk description can be either of type file or block
      The name of the attribute on the source element depends on the type

    -->
  <define name="disk">
    <element name="disk">
      <choice>
        <group>
          <optional>
            <attribute name="device">
              <choice>
                <value>floppy</value>
                <value>disk</value>
                <value>cdrom</value>
              </choice>
            </attribute>
          </optional>
          <interleave>
            <ref name="diskSource"/>
            <ref name="diskSpecsExtra"/>
          </interleave>
        </group>
        <group>
          <attribute name="device">
            <value>lun</value>
          </attribute>
          <optional>
            <ref name="rawIO"/>
          </optional>
          <optional>
            <ref name="sgIO"/>
          </optional>
          <interleave>
            <choice>
              <ref name="diskSourceNetwork"/>
              <ref name="diskSourceBlock"/>
              <ref name="diskSourceVolume"/>
            </choice>
            <ref name="diskSpecsExtra"/>
          </interleave>
        </group>
      </choice>
      <optional>
        <attribute name="model">
          <choice>
            <value>virtio</value>
            <value>virtio-transitional</value>
            <value>virtio-non-transitional</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <ref name="snapshot"/>
      </optional>
    </element>
  </define>

  <define name="diskSpecsExtra">
    <interleave>
      <ref name="storageSourceExtra"/>
      <ref name="diskBackingChain"/>
    </interleave>
  </define>

  <define name="diskBackingChain">
    <choice>
      <ref name="diskBackingStore"/>
      <ref name="diskBackingStoreLast"/>
    </choice>
  </define>

  <define name="diskBackingStore">
    <element name="backingStore">
      <optional>
        <attribute name="index">
          <ref name="positiveInteger"/>
        </attribute>
      </optional>
      <interleave>
        <ref name="diskSource"/>
        <ref name="diskBackingChain"/>
        <ref name="diskFormat"/>
      </interleave>
    </element>
  </define>

  <define name="diskFormat">
    <element name="format">
      <attribute name="type">
        <ref name="storageFormat"/>
      </attribute>
      <optional>
        <element name="metadata_cache">
          <optional>
            <element name="max_size">
              <ref name="scaledInteger"/>
            </element>
          </optional>
        </element>
      </optional>
    </element>
  </define>

  <define name="diskBackingStoreLast">
    <optional>
      <element name="backingStore">
        <empty/>
      </element>
    </optional>
  </define>

  <define name="diskSourceSlice">
    <attribute name="offset">
      <ref name="positiveInteger"/>
    </attribute>
    <attribute name="size">
      <ref name="positiveInteger"/>
    </attribute>
  </define>

  <define name="diskSourceCommon">
    <optional>
      <attribute name="index">
        <ref name="positiveInteger"/>
      </attribute>
    </optional>
    <optional>
      <element name="slices">
        <element name="slice">
          <attribute name="type">
            <value>storage</value>
          </attribute>
          <ref name="diskSourceSlice"/>
        </element>
      </element>
    </optional>
  </define>

  <define name="diskSource">
    <choice>
      <ref name="diskSourceFile"/>
      <ref name="diskSourceBlock"/>
      <ref name="diskSourceDir"/>
      <ref name="diskSourceNetwork"/>
      <ref name="diskSourceVolume"/>
      <ref name="diskSourceNvme"/>
      <ref name="diskSourceVhostUser"/>
    </choice>
  </define>

  <define name="diskSourceFile">
    <optional>
      <attribute name="type">
        <value>file</value>
      </attribute>
    </optional>
    <optional>
      <element name="source">
        <interleave>
          <optional>
            <attribute name="file">
              <choice>
                <ref name="absFilePath"/>
                <ref name="vmwarePath"/>
              </choice>
            </attribute>
          </optional>
          <ref name="diskSourceCommon"/>
          <optional>
            <ref name="storageStartupPolicy"/>
          </optional>
          <optional>
            <ref name="encryption"/>
          </optional>
          <zeroOrMore>
            <ref name="devSeclabel"/>
          </zeroOrMore>
        </interleave>
      </element>
    </optional>
  </define>

  <define name="diskSourceBlock">
    <attribute name="type">
      <value>block</value>
    </attribute>
    <optional>
      <element name="source">
        <interleave>
          <optional>
            <attribute name="dev">
              <choice>
                <ref name="absFilePath"/>
                <ref name="deviceName"/>
              </choice>
            </attribute>
          </optional>
          <ref name="diskSourceCommon"/>
          <optional>
            <ref name="storageStartupPolicy"/>
          </optional>
          <optional>
            <ref name="encryption"/>
          </optional>
          <optional>
            <ref name="reservations"/>
          </optional>
          <zeroOrMore>
            <ref name="devSeclabel"/>
          </zeroOrMore>
        </interleave>
      </element>
    </optional>
  </define>

  <define name="diskSourceDir">
    <attribute name="type">
      <value>dir</value>
    </attribute>
    <optional>
      <element name="source">
        <interleave>
          <attribute name="dir">
            <ref name="absFilePath"/>
          </attribute>
          <ref name="diskSourceCommon"/>
          <optional>
            <ref name="storageStartupPolicy"/>
          </optional>
          <optional>
            <ref name="encryption"/>
          </optional>
          <empty/>
        </interleave>
      </element>
    </optional>
  </define>

  <define name="diskSourceNetworkHost">
    <element name="host">
      <choice>
        <group>
          <optional>
            <attribute name="transport">
              <choice>
                <value>tcp</value>
                <value>rdma</value>
              </choice>
            </attribute>
          </optional>
          <attribute name="name">
            <choice>
              <ref name="dnsName"/>
              <ref name="ipAddr"/>
            </choice>
          </attribute>
          <optional>
            <attribute name="port">
              <ref name="unsignedInt"/>
            </attribute>
          </optional>
        </group>
        <group>
          <attribute name="transport">
            <value>unix</value>
          </attribute>
          <attribute name="socket">
            <ref name="absFilePath"/>
          </attribute>
        </group>
      </choice>
    </element>
  </define>

  <define name="diskSourceNetworkNFS">
    <element name="identity">
      <optional>
        <attribute name="user">
          <ref name="genericName"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="group">
          <ref name="genericName"/>
        </attribute>
      </optional>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolRBD">
    <element name="source">
      <interleave>
        <attribute name="protocol">
          <value>rbd</value>
        </attribute>
        <ref name="diskSourceCommon"/>
        <optional>
          <attribute name="name"/>
        </optional>
        <zeroOrMore>
          <ref name="diskSourceNetworkHost"/>
        </zeroOrMore>
        <optional>
          <element name="snapshot">
            <attribute name="name">
              <ref name="genericName"/>
            </attribute>
            <empty/>
          </element>
        </optional>
        <optional>
          <element name="config">
            <attribute name="file">
              <ref name="absFilePath"/>
            </attribute>
            <empty/>
          </element>
        </optional>
        <optional>
          <ref name="diskAuth"/>
        </optional>
        <optional>
          <ref name="encryption"/>
        </optional>
        <empty/>
      </interleave>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolISCSI">
    <element name="source">
      <attribute name="protocol">
        <value>iscsi</value>
      </attribute>
      <attribute name="name"/>
      <interleave>
        <ref name="diskSourceCommon"/>
        <ref name="diskSourceNetworkHost"/>
        <optional>
          <ref name="diskAuth"/>
        </optional>
        <optional>
          <ref name="encryption"/>
        </optional>
        <optional>
          <ref name="initiatorinfo"/>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolPropsCommon">
    <optional>
      <element name="readahead">
        <attribute name="size">
          <ref name="positiveInteger"/>
        </attribute>
        <empty/>
      </element>
    </optional>
    <optional>
      <element name="timeout">
        <attribute name="seconds">
          <ref name="positiveInteger"/>
        </attribute>
        <empty/>
      </element>
    </optional>
  </define>

  <define name="diskSourceNetworkProtocolSSLVerify">
    <element name="ssl">
      <attribute name="verify">
        <ref name="virYesNo"/>
      </attribute>
      <empty/>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolHTTPCookies">
    <element name="cookies">
      <oneOrMore>
        <element name="cookie">
          <attribute name="name">
            <data type="string">
              <param name="pattern">[!#$%&amp;'*+\-.0-9A-Z\^_`a-z|~]+</param>
            </data>
          </attribute>
          <data type="string">
            <param name="pattern">"?[!#$%&amp;'()*+\-./0-9:&gt;=&lt;?@A-Z\^_`\[\]a-z|~]+"?</param>
          </data>
        </element>
      </oneOrMore>
      <empty/>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolHTTPS">
    <element name="source">
      <interleave>
        <attribute name="protocol">
          <choice>
            <value>https</value>
          </choice>
        </attribute>
        <attribute name="name"/>
        <optional>
          <attribute name="query"/>
        </optional>
        <ref name="diskSourceCommon"/>
        <ref name="diskSourceNetworkHost"/>
        <optional>
          <ref name="encryption"/>
        </optional>
        <optional>
          <ref name="diskSourceNetworkProtocolSSLVerify"/>
        </optional>
        <optional>
          <ref name="diskSourceNetworkProtocolHTTPCookies"/>
        </optional>
        <ref name="diskSourceNetworkProtocolPropsCommon"/>
        </interleave>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolHTTP">
    <element name="source">
      <interleave>
        <attribute name="protocol">
          <choice>
            <value>http</value>
          </choice>
        </attribute>
        <attribute name="name"/>
        <optional>
          <attribute name="query"/>
        </optional>
        <ref name="diskSourceCommon"/>
        <ref name="diskSourceNetworkHost"/>
        <optional>
          <ref name="encryption"/>
        </optional>
        <optional>
          <ref name="diskSourceNetworkProtocolHTTPCookies"/>
        </optional>
        <ref name="diskSourceNetworkProtocolPropsCommon"/>
      </interleave>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolFTPS">
    <element name="source">
      <interleave>
        <attribute name="protocol">
          <choice>
            <value>ftps</value>
          </choice>
        </attribute>
        <attribute name="name"/>
        <ref name="diskSourceCommon"/>
        <ref name="diskSourceNetworkHost"/>
        <optional>
          <ref name="encryption"/>
        </optional>
        <optional>
          <ref name="diskSourceNetworkProtocolSSLVerify"/>
        </optional>
        <ref name="diskSourceNetworkProtocolPropsCommon"/>
      </interleave>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolSimple">
    <element name="source">
      <interleave>
        <attribute name="protocol">
          <choice>
            <value>sheepdog</value>
            <value>ftp</value>
            <value>tftp</value>
          </choice>
        </attribute>
        <attribute name="name"/>
        <ref name="diskSourceCommon"/>
        <ref name="diskSourceNetworkHost"/>
        <optional>
          <ref name="encryption"/>
        </optional>
        <ref name="diskSourceNetworkProtocolPropsCommon"/>
      </interleave>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolNBD">
    <element name="source">
      <interleave>
        <attribute name="protocol">
          <value>nbd</value>
        </attribute>
        <optional>
          <attribute name="name"/>
        </optional>
        <optional>
          <attribute name="tls">
            <ref name="virYesNo"/>
          </attribute>
        </optional>
        <ref name="diskSourceCommon"/>
        <ref name="diskSourceNetworkHost"/>
        <optional>
          <ref name="encryption"/>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolGluster">
    <element name="source">
      <interleave>
        <attribute name="protocol">
          <value>gluster</value>
        </attribute>
        <attribute name="name"/>
        <ref name="diskSourceCommon"/>
        <oneOrMore>
          <ref name="diskSourceNetworkHost"/>
        </oneOrMore>
        <optional>
          <ref name="encryption"/>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolVxHS">
    <element name="source">
      <interleave>
        <attribute name="protocol">
          <choice>
            <value>vxhs</value>
          </choice>
        </attribute>
        <attribute name="name"/>
        <ref name="diskSourceCommon"/>
        <optional>
          <attribute name="tls">
            <ref name="virYesNo"/>
          </attribute>
        </optional>
        <ref name="diskSourceNetworkHost"/>
      </interleave>
    </element>
  </define>

  <define name="diskSourceNetworkProtocolNFS">
    <element name="source">
      <interleave>
        <attribute name="protocol">
          <choice>
            <value>nfs</value>
          </choice>
        </attribute>
        <attribute name="name"/>
        <ref name="diskSourceCommon"/>
        <ref name="diskSourceNetworkHost"/>
        <ref name="diskSourceNetworkNFS"/>
      </interleave>
    </element>
  </define>

  <define name="diskSourceNetwork">
    <attribute name="type">
      <value>network</value>
    </attribute>
    <choice>
      <ref name="diskSourceNetworkProtocolNBD"/>
      <ref name="diskSourceNetworkProtocolGluster"/>
      <ref name="diskSourceNetworkProtocolRBD"/>
      <ref name="diskSourceNetworkProtocolISCSI"/>
      <ref name="diskSourceNetworkProtocolHTTP"/>
      <ref name="diskSourceNetworkProtocolHTTPS"/>
      <ref name="diskSourceNetworkProtocolFTPS"/>
      <ref name="diskSourceNetworkProtocolSimple"/>
      <ref name="diskSourceNetworkProtocolVxHS"/>
      <ref name="diskSourceNetworkProtocolNFS"/>
    </choice>
  </define>

  <define name="diskSourceVolume">
    <attribute name="type">
      <value>volume</value>
    </attribute>
    <optional>
      <element name="source">
        <interleave>
          <attribute name="pool">
            <ref name="objectName"/>
          </attribute>
          <attribute name="volume">
            <ref name="volName"/>
          </attribute>
          <optional>
            <attribute name="mode">
              <choice>
                <value>host</value>
                <value>direct</value>
              </choice>
            </attribute>
          </optional>
          <ref name="diskSourceCommon"/>
          <optional>
            <ref name="storageStartupPolicy"/>
          </optional>
          <optional>
            <ref name="encryption"/>
          </optional>
          <zeroOrMore>
            <ref name="devSeclabel"/>
          </zeroOrMore>
        </interleave>
      </element>
    </optional>
  </define>

  <define name="diskSourceNvme">
    <attribute name="type">
      <value>nvme</value>
    </attribute>
    <optional>
      <element name="source">
        <interleave>
          <attribute name="type">
            <value>pci</value>
          </attribute>
          <attribute name="namespace">
            <ref name="uint32"/>
          </attribute>
          <optional>
            <attribute name="managed">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <element name="address">
            <ref name="pciaddress"/>
          </element>
          <ref name="diskSourceCommon"/>
          <optional>
            <ref name="storageStartupPolicy"/>
          </optional>
          <optional>
            <ref name="encryption"/>
          </optional>
        </interleave>
      </element>
    </optional>
  </define>

  <define name="diskSourceVhostUser">
    <attribute name="type">
      <value>vhostuser</value>
    </attribute>
    <element name="source">
      <attribute name="type">
        <value>unix</value>
      </attribute>
      <attribute name="path">
        <ref name="absFilePath"/>
      </attribute>
      <optional>
         <ref name="reconnect"/>
      </optional>
      <empty/>
    </element>
  </define>

  <define name="diskTarget">
    <data type="string">
      <param name="pattern">(ioemu:)?(fd|hd|sd|vd|xvd|ubd)[a-zA-Z0-9_]+</param>
    </data>
  </define>
  <define name="target">
    <element name="target">
      <attribute name="dev">
        <ref name="diskTarget"/>
      </attribute>
      <optional>
        <attribute name="bus">
          <choice>
            <value>ide</value>
            <value>fdc</value>
            <value>scsi</value>
            <value>virtio</value>
            <value>xen</value>
            <value>usb</value>
            <value>uml</value> <!-- NOT USED ANYMORE -->
            <value>sata</value>
            <value>sd</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="tray">
          <choice>
            <value>open</value>
            <value>closed</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="removable">
          <ref name="virOnOff"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="rotation_rate">
          <ref name="positiveInteger"/>
        </attribute>
      </optional>
    </element>
  </define>
  <define name="geometry">
    <element name="geometry">
      <attribute name="cyls">
        <data type="integer"/>
      </attribute>
      <attribute name="heads">
        <data type="integer"/>
      </attribute>
      <attribute name="secs">
        <data type="integer"/>
      </attribute>
      <optional>
        <attribute name="trans">
          <choice>
            <value>auto</value>
            <value>none</value>
            <value>lba</value>
          </choice>
        </attribute>
      </optional>
    </element>
  </define>
  <define name="diskBlockIo">
    <element name="blockio">
      <optional>
        <attribute name="logical_block_size">
          <data type="integer"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="physical_block_size">
          <data type="integer"/>
        </attribute>
      </optional>
    </element>
  </define>
  <!--
      Disk may use a special driver for access.
    -->
  <define name="diskDriver">
    <element name="driver">
      <optional>
        <ref name="driverFormat"/>
      </optional>
      <optional>
        <ref name="driverCache"/>
      </optional>
      <optional>
        <ref name="driverErrorPolicy"/>
      </optional>
      <optional>
        <ref name="driverRerrorPolicy"/>
      </optional>
      <optional>
        <ref name="driverIO"/>
      </optional>
      <optional>
        <ref name="ioeventfd"/>
      </optional>
      <optional>
        <ref name="event_idx"/>
      </optional>
      <optional>
        <ref name="copy_on_read"/>
      </optional>
      <optional>
        <ref name="discard"/>
      </optional>
      <optional>
        <ref name="driverIOThread"/>
      </optional>
      <optional>
        <ref name="detect_zeroes"/>
      </optional>
      <optional>
        <attribute name="queues">
          <ref name="positiveInteger"/>
        </attribute>
      </optional>
      <ref name="virtioOptions"/>
      <optional>
        <element name="metadata_cache">
          <optional>
            <element name="max_size">
              <ref name="scaledInteger"/>
            </element>
          </optional>
        </element>
      </optional>
    </element>
  </define>
  <define name="driverFormat">
    <optional>
      <attribute name="name">
        <ref name="genericName"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="type">
        <choice>
          <ref name="storageFormat"/>
          <value>aio</value> <!-- back-compat for "raw" -->
        </choice>
      </attribute>
    </optional>
  </define>

  <define name="driverCache">
    <attribute name="cache">
      <choice>
        <value>default</value>
        <value>none</value>
        <value>writeback</value>
        <value>writethrough</value>
        <value>directsync</value>
        <value>unsafe</value>
      </choice>
    </attribute>
  </define>
  <define name="driverErrorPolicy">
    <attribute name="error_policy">
      <choice>
        <value>stop</value>
        <value>report</value>
        <value>ignore</value>
        <value>enospace</value>
      </choice>
    </attribute>
  </define>
  <define name="driverRerrorPolicy">
    <attribute name="rerror_policy">
      <choice>
        <value>stop</value>
        <value>report</value>
        <value>ignore</value>
      </choice>
    </attribute>
  </define>
  <define name="driverIO">
    <attribute name="io">
      <choice>
        <value>threads</value>
        <value>native</value>
        <value>io_uring</value>
      </choice>
    </attribute>
  </define>
  <define name="ioeventfd">
    <attribute name="ioeventfd">
      <ref name="virOnOff"/>
    </attribute>
  </define>
  <define name="event_idx">
    <attribute name="event_idx">
      <ref name="virOnOff"/>
    </attribute>
  </define>
  <define name="copy_on_read">
    <attribute name="copy_on_read">
      <ref name="virOnOff"/>
    </attribute>
  </define>
  <define name="discard">
    <attribute name="discard">
      <choice>
        <value>unmap</value>
        <value>ignore</value>
      </choice>
    </attribute>
  </define>
  <define name="driverIOThread">
    <attribute name="iothread">
      <ref name="unsignedInt"/>
    </attribute>
  </define>
  <define name="detect_zeroes">
    <attribute name="detect_zeroes">
      <choice>
        <value>off</value>
        <value>on</value>
        <value>unmap</value>
      </choice>
    </attribute>
  </define>
  <define name="controller">
    <element name="controller">
      <optional>
        <attribute name="index">
          <ref name="unsignedInt"/>
        </attribute>
      </optional>
      <interleave>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
        <choice>
          <!-- fdc/sata/ccid have only the common attributes -->
          <group>
            <attribute name="type">
              <choice>
                <value>fdc</value>
                <value>sata</value>
                <value>ccid</value>
              </choice>
            </attribute>
          </group>
          <!-- scsi has an optional attribute "model" -->
          <group>
            <attribute name="type">
              <value>scsi</value>
            </attribute>
            <optional>
              <attribute name="model">
                <choice>
                  <value>auto</value>
                  <value>buslogic</value>
                  <value>lsilogic</value>
                  <value>lsisas1068</value>
                  <value>vmpvscsi</value>
                  <value>ibmvscsi</value>
                  <value>virtio-scsi</value>
                  <value>lsisas1078</value>
                  <value>virtio-transitional</value>
                  <value>virtio-non-transitional</value>
                  <value>ncr53c90</value>
                  <value>dc390</value>
                  <value>am53c974</value>
                </choice>
              </attribute>
            </optional>
          </group>
          <!-- usb has an optional attribute "model",
               and optional subelements "master" and "ports" -->
          <group>
            <attribute name="type">
              <value>usb</value>
            </attribute>
            <optional>
              <attribute name="model">
                <choice>
                  <value>piix3-uhci</value>
                  <value>piix4-uhci</value>
                  <value>ehci</value>
                  <value>ich9-ehci1</value>
                  <value>ich9-uhci1</value>
                  <value>ich9-uhci2</value>
                  <value>ich9-uhci3</value>
                  <value>vt82c686b-uhci</value>
                  <value>pci-ohci</value>
                  <value>nec-xhci</value>
                  <value>none</value>
                  <value>qusb1</value>
                  <value>qusb2</value>
                  <value>qemu-xhci</value>
                </choice>
              </attribute>
            </optional>
            <optional>
              <ref name="usbmaster"/>
            </optional>
            <optional>
              <attribute name="ports">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
          </group>
          <!-- ide has an optional attribute "model" -->
          <group>
            <attribute name="type">
              <value>ide</value>
            </attribute>
            <optional>
              <attribute name="model">
                <choice>
                  <value>piix3</value>
                  <value>piix4</value>
                  <value>ich6</value>
                </choice>
              </attribute>
            </optional>
          </group>
          <!-- isa -->
          <group>
            <attribute name="type">
              <value>isa</value>
            </attribute>
          </group>
          <!-- pci has an optional attribute "model" -->
          <group>
            <attribute name="type">
              <value>pci</value>
            </attribute>
            <optional>
              <element name="model">
                <attribute name="name">
                  <choice>
                    <!-- implementations of "pci-root" -->
                    <value>spapr-pci-host-bridge</value>
                    <!-- implementations of "pci-bridge" -->
                    <value>pci-bridge</value>
                    <!-- implementations of "dmi-to-pci-bridge" -->
                    <value>i82801b11-bridge</value>
                    <!-- implementations of "pcie-to-pci-bridge" -->
                    <value>pcie-pci-bridge</value>
                    <!-- implementations of "pcie-root-port" -->
                    <value>ioh3420</value>
                    <value>pcie-root-port</value>
                    <!-- implementations of "pcie-switch-upstream-port" -->
                    <value>x3130-upstream</value>
                    <!-- implementations of "pcie-switch-downstream-port" -->
                    <value>xio3130-downstream</value>
                    <!-- implementations of "pci-expander-bus" -->
                    <value>pxb</value>
                    <!-- implementations of "pcie-expander-bus" -->
                    <value>pxb-pcie</value>
                  </choice>
                </attribute>
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="target">
                <optional>
                  <attribute name="chassisNr">
                    <ref name="uint8"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="chassis">
                    <ref name="uint8"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="port">
                    <ref name="uint8"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="busNr">
                    <ref name="uint8"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="index">
                    <ref name="uint8"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="hotplug">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <element name="node">
                    <ref name="unsignedInt"/>
                  </element>
                </optional>
              </element>
            </optional>
            <!-- *-root controllers have an optional element "pcihole64"-->
            <choice>
              <group>
                <attribute name="model">
                  <choice>
                    <value>pci-root</value>
                    <value>pcie-root</value>
                  </choice>
                </attribute>
                <optional>
                  <element name="pcihole64">
                    <ref name="scaledInteger"/>
                  </element>
                </optional>
              </group>
              <group>
                <attribute name="model">
                  <choice>
                    <value>pci-bridge</value>
                    <value>dmi-to-pci-bridge</value>
                    <value>pcie-to-pci-bridge</value>
                    <value>pcie-root-port</value>
                    <value>pcie-switch-upstream-port</value>
                    <value>pcie-switch-downstream-port</value>
                    <value>pci-expander-bus</value>
                    <value>pcie-expander-bus</value>
                  </choice>
                </attribute>
              </group>
            </choice>
          </group>
          <!-- virtio-serial has optional "ports" and "vectors" -->
          <group>
            <attribute name="type">
              <value>virtio-serial</value>
            </attribute>
            <optional>
              <attribute name="model">
                <choice>
                  <value>virtio</value>
                  <value>virtio-transitional</value>
                  <value>virtio-non-transitional</value>
                </choice>
              </attribute>
            </optional>
            <optional>
              <attribute name="ports">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="vectors">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
          </group>
          <!-- xenbus has an optional attribute "maxGrantFrames" -->
          <group>
            <attribute name="type">
              <value>xenbus</value>
            </attribute>
            <optional>
              <attribute name="maxGrantFrames">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="maxEventChannels">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
          </group>
        </choice>
        <optional>
          <element name="driver">
            <optional>
              <attribute name="queues">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="cmd_per_lun">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="max_sectors">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
            <optional>
              <ref name="ioeventfd"/>
            </optional>
            <optional>
              <ref name="driverIOThread"/>
            </optional>
            <ref name="virtioOptions"/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="filesystem">
    <element name="filesystem">
      <interleave>
        <choice>
          <group>
            <attribute name="type">
              <value>file</value>
            </attribute>
            <interleave>
              <optional>
                <ref name="fsDriver"/>
              </optional>
              <element name="source">
                <attribute name="file">
                  <ref name="absFilePath"/>
                </attribute>
                <empty/>
              </element>
            </interleave>
          </group>
          <group>
            <attribute name="type">
              <value>block</value>
            </attribute>
            <interleave>
              <optional>
                <ref name="fsDriver"/>
              </optional>
              <element name="source">
                <attribute name="dev">
                  <ref name="absFilePath"/>
                </attribute>
                <empty/>
              </element>
            </interleave>
          </group>
          <group>
            <!-- type="mount" is default -->
            <optional>
              <attribute name="type">
                <value>mount</value>
              </attribute>
            </optional>
            <interleave>
              <optional>
                <ref name="fsDriver"/>
              </optional>
              <optional>
                <ref name="fsBinary"/>
              </optional>
              <element name="source">
              <choice>
              <group>
                <attribute name="dir">
                  <ref name="absDirPath"/>
                </attribute>
              </group>
              <group>
              <attribute name="socket">
                <ref name="absFilePath"/>
              </attribute>
              </group>
              </choice>
                <empty/>
              </element>
            </interleave>
          </group>
          <group>
            <optional>
              <attribute name="type">
                <value>bind</value>
              </attribute>
            </optional>
            <interleave>
              <optional>
                <ref name="fsDriver"/>
              </optional>
              <element name="source">
                <attribute name="dir">
                  <ref name="absDirPath"/>
                </attribute>
                <empty/>
              </element>
            </interleave>
          </group>
          <group>
            <attribute name="type">
              <value>template</value>
            </attribute>
            <interleave>
              <optional>
                <ref name="fsDriver"/>
              </optional>
              <element name="source">
                <attribute name="name">
                  <ref name="genericName"/>
                </attribute>
                <empty/>
              </element>
            </interleave>
          </group>
          <group>
            <attribute name="type">
              <value>ram</value>
            </attribute>
            <interleave>
              <optional>
                <ref name="fsDriver"/>
              </optional>
              <element name="source">
                <attribute name="usage">
                  <ref name="unsignedLong"/>
                </attribute>
                <optional>
                  <attribute name="units">
                    <ref name="unit"/>
                  </attribute>
                </optional>
                <empty/>
              </element>
            </interleave>
          </group>
        </choice>
        <interleave>
          <optional>
          <element name="target">
            <attribute name="dir"/>
            <empty/>
          </element>
          </optional>
          <optional>
            <attribute name="accessmode">
              <choice>
                <value>passthrough</value>
                <value>mapped</value>
                <value>squash</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="multidevs">
              <choice>
                <value>default</value>
                <value>remap</value>
                <value>forbid</value>
                <value>warn</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="fmode">
              <ref name="createMode"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="dmode">
              <ref name="createMode"/>
            </attribute>
          </optional>
          <optional>
            <element name="readonly">
              <empty/>
            </element>
          </optional>
          <optional>
            <ref name="deviceBoot"/>
          </optional>
          <optional>
            <ref name="alias"/>
          </optional>
          <optional>
            <ref name="acpi"/>
          </optional>
          <optional>
            <ref name="address"/>
          </optional>
        </interleave>
        <interleave>
          <optional>
            <element name="space_hard_limit">
              <ref name="scaledInteger"/>
            </element>
          </optional>
          <optional>
            <element name="space_soft_limit">
              <ref name="scaledInteger"/>
            </element>
          </optional>
        </interleave>
        <optional>
          <attribute name="model">
            <choice>
              <value>virtio</value>
              <value>virtio-transitional</value>
              <value>virtio-non-transitional</value>
            </choice>
          </attribute>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="fsDriver">
    <element name="driver">
      <!-- Annoying inconsistency. "disk" uses "name"
           for this kind of info, and "type" for the
           storage format. We need the latter too, so
           had to invent a new attribute name -->
      <choice>
        <group>
          <optional>
            <attribute name="type">
              <choice>
                <value>path</value>
                <value>handle</value>
                <value>loop</value>
                <value>nbd</value>
                <value>ploop</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="format">
              <ref name="storageFormat"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="wrpolicy">
              <value>immediate</value>
            </attribute>
          </optional>
          <ref name="virtioOptions"/>
        </group>
        <group>
          <attribute name="type">
            <value>virtiofs</value>
          </attribute>
          <optional>
            <attribute name="queue">
              <ref name="unsignedInt"/>
            </attribute>
          </optional>
          <ref name="virtioOptions"/>
        </group>
        <empty/>
      </choice>
    </element>
  </define>
  <define name="fsBinary">
    <element name="binary">
      <optional>
        <attribute name="path">
          <ref name="absFilePath"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="xattr">
          <ref name="virOnOff"/>
        </attribute>
      </optional>
      <interleave>
        <optional>
          <element name="cache">
            <optional>
              <attribute name="mode">
                <choice>
                  <value>none</value>
                  <value>always</value>
                </choice>
              </attribute>
            </optional>
          </element>
        </optional>
        <optional>
          <element name="sandbox">
            <optional>
              <attribute name="mode">
                <choice>
                  <value>namespace</value>
                  <value>chroot</value>
                </choice>
              </attribute>
            </optional>
          </element>
        </optional>
        <optional>
          <element name="lock">
            <optional>
              <attribute name="posix">
                <ref name="virOnOff"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="flock">
                <ref name="virOnOff"/>
              </attribute>
            </optional>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="interface-network-attributes">
    <attribute name="network">
      <text/>
    </attribute>
    <optional>
      <attribute name="portgroup">
        <ref name="deviceName"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="portid">
        <ref name="UUID"/>
      </attribute>
    </optional>
  </define>

  <define name="interface-bridge-attributes">
    <attribute name="bridge">
      <data type="string">
        <param name="pattern">[a-zA-Z0-9_\.\-\\:/ ]*</param>
      </data>
    </attribute>
    <optional>
      <attribute name="macTableManager">
        <ref name="macTableManager"/>
      </attribute>
    </optional>
  </define>

  <!--
      An interface description can either be of type bridge in which case
      it will use a bridging source, or of type ethernet which uses a device
      source and a device target instead. They both share a set of interface
      options. FIXME
    -->
  <define name="interface">
    <element name="interface">
      <choice>
        <group>
          <attribute name="type">
            <value>bridge</value>
          </attribute>
          <interleave>
            <optional>
              <element name="source">
                <ref name="interface-bridge-attributes"/>
                <optional>
                  <ref name="interface-network-attributes"/>
                </optional>
                <empty/>
              </element>
            </optional>
            <optional>
              <ref name="virtualPortProfile"/>
            </optional>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>ethernet</value>
          </attribute>
          <interleave>
            <optional>
              <element name="source">
                <ref name="interface-ip-info"/>
              </element>
            </optional>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>vhostuser</value>
          </attribute>
          <interleave>
            <ref name="unixSocketSource"/>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>network</value>
          </attribute>
          <interleave>
            <element name="source">
              <ref name="interface-network-attributes"/>
              <optional>
                <ref name="interface-bridge-attributes"/>
              </optional>
              <empty/>
            </element>
            <optional>
              <ref name="virtualPortProfile"/>
            </optional>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>direct</value>
          </attribute>
          <interleave>
            <element name="source">
              <attribute name="dev">
                <ref name="deviceName"/>
              </attribute>
              <optional>
                <attribute name="mode">
                  <ref name="bridgeMode"/>
                </attribute>
              </optional>
              <optional>
                <ref name="interface-network-attributes"/>
              </optional>
              <empty/>
            </element>
            <optional>
              <ref name="virtualPortProfile"/>
            </optional>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>user</value>
          </attribute>
          <interleave>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>internal</value>
          </attribute>
          <interleave>
            <element name="source">
              <attribute name="name">
                <ref name="deviceName"/>
              </attribute>
              <empty/>
            </element>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <choice>
              <value>mcast</value>
              <value>client</value>
            </choice>
          </attribute>
          <interleave>
            <element name="source">
              <attribute name="address">
                <ref name="ipv4Addr"/>
              </attribute>
              <attribute name="port">
                <ref name="PortNumber"/>
              </attribute>
              <empty/>
            </element>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>udp</value>
          </attribute>
          <interleave>
            <element name="source">
              <attribute name="address">
                <ref name="ipv4Addr"/>
              </attribute>
              <attribute name="port">
                <ref name="PortNumber"/>
              </attribute>
              <element name="local">
                <attribute name="address">
                  <ref name="ipv4Addr"/>
                </attribute>
                <attribute name="port">
                  <ref name="PortNumber"/>
                </attribute>
                <empty/>
              </element>
            </element>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>server</value>
          </attribute>
          <interleave>
            <element name="source">
              <optional>
                <attribute name="address">
                  <ref name="ipv4Addr"/>
                </attribute>
              </optional>
              <attribute name="port">
                <ref name="PortNumber"/>
              </attribute>
              <empty/>
            </element>
            <ref name="interface-options"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>hostdev</value>
          </attribute>
          <optional>
            <attribute name="managed">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <interleave>
            <element name="source">
              <optional>
                <attribute name="missing">
                  <ref name="virYesNo"/>
                </attribute>
              </optional>
              <choice>
                <group>
                  <ref name="usbproduct"/>
                  <optional>
                    <ref name="usbaddress"/>
                  </optional>
                </group>
                <element name="address">
                  <choice>
                    <group>
                      <attribute name="type">
                        <value>pci</value>
                      </attribute>
                      <ref name="pciaddress"/>
                    </group>
                    <group>
                      <attribute name="type">
                        <value>usb</value>
                      </attribute>
                      <attribute name="bus">
                        <ref name="usbAddr"/>
                      </attribute>
                      <attribute name="device">
                        <ref name="usbAddr"/>
                      </attribute>
                    </group>
                  </choice>
                </element>
              </choice>
            </element>
            <optional>
              <ref name="virtualPortProfile"/>
            </optional>
            <ref name="interface-options"/>
          </interleave>
        </group>

        <group>
          <attribute name="type">
            <value>vdpa</value>
          </attribute>
          <interleave>
            <element name="source">
              <attribute name="dev">
                <ref name="deviceName"/>
              </attribute>
            </element>
            <ref name="interface-options"/>
          </interleave>
        </group>

      </choice>
      <optional>
        <attribute name="trustGuestRxFilters">
          <ref name="virYesNo"/>
        </attribute>
      </optional>
    </element>
  </define>
  <!--
      The interface options possible are:
        - the MAC address
        - the IP address bound to the interface
        - the name of the script used to set up the binding
        - the target device used
        - boot order
        - link state
    -->
  <define name="interface-options">
    <interleave>
      <optional>
        <element name="link">
          <attribute name="state">
            <choice>
              <value>up</value>
              <value>down</value>
            </choice>
          </attribute>
          <empty/>
        </element>
      </optional>
      <optional>
        <ref name="mtu"/>
      </optional>
      <optional>
        <ref name="coalesce"/>
      </optional>
      <optional>
        <element name="target">
          <attribute name="dev">
            <ref name="deviceName"/>
          </attribute>
          <optional>
            <attribute name="managed">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="guest">
          <interleave>
            <optional>
              <attribute name="dev">
                <ref name="deviceName"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="actual">
                <ref name="deviceName"/>
              </attribute>
            </optional>
          </interleave>
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="mac">
          <attribute name="address">
            <ref name="uniMacAddr"/>
          </attribute>
          <optional>
            <attribute name="type">
              <choice>
                <value>generated</value>
                <value>static</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="check">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <empty/>
        </element>
      </optional>
      <ref name="interface-ip-info"/>
      <optional>
        <element name="script">
          <attribute name="path">
            <ref name="filePath"/>
          </attribute>
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="downscript">
          <attribute name="path">
            <ref name="filePath"/>
          </attribute>
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="backenddomain">
          <attribute name="name">
            <ref name="objectNameWithSlash"/>
          </attribute>
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="model">
          <attribute name="type">
            <data type="string">
              <param name="pattern">[a-zA-Z0-9\-_]+</param>
            </data>
          </attribute>
          <empty/>
        </element>
      </optional>
      <optional>
        <element name="backend">
          <optional>
            <attribute name="tap">
              <ref name="absFilePath"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="vhost">
              <ref name="absFilePath"/>
            </attribute>
          </optional>
        </element>
      </optional>
      <optional>
        <element name="driver">
          <choice>
            <group>
              <attribute name="name">
                <choice>
                  <value>kvm</value>
                  <value>vfio</value>
                  <value>xen</value>
                </choice>
              </attribute>
            </group>
            <group>
              <optional>
                <attribute name="name">
                  <choice>
                    <value>qemu</value>
                    <value>vhost</value>
                  </choice>
                </attribute>
              </optional>
              <optional>
                <attribute name="queues">
                  <ref name="positiveInteger"/>
                </attribute>
              </optional>
              <optional>
                <attribute name="rx_queue_size">
                  <ref name="positiveInteger"/>
                </attribute>
              </optional>
              <optional>
                <attribute name="tx_queue_size">
                  <ref name="positiveInteger"/>
                </attribute>
              </optional>
              <optional>
                <attribute name="txmode">
                  <choice>
                    <value>iothread</value>
                    <value>timer</value>
                  </choice>
                </attribute>
              </optional>
              <optional>
                <ref name="ioeventfd"/>
              </optional>
              <optional>
                <ref name="event_idx"/>
              </optional>
            </group>
          </choice>
          <ref name="virtioOptions"/>
          <interleave>
            <optional>
              <element name="host">
                <optional>
                  <attribute name="csum">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="gso">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="tso4">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="tso6">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="ecn">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="ufo">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="mrg_rxbuf">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
              </element>
            </optional>
            <optional>
              <element name="guest">
                <optional>
                  <attribute name="csum">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="tso4">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="tso6">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="ecn">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="ufo">
                    <ref name="virOnOff"/>
                  </attribute>
                </optional>
              </element>
            </optional>
          </interleave>
        </element>
      </optional>
      <optional>
        <ref name="alias"/>
      </optional>
      <optional>
        <ref name="acpi"/>
      </optional>
      <optional>
        <ref name="address"/>
      </optional>
      <optional>
        <element name="filterref">
          <ref name="filterref-node-attributes"/>
        </element>
      </optional>
      <optional>
        <element name="tune">
          <optional>
            <!-- size of send buffer for network tap devices -->
            <element name="sndbuf">
              <ref name="unsignedInt"/>
            </element>
          </optional>
        </element>
      </optional>
      <optional>
        <ref name="deviceBoot"/>
      </optional>
      <optional>
        <ref name="rom"/>
      </optional>
      <optional>
        <ref name="bandwidth"/>
      </optional>
      <optional>
        <ref name="vlan"/>
      </optional>
      <optional>
        <ref name="portOptions"/>
      </optional>
      <optional>
        <ref name="teaming"/>
      </optional>
    </interleave>
  </define>

  <!--
      All ip-related info for either the host or guest side of an interface
  -->
  <define name="interface-ip-info">
    <zeroOrMore>
      <element name="ip">
        <attribute name="address">
          <ref name="ipAddr"/>
        </attribute>
        <optional>
          <attribute name="family">
            <ref name="addr-family"/>
          </attribute>
        </optional>
        <optional>
          <attribute name="prefix">
            <ref name="ipPrefix"/>
          </attribute>
        </optional>
        <optional>
          <attribute name="peer">
            <ref name="ipAddr"/>
          </attribute>
        </optional>
        <empty/>
      </element>
    </zeroOrMore>
    <zeroOrMore>
      <ref name="route"/>
    </zeroOrMore>
  </define>

  <define name="teaming">
    <element name="teaming">
      <choice>
        <group>
          <attribute name="type">
            <value>persistent</value>
          </attribute>
        </group>
        <group>
          <attribute name="type">
            <value>transient</value>
          </attribute>
          <attribute name="persistent">
            <ref name="aliasName"/>
          </attribute>
        </group>
      </choice>
    </element>
  </define>

  <!--
      An emulator description is just a path to the binary used for the task
    -->
  <define name="emulator">
    <element name="emulator">
      <ref name="absFilePath"/>
    </element>
  </define>
  <!--
      A graphic description (SPICE, VNC, SDL, ...)
    -->
  <define name="graphic">
    <element name="graphics">
      <choice>
        <group>
          <attribute name="type">
            <value>sdl</value>
          </attribute>
          <optional>
            <attribute name="display">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="xauth">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="fullscreen">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <optional>
            <element name="gl">
              <attribute name="enable">
                <ref name="virYesNo"/>
              </attribute>
              <empty/>
            </element>
          </optional>
        </group>
        <group>
          <attribute name="type">
            <value>vnc</value>
          </attribute>
          <choice>
            <group>
              <optional>
                <attribute name="port">
                  <ref name="PortNumber"/>
                </attribute>
              </optional>
              <optional>
                <attribute name="autoport">
                  <ref name="virYesNo"/>
                </attribute>
              </optional>
              <optional>
                <attribute name="websocket">
                  <ref name="PortNumber"/>
                </attribute>
              </optional>
              <optional>
                <attribute name="listen">
                  <ref name="addrIPorName"/>
                </attribute>
              </optional>
              <optional>
                <attribute name="sharePolicy">
                  <choice>
                    <value>allow-exclusive</value>
                    <value>force-shared</value>
                    <value>ignore</value>
                  </choice>
                </attribute>
              </optional>
              <optional>
                <attribute name="powerControl">
                  <ref name="virYesNo"/>
                </attribute>
              </optional>
            </group>
            <group>
              <optional>
                <attribute name="socket">
                  <ref name="absFilePath"/>
                </attribute>
              </optional>
            </group>
          </choice>
          <optional>
            <attribute name="passwd">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="keymap">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="passwdValidTo">
              <data type="dateTime"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="connected">
              <value>keep</value>
            </attribute>
          </optional>
          <interleave>
            <optional>
              <element name="audio">
                <attribute name="id">
                  <ref name="uint8"/>
                </attribute>
              </element>
            </optional>
            <ref name="listenElements"/>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>spice</value>
          </attribute>
          <optional>
            <attribute name="port">
              <ref name="PortNumber"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="tlsPort">
              <ref name="PortNumber"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="autoport">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="listen">
              <ref name="addrIPorName"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="passwd">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="keymap">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="passwdValidTo">
              <data type="dateTime"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="connected">
              <choice>
                <value>fail</value>
                <value>disconnect</value>
                <value>keep</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="defaultMode">
              <choice>
                <value>any</value>
                <value>secure</value>
                <value>insecure</value>
              </choice>
            </attribute>
          </optional>
          <interleave>
            <ref name="listenElements"/>
            <zeroOrMore>
              <element name="channel">
                <attribute name="name">
                  <choice>
                    <value>main</value>
                    <value>display</value>
                    <value>inputs</value>
                    <value>cursor</value>
                    <value>playback</value>
                    <value>record</value>
                    <value>smartcard</value>
                    <value>usbredir</value>
                  </choice>
                </attribute>
                <attribute name="mode">
                  <choice>
                    <value>any</value>
                    <value>secure</value>
                    <value>insecure</value>
                  </choice>
                </attribute>
                <empty/>
              </element>
            </zeroOrMore>
            <optional>
              <element name="image">
                <attribute name="compression">
                  <choice>
                    <value>auto_glz</value>
                    <value>auto_lz</value>
                    <value>quic</value>
                    <value>glz</value>
                    <value>lz</value>
                    <value>off</value>
                  </choice>
                </attribute>
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="jpeg">
                <attribute name="compression">
                  <choice>
                    <value>auto</value>
                    <value>never</value>
                    <value>always</value>
                  </choice>
                </attribute>
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="zlib">
                <attribute name="compression">
                  <choice>
                    <value>auto</value>
                    <value>never</value>
                    <value>always</value>
                  </choice>
                </attribute>
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="playback">
                <attribute name="compression">
                  <ref name="virOnOff"/>
                </attribute>
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="streaming">
                <attribute name="mode">
                  <choice>
                    <value>filter</value>
                    <value>all</value>
                    <value>off</value>
                  </choice>
                </attribute>
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="clipboard">
                <attribute name="copypaste">
                  <ref name="virYesNo"/>
                </attribute>
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="mouse">
                <attribute name="mode">
                  <choice>
                    <value>server</value>
                    <value>client</value>
                  </choice>
                </attribute>
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="filetransfer">
                <attribute name="enable">
                  <ref name="virYesNo"/>
                </attribute>
                <empty/>
              </element>
            </optional>
            <optional>
              <element name="gl">
                <attribute name="enable">
                  <ref name="virYesNo"/>
                </attribute>
                <optional>
                  <attribute name="rendernode">
                    <ref name="absFilePath"/>
                  </attribute>
                </optional>
                <empty/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>rdp</value>
          </attribute>
          <optional>
            <attribute name="port">
              <ref name="PortNumber"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="autoport">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="replaceUser">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="multiUser">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="listen">
              <ref name="addrIPorName"/>
            </attribute>
          </optional>
          <ref name="listenElements"/>
        </group>
        <group>
          <attribute name="type">
            <value>desktop</value>
          </attribute>
          <optional>
            <attribute name="display">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="fullscreen">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
        </group>
        <group>
          <attribute name="type">
            <value>egl-headless</value>
          </attribute>
          <optional>
            <element name="gl">
              <optional>
                <attribute name="rendernode">
                  <ref name="absFilePath"/>
                </attribute>
              </optional>
            </element>
          </optional>
        </group>
      </choice>
    </element>
  </define>

  <define name="listenElements">
    <zeroOrMore>
      <element name="listen">
        <choice>
          <group>
            <attribute name="type">
              <value>address</value>
            </attribute>
            <optional>
              <attribute name="address">
                <ref name="addrIPorName"/>
              </attribute>
            </optional>
          </group>
          <group>
            <attribute name="type">
              <value>network</value>
            </attribute>
            <attribute name="network">
              <text/>
            </attribute>
            <optional>
              <attribute name="address">
                <ref name="addrIPorName"/>
              </attribute>
            </optional>
          </group>
          <group>
            <attribute name="type">
              <value>socket</value>
            </attribute>
            <optional>
              <attribute name="socket">
                <ref name="absFilePath"/>
              </attribute>
            </optional>
          </group>
          <group>
            <attribute name="type">
              <value>none</value>
            </attribute>
          </group>
        </choice>
      </element>
    </zeroOrMore>
  </define>
  <!--
     A video adapter description, allowing configuration of device
     model, number of virtual heads, video ram size, and for qxl
     both ram bar sizes.
   -->
  <define name="video">
    <element name="video">
      <interleave>
        <optional>
          <element name="driver">
            <optional>
              <ref name="virtioOptions"/>
            </optional>
            <optional>
              <attribute name="name">
                <choice>
                  <value>qemu</value>
                  <value>vhostuser</value>
                </choice>
              </attribute>
            </optional>
            <optional>
              <attribute name="vgaconf">
                <choice>
                  <value>io</value>
                  <value>on</value>
                  <value>off</value>
                </choice>
              </attribute>
            </optional>
          </element>
        </optional>
        <optional>
          <element name="model">
            <choice>
              <attribute name="type">
                <choice>
                  <value>vga</value>
                  <value>cirrus</value>
                  <value>vmvga</value>
                  <value>xen</value>
                  <value>vbox</value>
                  <value>virtio</value>
                  <value>gop</value>
                  <value>none</value>
                  <value>bochs</value>
                  <value>ramfb</value>
                </choice>
              </attribute>
              <group>
                <attribute name="type">
                  <value>qxl</value>
                </attribute>
                <optional>
                  <attribute name="ram">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="vgamem">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="vram64">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
              </group>
            </choice>
            <optional>
              <attribute name="vram">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="heads">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="primary">
                <ref name="virYesNo"/>
              </attribute>
            </optional>
            <optional>
              <element name="acceleration">
                <optional>
                  <attribute name="accel3d">
                    <ref name="virYesNo"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="accel2d">
                    <ref name="virYesNo"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="rendernode">
                    <ref name="absFilePath"/>
                  </attribute>
                </optional>
              </element>
            </optional>
            <optional>
              <element name="resolution">
                <attribute name="x">
                  <ref name="unsignedInt"/>
                </attribute>
                <attribute name="y">
                  <ref name="unsignedInt"/>
                </attribute>
              </element>
            </optional>
          </element>
        </optional>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
      </interleave>
    </element>
  </define>
  <!--
      When a certain event happens, multiple policies can be applied
      depends on what happened:
    -->
  <define name="events">
    <interleave>
      <optional>
        <element name="on_reboot">
          <ref name="offOptions"/>
        </element>
      </optional>
      <optional>
        <element name="on_poweroff">
          <ref name="offOptions"/>
        </element>
      </optional>
      <optional>
        <element name="on_crash">
          <ref name="crashOptions"/>
        </element>
      </optional>
      <optional>
        <element name="on_lockfailure">
          <ref name="lockfailureOptions"/>
        </element>
      </optional>
    </interleave>
  </define>
  <!--
      Options when a domain terminates:
      destroy: The domain is cleaned up
      restart: A new domain is started in place of the old one
      preserve: The domain will remain in memory until it is destroyed manually
      rename-restart: a variant of the previous one but where the old domain is
                      renamed before being saved to allow a restart
    -->
  <define name="offOptions">
    <choice>
      <value>destroy</value>
      <value>restart</value>
      <value>preserve</value>
      <value>rename-restart</value>
    </choice>
  </define>
  <!--
      Options when a domain crashes:
      destroy: The domain is cleaned up
      restart: A new domain is started in place of the old one
      preserve: The domain will remain in memory until it is destroyed manually
      rename-restart: a variant of the previous one but where the old domain is
                      renamed before being saved to allow a restart
      coredump-destroy: The crashed domain's core will be dumped, and then the
                        domain will be terminated completely and all resources
                        released
      coredump-restart: The crashed domain's core will be dumped, and then the
                        domain will be restarted with the same configuration
    -->
  <define name="crashOptions">
    <choice>
      <value>destroy</value>
      <value>restart</value>
      <value>preserve</value>
      <value>rename-restart</value>
      <value>coredump-destroy</value>
      <value>coredump-restart</value>
    </choice>
  </define>
  <!--
      Options when resource locks are lost:
      poweroff: power off the domain
      restart: power off the domain and start it up again to reacquire the
               locks
      pause: pause the execution of the domain so that it can be manually
             resumed when lock issues are solved
      ignore: keep the domain running
  -->
  <define name="lockfailureOptions">
    <choice>
      <value>poweroff</value>
      <value>restart</value>
      <value>pause</value>
      <value>ignore</value>
    </choice>
  </define>
  <!--
      Control ACPI sleep states (dis)allowed for the domain
      For each of the states the following rules apply:
      on: the state will be forcefully enabled
      off: the state will be forcefully disabled
      not specified: hypervisor will be left to decide its defaults
  -->
  <define name="pm">
    <element name="pm">
      <interleave>
        <optional>
          <element name="suspend-to-mem">
            <ref name="suspendChoices"/>
          </element>
        </optional>
        <optional>
          <element name="suspend-to-disk">
            <ref name="suspendChoices"/>
          </element>
        </optional>
      </interleave>
      <empty/>
    </element>
  </define>
  <define name="suspendChoices">
    <optional>
      <attribute name="enabled">
        <ref name="virYesNo"/>
      </attribute>
    </optional>
  </define>
  <!--
      Specific setup for a qemu emulated character device.  Note: this
      definition doesn't fully specify the constraints on this node.
    -->
  <define name="qemucdev">
    <ref name="qemucdevSrcType"/>
    <optional>
      <attribute name="tty">
        <ref name="absFilePath"/>
      </attribute>
    </optional>
    <interleave>
      <ref name="qemucdevSrcDef"/>
      <optional>
        <ref name="qemucdevTgtDef"/>
      </optional>
      <optional>
        <ref name="alias"/>
      </optional>
      <optional>
        <ref name="acpi"/>
      </optional>
      <optional>
        <ref name="address"/>
      </optional>
    </interleave>
  </define>

  <define name="qemucdevConsoleTgtType">
    <attribute name="type">
      <choice>
        <value>xen</value>
        <value>serial</value>
        <value>uml</value> <!-- NOT USED ANYMORE -->
        <value>virtio</value>
        <value>lxc</value>
        <value>openvz</value>
        <value>sclp</value>
        <value>sclplm</value>
      </choice>
    </attribute>
  </define>

  <define name="qemucdevSerialTgtType">
    <attribute name="type">
      <choice>
        <value>isa-serial</value>
        <value>usb-serial</value>
        <value>pci-serial</value>
        <value>spapr-vio-serial</value>
        <value>system-serial</value>
        <value>sclp-serial</value>
      </choice>
    </attribute>
  </define>

  <define name="qemucdevSerialTgtModel">
    <element name="model">
      <attribute name="name">
        <choice>
          <value>isa-serial</value>
          <value>usb-serial</value>
          <value>pci-serial</value>
          <value>spapr-vty</value>
          <value>pl011</value>
          <value>16550a</value>
          <value>sclpconsole</value>
          <value>sclplmconsole</value>
        </choice>
      </attribute>
    </element>
  </define>

  <define  name="qemucdevTgtDef">
    <element name="target">
      <interleave>
        <choice>
          <optional>
            <ref name="qemucdevConsoleTgtType"/>
          </optional>
          <optional>
            <ref name="qemucdevSerialTgtType"/>
          </optional>
        </choice>
        <optional>
          <attribute name="port"/>
        </optional>
        <optional>
          <ref name="qemucdevSerialTgtModel"/>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="qemucdevSrcTypeChoice">
    <choice>
      <value>dev</value>
      <value>file</value>
      <value>pipe</value>
      <value>unix</value>
      <value>tcp</value>
      <value>udp</value>
      <value>null</value>
      <value>stdio</value>
      <value>vc</value>
      <value>pty</value>
      <value>spicevmc</value>
      <value>spiceport</value>
      <value>nmdm</value>
    </choice>
  </define>

  <define name="usbdevfilter">
    <element name="usbdev">
      <attribute name="allow">
        <ref name="virYesNo"/>
      </attribute>
      <optional>
        <attribute name="class">
          <choice>
            <ref name="usbClass"/>
            <ref name="usbIdDefault"/>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="vendor">
          <choice>
            <ref name="usbId"/>
            <ref name="usbIdDefault"/>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="product">
          <choice>
            <ref name="usbId"/>
            <ref name="usbIdDefault"/>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="version">
          <choice>
            <ref name="usbVersion"/>
            <ref name="usbIdDefault"/>
          </choice>
        </attribute>
      </optional>
    </element>
  </define>

  <define name="qemucdevSrcType">
    <attribute name="type">
      <ref name="qemucdevSrcTypeChoice"/>
    </attribute>
  </define>
  <define name="qemucdevSrcDef">
    <zeroOrMore>
      <element name="source">
        <optional>
          <attribute name="mode"/>
        </optional>
        <optional>
          <attribute name="path"/>
        </optional>
        <optional>
          <attribute name="host"/>
        </optional>
        <optional>
          <attribute name="service"/>
        </optional>
        <optional>
          <attribute name="channel"/>
        </optional>
        <optional>
          <attribute name="master"/>
        </optional>
        <optional>
          <attribute name="slave"/>
        </optional>
        <optional>
          <attribute name="append">
            <ref name="virOnOff"/>
          </attribute>
        </optional>
        <optional>
          <attribute name="tls">
            <ref name="virYesNo"/>
          </attribute>
        </optional>
        <optional>
          <ref name="reconnect"/>
        </optional>
        <zeroOrMore>
          <ref name="devSeclabel"/>
        </zeroOrMore>
      </element>
    </zeroOrMore>
    <optional>
      <element name="protocol">
        <optional>
          <attribute name="type">
            <choice>
              <value>raw</value>
              <value>telnet</value>
              <value>telnets</value>
              <value>tls</value>
            </choice>
          </attribute>
        </optional>
      </element>
    </optional>
    <optional>
      <element name="log">
        <attribute name="file">
          <ref name="absFilePath"/>
        </attribute>
        <optional>
          <attribute name="append">
            <ref name="virOnOff"/>
          </attribute>
        </optional>
      </element>
    </optional>
  </define>
  <!--
      The description for a console
      just a tty device
    -->
  <define name="console">
    <element name="console">
      <choice>
        <group>
          <optional>
            <attribute name="tty">
              <ref name="absFilePath"/>
            </attribute>
          </optional>
          <empty/>
        </group>
        <ref name="qemucdev"/>
      </choice>
    </element>
  </define>
  <define name="codec">
    <element name="codec">
      <attribute name="type">
        <choice>
          <value>duplex</value>
          <value>micro</value>
          <value>output</value>
        </choice>
      </attribute>
    </element>
  </define>
  <define name="sound">
    <element name="sound">
      <attribute name="model">
        <choice>
          <value>sb16</value>
          <value>es1370</value>
          <value>pcspk</value>
          <value>ac97</value>
          <value>ich6</value>
          <value>ich7</value>
          <value>ich9</value>
          <value>usb</value>
        </choice>
      </attribute>
      <interleave>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
        <optional>
          <element name="audio">
            <attribute name="id">
              <ref name="uint8"/>
            </attribute>
          </element>
        </optional>
        <zeroOrMore>
          <ref name="codec"/>
        </zeroOrMore>
      </interleave>
    </element>
  </define>

  <define name="audiocommonattr">
    <optional>
      <attribute name="mixingEngine">
        <ref name="virYesNo"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="fixedSettings">
        <ref name="virYesNo"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="voices">
        <ref name="uint32"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="bufferLength">
        <ref name="uint32"/>
      </attribute>
    </optional>
  </define>

  <define name="audiocommonchild">
    <optional>
      <element name="settings">
        <optional>
          <attribute name="frequency">
            <ref name="uint32"/>
          </attribute>
        </optional>
        <optional>
          <attribute name="channels">
            <ref name="uint32"/>
          </attribute>
        </optional>
        <optional>
          <attribute name="format">
            <choice>
              <value>s8</value>
              <value>u8</value>
              <value>s16</value>
              <value>u16</value>
              <value>s32</value>
              <value>u32</value>
              <value>f32</value>
            </choice>
          </attribute>
        </optional>
      </element>
    </optional>
  </define>

  <define name="audionone">
    <ref name="audiocommonattr"/>
    <ref name="audiocommonchild"/>
  </define>

  <define name="audioalsa">
    <ref name="audiocommonattr"/>
    <optional>
      <attribute name="dev">
        <ref name="filePath"/>
      </attribute>
    </optional>
    <ref name="audiocommonchild"/>
  </define>

  <define name="audiocoreaudio">
    <ref name="audiocommonattr"/>
    <optional>
      <attribute name="bufferCount">
        <ref name="uint32"/>
      </attribute>
    </optional>
    <ref name="audiocommonchild"/>
  </define>

  <define name="audiojack">
    <ref name="audiocommonattr"/>
    <optional>
      <attribute name="serverName">
        <data type="string"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="clientName">
        <data type="string"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="connectPorts">
        <data type="string"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="exactName">
        <ref name="virYesNo"/>
      </attribute>
    </optional>
    <ref name="audiocommonchild"/>
  </define>

  <define name="audiooss">
    <ref name="audiocommonattr"/>
    <optional>
      <attribute name="dev">
        <ref name="deviceName"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="bufferCount">
        <ref name="uint32"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="tryPoll">
        <ref name="virYesNo"/>
      </attribute>
    </optional>
    <ref name="audiocommonchild"/>
  </define>

  <define name="audiopulseaudio">
    <ref name="audiocommonattr"/>
    <optional>
      <attribute name="name">
        <data type="string"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="streamName">
        <data type="string"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="latency">
        <ref name="uint32"/>
      </attribute>
    </optional>
    <ref name="audiocommonchild"/>
  </define>

  <define name="audiosdl">
    <ref name="audiocommonattr"/>
    <optional>
      <attribute name="bufferCount">
        <ref name="uint32"/>
      </attribute>
    </optional>
    <ref name="audiocommonchild"/>
  </define>

  <define name="audiospice">
    <ref name="audiocommonattr"/>
    <ref name="audiocommonchild"/>
  </define>

  <define name="audiofile">
    <ref name="audiocommonattr"/>
    <ref name="audiocommonchild"/>
  </define>

  <define name="audio">
    <element name="audio">
      <attribute name="id">
        <ref name="uint8"/>
      </attribute>
      <choice>
        <group>
          <attribute name="type">
            <value>none</value>
          </attribute>
          <interleave>
            <optional>
              <element name="input">
                <ref name="audionone"/>
              </element>
            </optional>
            <optional>
              <element name="output">
                <ref name="audionone"/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>alsa</value>
          </attribute>
          <interleave>
            <optional>
              <element name="input">
                <ref name="audioalsa"/>
              </element>
            </optional>
            <optional>
              <element name="output">
                <ref name="audioalsa"/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>coreaudio</value>
          </attribute>
          <interleave>
            <optional>
              <element name="input">
                <ref name="audiocoreaudio"/>
              </element>
            </optional>
            <optional>
              <element name="output">
                <ref name="audiocoreaudio"/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>jack</value>
          </attribute>
          <interleave>
            <optional>
              <element name="input">
                <ref name="audiojack"/>
              </element>
            </optional>
            <optional>
              <element name="output">
                <ref name="audiojack"/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <choice>
              <value>oss</value>
            </choice>
          </attribute>
          <optional>
            <attribute name="tryMMap">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="exclusive">
              <ref name="virYesNo"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="dspPolicy">
              <data type="int"/>
            </attribute>
          </optional>
          <interleave>
            <optional>
              <element name="input">
                <ref name="audiooss"/>
              </element>
            </optional>
            <optional>
              <element name="output">
                <ref name="audiooss"/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>pulseaudio</value>
          </attribute>
          <optional>
            <attribute name="serverName">
              <data type="string"/>
            </attribute>
          </optional>
          <interleave>
            <optional>
              <element name="input">
                <ref name="audiopulseaudio"/>
              </element>
            </optional>
            <optional>
              <element name="output">
                <ref name="audiopulseaudio"/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>sdl</value>
          </attribute>
          <optional>
            <attribute name="driver">
              <choice>
                <value>esd</value>
                <value>alsa</value>
                <value>arts</value>
                <value>pulseaudio</value>
              </choice>
            </attribute>
          </optional>
          <interleave>
            <optional>
              <element name="input">
                <ref name="audiosdl"/>
              </element>
            </optional>
            <optional>
              <element name="output">
                <ref name="audiosdl"/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>spice</value>
          </attribute>
          <interleave>
            <optional>
              <element name="input">
                <ref name="audiospice"/>
              </element>
            </optional>
            <optional>
              <element name="output">
                <ref name="audiospice"/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>file</value>
          </attribute>
          <optional>
            <attribute name="path">
              <ref name="filePath"/>
            </attribute>
          </optional>
          <interleave>
            <optional>
              <element name="input">
                <ref name="audiofile"/>
              </element>
            </optional>
            <optional>
              <element name="output">
                <ref name="audiofile"/>
              </element>
            </optional>
          </interleave>
        </group>
      </choice>
    </element>
  </define>
  <define name="watchdog">
    <element name="watchdog">
      <attribute name="model">
        <choice>
          <value>i6300esb</value>
          <value>ib700</value>
          <value>diag288</value>
        </choice>
      </attribute>
      <optional>
        <attribute name="action">
          <choice>
            <value>reset</value>
            <value>shutdown</value>
            <value>poweroff</value>
            <value>pause</value>
            <value>none</value>
            <value>dump</value>
            <value>inject-nmi</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <ref name="alias"/>
      </optional>
      <optional>
        <ref name="acpi"/>
      </optional>
      <optional>
        <ref name="address"/>
      </optional>
    </element>
  </define>
  <define name="nvram">
    <element name="nvram">
      <optional>
        <ref name="address"/>
      </optional>
    </element>
  </define>

  <define name="shmem">
    <element name="shmem">
      <attribute name="name">
        <data type="string">
          <param name="pattern">[^/]*</param>
        </data>
      </attribute>
      <optional>
        <attribute name="role">
          <choice>
            <value>master</value>
            <value>peer</value>
          </choice>
        </attribute>
      </optional>
      <interleave>
        <optional>
          <element name="model">
            <attribute name="type">
              <choice>
                <value>ivshmem</value>
                <value>ivshmem-plain</value>
                <value>ivshmem-doorbell</value>
              </choice>
            </attribute>
          </element>
        </optional>
        <optional>
          <element name="size">
            <ref name="scaledInteger"/>
          </element>
        </optional>
        <optional>
          <element name="server">
            <optional>
              <attribute name="path">
                <ref name="absFilePath"/>
              </attribute>
            </optional>
          </element>
        </optional>
        <optional>
          <element name="msi">
            <optional>
              <ref name="ioeventfd"/>
            </optional>
            <optional>
              <attribute name="vectors">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
          </element>
        </optional>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="memballoon">
    <element name="memballoon">
      <attribute name="model">
        <choice>
          <value>virtio</value>
          <value>virtio-transitional</value>
          <value>virtio-non-transitional</value>
          <value>xen</value>
          <value>none</value>
        </choice>
      </attribute>
      <optional>
        <attribute name="autodeflate">
          <ref name="virOnOff"/>
        </attribute>
      </optional>
      <optional>
         <attribute name="freePageReporting">
           <ref name="virOnOff"/>
         </attribute>
       </optional>
      <interleave>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
        <optional>
          <element name="stats">
            <attribute name="period">
              <ref name="positiveInteger"/>
            </attribute>
          </element>
        </optional>
        <optional>
          <element name="driver">
            <ref name="virtioOptions"/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="parallel">
    <element name="parallel">
      <ref name="qemucdev"/>
    </element>
  </define>
  <define name="serial">
    <element name="serial">
      <ref name="qemucdev"/>
    </element>
  </define>
  <define name="guestfwdTarget">
    <element name="target">
      <attribute name="type">
        <value>guestfwd</value>
      </attribute>
      <attribute name="address"/>
      <attribute name="port"/>
    </element>
  </define>
  <define name="virtioTarget">
    <element name="target">
      <attribute name="type">
        <value>virtio</value>
      </attribute>
      <optional>
        <attribute name="name"/>
      </optional>
      <optional>
        <attribute name="state">
          <choice>
            <value>connected</value>
            <value>disconnected</value>
          </choice>
        </attribute>
      </optional>
    </element>
  </define>
  <define name="xenTarget">
    <element name="target">
      <attribute name="type">
        <value>xen</value>
      </attribute>
      <optional>
        <attribute name="name"/>
      </optional>
    </element>
  </define>
  <define name="channel">
    <element name="channel">
      <ref name="qemucdevSrcType"/>
      <interleave>
        <ref name="qemucdevSrcDef"/>
        <choice>
          <ref name="guestfwdTarget"/>
          <ref name="virtioTarget"/>
          <ref name="xenTarget"/>
        </choice>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="smartcard">
    <element name="smartcard">
      <choice>
        <group>
          <attribute name="mode">
            <value>host</value>
          </attribute>
          <!-- might need to add optional database element here later -->
        </group>
        <group>
          <attribute name="mode">
            <value>host-certificates</value>
          </attribute>
          <ref name="certificate"/>
          <ref name="certificate"/>
          <ref name="certificate"/>
          <optional>
            <element name="database">
              <ref name="absDirPath"/>
            </element>
          </optional>
        </group>
        <group>
          <attribute name="mode">
            <value>passthrough</value>
          </attribute>
          <ref name="qemucdevSrcType"/>
          <interleave>
            <ref name="qemucdevSrcDef"/>
            <optional>
              <ref name="qemucdevTgtDef"/>
            </optional>
          </interleave>
        </group>
      </choice>
      <optional>
        <ref name="alias"/>
      </optional>
      <optional>
        <ref name="acpi"/>
      </optional>
      <optional>
        <ref name="address"/>
      </optional>
    </element>
  </define>
  <define name="certificate">
    <element name="certificate">
      <text/>
    </element>
  </define>

  <define name="tpm">
    <element name="tpm">
      <optional>
        <attribute name="model">
          <choice>
            <value>tpm-tis</value>
            <value>tpm-crb</value>
            <value>tpm-spapr</value>
            <value>spapr-tpm-proxy</value>
          </choice>
        </attribute>
      </optional>
      <ref name="tpm-backend"/>
      <optional>
        <ref name="alias"/>
      </optional>
      <optional>
        <ref name="acpi"/>
      </optional>
      <optional>
        <ref name="address"/>
      </optional>
    </element>
  </define>

  <define name="tpm-backend">
    <element name="backend">
      <choice>
        <group>
          <attribute name="type">
            <value>passthrough</value>
          </attribute>
          <ref name="tpm-passthrough-device"/>
        </group>
        <group>
          <attribute name="type">
             <value>emulator</value>
          </attribute>
          <ref name="tpm-backend-emulator-encryption"/>
          <optional>
            <attribute name="persistent_state">
              <choice>
                <value>yes</value>
                <value>no</value>
              </choice>
           </attribute>
          </optional>
        </group>
      </choice>
      <optional>
        <attribute name="version">
          <choice>
            <value>1.2</value>
            <value>2.0</value>
          </choice>
       </attribute>
      </optional>
    </element>
  </define>

  <define name="tpm-passthrough-device">
    <optional>
      <element name="device">
        <optional>
          <attribute name="path">
            <ref name="filePath"/>
          </attribute>
        </optional>
      </element>
    </optional>
  </define>

  <define name="tpm-backend-emulator-encryption">
    <optional>
      <element name="encryption">
        <attribute name="secret">
          <ref name="UUID"/>
        </attribute>
      </element>
    </optional>
  </define>

  <define name="vsock">
    <element name="vsock">
      <optional>
        <attribute name="model">
          <choice>
            <value>virtio</value>
            <value>virtio-transitional</value>
            <value>virtio-non-transitional</value>
          </choice>
        </attribute>
      </optional>
      <interleave>
        <optional>
          <element name="cid">
            <optional>
              <attribute name="auto">
                <ref name="virYesNo"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="address">
                <ref name="unsignedInt"/>
              </attribute>
            </optional>
          </element>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <element name="driver">
            <ref name="virtioOptions"/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="iommu">
    <element name="iommu">
      <attribute name="model">
        <choice>
          <value>intel</value>
          <value>smmuv3</value>
        </choice>
      </attribute>
      <optional>
        <element name="driver">
          <optional>
            <attribute name="intremap">
              <ref name="virOnOff"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="caching_mode">
              <ref name="virOnOff"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="eim">
              <ref name="virOnOff"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="iotlb">
              <ref name="virOnOff"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="aw_bits">
              <ref name="uint8"/>
            </attribute>
          </optional>
        </element>
      </optional>
    </element>
  </define>

  <define name="input">
    <element name="input">
      <interleave>
        <optional>
          <element name="driver">
            <ref name="virtioOptions"/>
          </element>
        </optional>
        <choice>
          <group>
            <attribute name="type">
              <choice>
                <value>tablet</value>
                <value>mouse</value>
                <value>keyboard</value>
              </choice>
            </attribute>
            <optional>
              <attribute name="bus">
                <choice>
                  <value>ps2</value>
                  <value>usb</value>
                  <value>xen</value>
                  <value>virtio</value>
                </choice>
              </attribute>
            </optional>
          </group>
          <group>
            <attribute name="type">
              <value>passthrough</value>
            </attribute>
            <attribute name="bus">
              <value>virtio</value>
            </attribute>
            <element name="source">
              <attribute name="evdev">
                <ref name="absFilePath"/>
              </attribute>
            </element>
          </group>
        </choice>
        <optional>
          <attribute name="model">
            <choice>
              <value>virtio</value>
              <value>virtio-transitional</value>
              <value>virtio-non-transitional</value>
            </choice>
          </attribute>
        </optional>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="hub">
    <element name="hub">
      <attribute name="type">
        <value>usb</value>
      </attribute>
      <interleave>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="redirdev">
    <element name="redirdev">
      <attribute name="bus">
        <value>usb</value>
      </attribute>
      <attribute name="type">
        <ref name="qemucdevSrcTypeChoice"/>
      </attribute>
      <interleave>
        <ref name="qemucdevSrcDef"/>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
        <optional>
          <ref name="deviceBoot"/>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="redirfilter">
    <element name="redirfilter">
      <zeroOrMore>
        <ref name="usbdevfilter"/>
      </zeroOrMore>
    </element>
  </define>

  <define name="hostdev">
    <element name="hostdev">
      <interleave>
        <choice>
          <group>
            <ref name="hostdevsubsys"/>
          </group>
          <group>
            <ref name="hostdevcaps"/>
          </group>
        </choice>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="deviceBoot"/>
        </optional>
        <optional>
          <ref name="rom"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
        <optional>
          <element name="readonly">
            <empty/>
          </element>
        </optional>
        <optional>
          <element name="shareable">
            <empty/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="hostdevsubsys">
    <optional>
      <attribute name="mode">
        <value>subsystem</value>
      </attribute>
    </optional>
    <optional>
      <attribute name="managed">
        <ref name="virYesNo"/>
      </attribute>
    </optional>
    <choice>
      <ref name="hostdevsubsyspci"/>
      <ref name="hostdevsubsysusb"/>
      <ref name="hostdevsubsysscsi"/>
      <ref name="hostdevsubsyshost"/>
      <ref name="hostdevsubsysmdev"/>
    </choice>
  </define>

  <define name="hostdevcaps">
    <attribute name="mode">
      <value>capabilities</value>
    </attribute>
    <choice>
      <group>
        <ref name="hostdevcapsstorage"/>
      </group>
      <group>
        <ref name="hostdevcapsmisc"/>
      </group>
      <group>
        <ref name="hostdevcapsnet"/>
      </group>
    </choice>
  </define>


  <define name="hostdevsubsyspci">
    <attribute name="type">
      <value>pci</value>
    </attribute>
    <interleave>
      <optional>
        <element name="driver">
          <attribute name="name">
            <choice>
              <value>kvm</value>
              <value>vfio</value>
              <value>xen</value>
            </choice>
          </attribute>
          <empty/>
        </element>
      </optional>
      <optional>
        <ref name="teaming"/>
      </optional>
      <element name="source">
        <optional>
          <ref name="startupPolicy"/>
        </optional>
        <optional>
          <attribute name="writeFiltering">
            <ref name="virYesNo"/>
          </attribute>
        </optional>
        <element name="address">
          <ref name="pciaddress"/>
        </element>
      </element>
    </interleave>
  </define>

  <define name="hostdevsubsysusb">
    <attribute name="type">
      <value>usb</value>
    </attribute>
    <element name="source">
      <optional>
        <ref name="startupPolicy"/>
      </optional>
      <choice>
        <group>
          <ref name="usbproduct"/>
          <optional>
            <ref name="usbaddress"/>
          </optional>
        </group>
        <ref name="usbaddress"/>
      </choice>
    </element>
  </define>

  <define name="hostdevsubsysscsi">
    <attribute name="type">
      <value>scsi</value>
    </attribute>
    <optional>
      <ref name="sgIO"/>
    </optional>
    <optional>
      <ref name="rawIO"/>
    </optional>
    <element name="source">
      <choice>
        <group>  <!-- scsi_host adapter -->
          <optional>
            <attribute name="protocol">
              <value>adapter</value>   <!-- scsi_host, default, optional -->
            </attribute>
          </optional>
          <interleave>
            <ref name="sourceinfoadapter"/>
            <element name="address">
              <ref name="scsiaddress"/>
            </element>
          </interleave>
        </group>
        <group>  <!-- iscsi adapter -->
          <attribute name="protocol">
            <value>iscsi</value>     <!-- iscsi, required -->
          </attribute>
          <attribute name="name">
            <text/>
          </attribute>
          <interleave>
            <oneOrMore>
              <element name="host">
                <attribute name="name">
                  <text/>
                </attribute>
                <optional>
                  <attribute name="port">
                    <ref name="PortNumber"/>
                  </attribute>
                </optional>
                <empty/>
              </element>
            </oneOrMore>
            <optional>
              <ref name="diskAuth"/>
            </optional>
            <optional>
              <ref name="initiatorinfo"/>
            </optional>
          </interleave>
        </group>
      </choice>
    </element>
  </define>

  <define name="hostdevsubsyshost">
    <attribute name="type">
      <value>scsi_host</value>
    </attribute>
    <optional>
      <attribute name="model">
        <choice>
          <value>virtio</value>
          <value>virtio-transitional</value>
          <value>virtio-non-transitional</value>
        </choice>
      </attribute>
    </optional>
    <element name="source">
      <choice>
        <group>
          <attribute name="protocol">
            <value>vhost</value>     <!-- vhost, required -->
          </attribute>
          <attribute name="wwpn">
            <data type="string">
              <param name="pattern">(naa\.)[0-9a-fA-F]{16}</param>
            </data>
          </attribute>
        </group>
      </choice>
    </element>
  </define>

  <define name="hostdevsubsysmdev">
    <attribute name="type">
      <value>mdev</value>
    </attribute>
    <attribute name="model">
      <choice>
        <value>vfio-pci</value>
        <value>vfio-ccw</value>
        <value>vfio-ap</value>
      </choice>
    </attribute>
    <optional>
      <attribute name="ramfb">
        <ref name="virOnOff"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="display">
        <ref name="virOnOff"/>
      </attribute>
    </optional>
    <element name="source">
      <ref name="mdevaddress"/>
    </element>
  </define>

  <define name="hostdevcapsstorage">
    <attribute name="type">
      <value>storage</value>
    </attribute>
    <element name="source">
      <element name="block">
        <ref name="absFilePath"/>
      </element>
    </element>
  </define>

  <define name="hostdevcapsmisc">
    <attribute name="type">
      <value>misc</value>
    </attribute>
    <element name="source">
      <element name="char">
        <ref name="absFilePath"/>
      </element>
    </element>
  </define>

  <define name="hostdevcapsnet">
    <attribute name="type">
      <value>net</value>
    </attribute>
    <interleave>
      <element name="source">
        <element name="interface">
          <ref name="deviceName"/>
        </element>
      </element>
      <ref name="interface-ip-info"/>
    </interleave>
  </define>

  <define name="usbproduct">
    <element name="vendor">
      <attribute name="id">
        <ref name="usbId"/>
      </attribute>
    </element>
    <element name="product">
      <attribute name="id">
        <ref name="usbId"/>
      </attribute>
    </element>
  </define>
  <define name="usbaddress">
    <element name="address">
      <attribute name="bus">
        <ref name="usbAddr"/>
      </attribute>
      <attribute name="device">
        <ref name="usbAddr"/>
      </attribute>
    </element>
  </define>
  <define name="scsiaddress">
    <attribute name="bus">
      <ref name="driveBus"/>
    </attribute>
    <attribute name="target">
      <ref name="driveSCSITarget"/>
    </attribute>
    <attribute name="unit">
      <ref name="driveSCSIUnit"/>
    </attribute>
  </define>
  <define name="usbportaddress">
    <attribute name="bus">
      <ref name="usbAddr"/>
    </attribute>
    <optional>
      <attribute name="port">
        <ref name="usbPort"/>
      </attribute>
    </optional>
  </define>
  <define name="spaprvioaddress">
    <optional>
      <attribute name="reg">
        <ref name="spaprvioReg"/>
      </attribute>
    </optional>
  </define>
  <define name="ccwaddress">
    <optional>
      <attribute name="cssid">
        <ref name="ccwCssidRange"/>
      </attribute>
      <attribute name="ssid">
        <ref name="ccwSsidRange"/>
      </attribute>
      <attribute name="devno">
        <ref name="ccwDevnoRange"/>
      </attribute>
    </optional>
  </define>
  <define name="driveaddress">
    <optional>
      <attribute name="controller">
        <ref name="driveController"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="bus">
        <ref name="driveBus"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="target">
        <ref name="driveTarget"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="unit">
        <ref name="driveUnit"/>
      </attribute>
    </optional>
  </define>
  <define name="virtioserialaddress">
    <attribute name="controller">
      <ref name="driveController"/>
    </attribute>
    <optional>
      <attribute name="bus">
        <ref name="driveBus"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="port">
        <ref name="virtioserialPort"/>
      </attribute>
    </optional>
  </define>
  <define name="ccidaddress">
    <attribute name="controller">
      <ref name="driveController"/>
    </attribute>
    <optional>
      <attribute name="slot">
        <ref name="ccidSlot"/>
      </attribute>
    </optional>
  </define>
  <define name="dimmaddress">
    <optional>
      <attribute name="slot">
        <ref name="unsignedInt"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="base">
        <ref name="hexuint"/>
      </attribute>
    </optional>
  </define>
  <define name="mdevaddress">
    <element name="address">
      <attribute name="uuid">
        <ref name="UUID"/>
      </attribute>
    </element>
  </define>
  <define name="devices">
    <element name="devices">
      <interleave>
        <optional>
          <ref name="emulator"/>
        </optional>
        <zeroOrMore>
          <choice>
            <ref name="disk"/>
            <ref name="controller"/>
            <ref name="lease"/>
            <ref name="filesystem"/>
            <ref name="interface"/>
            <ref name="input"/>
            <ref name="sound"/>
            <ref name="audio"/>
            <ref name="hostdev"/>
            <ref name="graphic"/>
            <ref name="video"/>
            <ref name="console"/>
            <ref name="parallel"/>
            <ref name="serial"/>
            <ref name="channel"/>
            <ref name="smartcard"/>
            <ref name="hub"/>
            <ref name="redirdev"/>
            <ref name="redirfilter"/>
            <ref name="rng"/>
            <ref name="tpm"/>
            <ref name="shmem"/>
            <ref name="memorydev"/>
          </choice>
        </zeroOrMore>
        <optional>
          <ref name="watchdog"/>
        </optional>
        <optional>
          <ref name="memballoon"/>
        </optional>
        <optional>
          <ref name="nvram"/>
        </optional>
        <zeroOrMore>
          <ref name="panic"/>
        </zeroOrMore>
        <optional>
          <ref name="iommu"/>
        </optional>
        <optional>
          <ref name="vsock"/>
        </optional>
      </interleave>
    </element>
  </define>
  <!--
      A set of optional features: PAE, APIC, ACPI, GIC,
      HyperV Enlightenment, KVM features, paravirtual spinlocks and HAP support
    -->
  <define name="features">
    <optional>
      <element name="features">
        <interleave>
          <optional>
            <element name="pae">
              <empty/>
            </element>
          </optional>
          <optional>
            <element name="apic">
              <optional>
                <attribute name="eoi">
                  <ref name="virOnOff"/>
                </attribute>
              </optional>
            </element>
          </optional>
          <optional>
            <element name="acpi">
              <empty/>
            </element>
          </optional>
          <optional>
            <element name="hap">
              <optional>
                <attribute name="state">
                  <ref name="virOnOff"/>
                </attribute>
              </optional>
            </element>
          </optional>
          <optional>
            <ref name="hyperv"/>
          </optional>
          <optional>
            <element name="viridian">
              <empty/>
            </element>
          </optional>
          <optional>
            <ref name="kvm"/>
          </optional>
          <optional>
            <ref name="xen"/>
          </optional>
          <optional>
            <element name="privnet">
              <empty/>
            </element>
          </optional>
          <optional>
            <element name="pvspinlock">
              <optional>
                <ref name="featurestate"/>
              </optional>
              <empty/>
            </element>
          </optional>
          <optional>
            <ref name="capabilities"/>
          </optional>
          <optional>
            <ref name="pmu"/>
          </optional>
          <optional>
            <element name="vmport">
              <optional>
                <attribute name="state">
                  <ref name="virOnOff"/>
                </attribute>
              </optional>
            </element>
          </optional>
          <optional>
            <element name="gic">
              <optional>
                <attribute name="version">
                  <choice>
                    <value>host</value>
                    <value>2</value>
                    <value>3</value>
                  </choice>
                </attribute>
              </optional>
            </element>
          </optional>
          <optional>
            <element name="smm">
              <optional>
                <attribute name="state">
                  <ref name="virOnOff"/>
                </attribute>
                <optional>
                  <element name="tseg">
                    <ref name="scaledInteger"/>
                  </element>
                </optional>
              </optional>
            </element>
          </optional>
          <optional>
            <ref name="ioapic"/>
          </optional>
          <optional>
            <ref name="hpt"/>
          </optional>
          <optional>
            <ref name="vmcoreinfo"/>
          </optional>
          <optional>
            <element name="htm">
              <ref name="featurestate"/>
            </element>
          </optional>
          <optional>
            <element name="nested-hv">
              <ref name="featurestate"/>
            </element>
          </optional>
          <optional>
            <ref name="msrs"/>
          </optional>
          <optional>
            <element name="ccf-assist">
              <ref name="featurestate"/>
            </element>
          </optional>
          <optional>
            <ref name="cfpc"/>
          </optional>
          <optional>
            <ref name="sbbc"/>
          </optional>
          <optional>
            <ref name="ibs"/>
          </optional>
        </interleave>
      </element>
    </optional>
  </define>

  <!--
      System information specification:
       Placeholder for system specific information likes the ones
       contained in the SMBIOS area.
       Only a limited subset of entries can be modified there, so we
       fully enumerate each case here.
       The DMTF spec doesn't specify any string subset, just 0 terminated
       byte strings, but better be safe and restrict at least the names
       to avoid problems with space normalization in attribute values,
       the value is kept as the element body for maximum flexibility.
       A priori we allow only type 0 and type 1 string updates
      -->
  <define name="sysinfo">
    <element name="sysinfo">
      <choice>
        <group>
          <attribute name="type">
            <value>smbios</value>
          </attribute>
          <interleave>
            <optional>
              <element name="bios">
                <oneOrMore>
                  <element name="entry">
                    <attribute name="name">
                      <ref name="sysinfo-bios-name"/>
                    </attribute>
                    <ref name="sysinfo-value"/>
                  </element>
                </oneOrMore>
              </element>
            </optional>
            <optional>
              <element name="system">
                <oneOrMore>
                  <element name="entry">
                    <attribute name="name">
                      <ref name="sysinfo-system-name"/>
                    </attribute>
                    <ref name="sysinfo-value"/>
                  </element>
                </oneOrMore>
              </element>
            </optional>
            <zeroOrMore>
              <element name="baseBoard">
                <oneOrMore>
                  <element name="entry">
                    <attribute name="name">
                      <ref name="sysinfo-baseBoard-name"/>
                    </attribute>
                    <ref name="sysinfo-value"/>
                  </element>
                </oneOrMore>
              </element>
            </zeroOrMore>
            <optional>
              <element name="chassis">
                <oneOrMore>
                  <element name="entry">
                    <attribute name="name">
                      <ref name="sysinfo-chassis-name"/>
                    </attribute>
                    <ref name="sysinfo-value"/>
                  </element>
                </oneOrMore>
              </element>
            </optional>
            <optional>
              <element name="oemStrings">
                <oneOrMore>
                  <element name="entry">
                    <ref name="sysinfo-value"/>
                  </element>
                </oneOrMore>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <attribute name="type">
            <value>fwcfg</value>
          </attribute>
          <zeroOrMore>
            <element name="entry">
              <attribute name="name">
                <data type="string"/>
              </attribute>
              <choice>
                <group>
                  <attribute name="file">
                    <data type="string"/>
                  </attribute>
                  <empty/>
                </group>
                <group>
                  <ref name="sysinfo-value"/>
                </group>
              </choice>
            </element>
          </zeroOrMore>
        </group>
      </choice>
    </element>
  </define>

  <define name="sysinfo-bios-name">
    <choice>
      <value>vendor</value>
      <value>version</value>
      <value>date</value>
      <value>release</value>
    </choice>
  </define>

  <define name="sysinfo-system-name">
    <choice>
      <value>manufacturer</value>
      <value>product</value>
      <value>version</value>
      <value>serial</value>
      <value>uuid</value>
      <value>sku</value>
      <value>family</value>
    </choice>
  </define>

  <define name="sysinfo-baseBoard-name">
    <choice>
      <value>manufacturer</value>
      <value>product</value>
      <value>version</value>
      <value>serial</value>
      <value>asset</value>
      <value>location</value>
    </choice>
  </define>

  <define name="sysinfo-chassis-name">
    <choice>
      <value>manufacturer</value>
      <value>version</value>
      <value>serial</value>
      <value>asset</value>
      <value>sku</value>
    </choice>
  </define>

  <define name="sysinfo-value">
    <data type="string"/>
  </define>

  <define name="acpiTable">
    <element name="acpi">
      <zeroOrMore>
        <element name="table">
          <attribute name="type">
            <value>slic</value>
          </attribute>
          <ref name="absFilePath"/>
        </element>
      </zeroOrMore>
    </element>
  </define>

  <define name="smbios">
    <element name="smbios">
      <attribute name="mode">
        <choice>
          <value>emulate</value>
          <value>host</value>
          <value>sysinfo</value>
        </choice>
      </attribute>
      <empty/>
    </element>
  </define>

  <define name="bios">
    <element name="bios">
      <optional>
        <attribute name="useserial">
          <ref name="virYesNo"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="rebootTimeout">
          <ref name="rebootTimeoutDelay"/>
        </attribute>
      </optional>
    </element>
  </define>

  <define name="ioapic">
    <element name="ioapic">
      <attribute name="driver">
        <choice>
          <value>qemu</value>
          <value>kvm</value>
        </choice>
      </attribute>
      <empty/>
    </element>
  </define>

  <define name="hpt">
    <element name="hpt">
      <optional>
        <attribute name="resizing">
          <choice>
            <value>enabled</value>
            <value>disabled</value>
            <value>required</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <element name="maxpagesize">
          <ref name="scaledInteger"/>
        </element>
      </optional>
    </element>
  </define>

  <define name="vmcoreinfo">
    <element name="vmcoreinfo">
      <optional>
        <attribute name="state">
          <ref name="virOnOff"/>
        </attribute>
      </optional>
    </element>
  </define>

  <define name="msrs">
    <element name="msrs">
      <attribute name="unknown">
        <choice>
          <value>ignore</value>
          <value>fault</value>
        </choice>
      </attribute>
    </element>
  </define>

  <define name="cfpc">
    <element name="cfpc">
      <attribute name="value">
        <choice>
          <value>broken</value>
          <value>workaround</value>
          <value>fixed</value>
        </choice>
      </attribute>
    </element>
  </define>

  <define name="sbbc">
    <element name="sbbc">
      <attribute name="value">
        <choice>
          <value>broken</value>
          <value>workaround</value>
          <value>fixed</value>
        </choice>
      </attribute>
    </element>
  </define>

  <define name="ibs">
    <element name="ibs">
      <attribute name="value">
        <choice>
          <value>broken</value>
          <value>workaround</value>
          <value>fixed-ibs</value>
          <value>fixed-ccd</value>
          <value>fixed-na</value>
        </choice>
      </attribute>
    </element>
  </define>

  <define name="address">
    <element name="address">
      <choice>
        <group>
          <attribute name="type">
            <value>pci</value>
          </attribute>
          <ref name="pciaddress"/>
          <ref name="zpciaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>drive</value>
          </attribute>
          <ref name="driveaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>virtio-serial</value>
          </attribute>
          <ref name="virtioserialaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>ccid</value>
          </attribute>
          <ref name="ccidaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>usb</value>
          </attribute>
          <ref name="usbportaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>spapr-vio</value>
          </attribute>
          <ref name="spaprvioaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>ccw</value>
          </attribute>
          <ref name="ccwaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>isa</value>
          </attribute>
          <ref name="isaaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>virtio-mmio</value>
          </attribute>
        </group>
        <group>
          <attribute name="type">
            <value>dimm</value>
          </attribute>
          <ref name="dimmaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>unassigned</value>
          </attribute>
        </group>
      </choice>
    </element>
  </define>

  <define name="rom">
    <element name="rom">
      <optional>
        <attribute name="enabled">
          <ref name="virYesNo"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="bar">
          <ref name="virOnOff"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="file">
          <ref name="absFilePath"/>
        </attribute>
      </optional>
      <empty/>
    </element>
  </define>

  <define name="acpi">
    <element name="acpi">
      <optional>
        <attribute name="index">
          <ref name="unsignedInt"/>
        </attribute>
      </optional>
    </element>
  </define>

  <define name="memorydev">
    <element name="memory">
      <attribute name="model">
        <choice>
          <value>dimm</value>
          <value>nvdimm</value>
          <value>virtio-pmem</value>
        </choice>
      </attribute>
      <optional>
        <attribute name="access">
          <choice>
            <value>shared</value>
            <value>private</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="discard">
          <ref name="virYesNo"/>
        </attribute>
      </optional>
      <interleave>
        <optional>
          <element name="uuid">
            <ref name="UUID"/>
          </element>
        </optional>
        <optional>
          <ref name="memorydev-source"/>
        </optional>
        <ref name="memorydev-target"/>
        <optional>
          <ref name="address"/>
        </optional>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="memorydev-source">
    <element name="source">
      <choice>
        <group>
          <interleave>
            <optional>
              <element name="pagesize">
                <ref name="scaledInteger"/>
              </element>
            </optional>
            <optional>
              <element name="nodemask">
                <ref name="cpuset"/>
              </element>
            </optional>
          </interleave>
        </group>
        <group>
          <interleave>
            <element name="path">
              <ref name="absFilePath"/>
            </element>
            <optional>
              <element name="alignsize">
                <ref name="scaledInteger"/>
              </element>
            </optional>
            <optional>
              <element name="pmem">
                <empty/>
              </element>
            </optional>
          </interleave>
        </group>
      </choice>
    </element>
  </define>

  <define name="memorydev-target">
    <element name="target">
      <interleave>
        <element name="size">
          <ref name="scaledInteger"/>
        </element>
        <optional>
          <element name="node">
            <ref name="unsignedInt"/>
          </element>
        </optional>
        <optional>
          <element name="label">
            <element name="size">
              <ref name="scaledInteger"/>
            </element>
          </element>
        </optional>
        <optional>
          <element name="readonly">
            <empty/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="rng">
    <element name="rng">
      <attribute name="model">
        <choice>
          <value>virtio</value>
          <value>virtio-transitional</value>
          <value>virtio-non-transitional</value>
        </choice>
      </attribute>
      <interleave>
        <ref name="rng-backend"/>
        <optional>
          <element name="driver">
            <ref name="virtioOptions"/>
          </element>
        </optional>
        <optional>
          <ref name="rng-rate"/>
        </optional>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="rng-backend">
    <element name="backend">
      <choice>
        <group>
          <attribute name="model">
            <value>random</value>
          </attribute>
          <choice>
            <ref name="absFilePath"/>
            <empty/>
          </choice>
        </group>
        <group>
          <attribute name="model">
            <value>egd</value>
          </attribute>
          <ref name="qemucdevSrcType"/>
          <ref name="qemucdevSrcDef"/>
        </group>
        <group>
          <attribute name="model">
            <value>builtin</value>
          </attribute>
          <empty/>
        </group>
      </choice>
    </element>
  </define>

  <define name="rng-rate">
    <element name="rate">
      <attribute name="bytes">
        <ref name="positiveInteger"/>
      </attribute>
      <optional>
        <attribute name="period">
          <ref name="positiveInteger"/>
        </attribute>
      </optional>
      <empty/>
    </element>
  </define>

  <define name="virtioOptions">
    <optional>
      <attribute name="iommu">
        <ref name="virOnOff"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="ats">
        <ref name="virOnOff"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="packed">
        <ref name="virOnOff"/>
      </attribute>
    </optional>
  </define>

  <define name="usbmaster">
    <element name="master">
      <attribute name="startport">
        <ref name="usbPort"/>
      </attribute>
      <empty/>
    </element>
  </define>

  <define name="deviceBoot">
    <element name="boot">
      <attribute name="order">
        <ref name="positiveInteger"/>
      </attribute>
      <optional>
        <attribute name="loadparm">
          <data type="string">
            <param name="pattern">[a-zA-Z0-9.\s]{1,8}</param>
          </data>
        </attribute>
      </optional>
      <empty/>
    </element>
  </define>

  <define name="diskMirror">
    <element name="mirror">
      <choice>
        <group> <!-- old format, for block copy back-compat -->
          <attribute name="file">
            <ref name="absFilePath"/>
          </attribute>
          <optional>
            <attribute name="format">
              <ref name="storageFormat"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="job">
              <value>copy</value>
            </attribute>
          </optional>
          <optional>
            <interleave>
              <ref name="diskSourceFile"/>
              <optional>
                <ref name="diskFormat"/>
              </optional>
            </interleave>
          </optional>
        </group>
        <group> <!-- preferred format -->
          <attribute name="job">
            <choice>
              <value>copy</value>
              <value>active-commit</value>
            </choice>
          </attribute>
          <interleave>
            <ref name="diskSource"/>
            <optional>
              <ref name="diskFormat"/>
            </optional>
          </interleave>
        </group>
      </choice>
      <optional>
        <attribute name="ready">
          <choice>
            <value>yes</value>
            <value>abort</value>
            <value>pivot</value>
          </choice>
        </attribute>
      </optional>
      <ref name="diskBackingChain"/>
    </element>
  </define>
  <define name="diskAuth">
    <element name="auth">
      <attribute name="username">
        <ref name="genericName"/>
      </attribute>
      <ref name="diskAuthSecret"/>
    </element>
  </define>

  <define name="diskAuthSecret">
    <element name="secret">
      <attribute name="type">
        <choice>
          <value>ceph</value>
          <value>iscsi</value>
        </choice>
      </attribute>
      <choice>
        <attribute name="uuid">
          <ref name="UUID"/>
        </attribute>
        <attribute name="usage">
          <ref name="objectName"/>
        </attribute>
      </choice>
    </element>
  </define>

  <define name="diskIoTune">
    <element name="iotune">
      <interleave>
        <choice>
          <element name="total_bytes_sec">
            <data type="unsignedLong"/>
          </element>
          <group>
            <interleave>
              <optional>
                <element name="read_bytes_sec">
                  <data type="unsignedLong"/>
                </element>
              </optional>
              <optional>
                <element name="write_bytes_sec">
                  <data type="unsignedLong"/>
                </element>
              </optional>
            </interleave>
          </group>
        </choice>
        <choice>
          <element name="total_iops_sec">
            <data type="unsignedLong"/>
          </element>
          <group>
            <interleave>
              <optional>
                <element name="read_iops_sec">
                  <data type="unsignedLong"/>
                </element>
              </optional>
              <optional>
                <element name="write_iops_sec">
                  <data type="unsignedLong"/>
                </element>
              </optional>
            </interleave>
          </group>
        </choice>
        <choice>
          <element name="total_bytes_sec_max">
            <data type="unsignedLong"/>
          </element>
          <group>
            <interleave>
              <optional>
                <element name="read_bytes_sec_max">
                  <data type="unsignedLong"/>
                </element>
              </optional>
              <optional>
                <element name="write_bytes_sec_max">
                  <data type="unsignedLong"/>
                </element>
              </optional>
            </interleave>
          </group>
        </choice>
        <choice>
          <element name="total_iops_sec_max">
            <data type="unsignedLong"/>
          </element>
          <group>
            <interleave>
              <optional>
                <element name="read_iops_sec_max">
                  <data type="unsignedLong"/>
                </element>
              </optional>
              <optional>
                <element name="write_iops_sec_max">
                  <data type="unsignedLong"/>
                </element>
              </optional>
            </interleave>
          </group>
        </choice>
        <optional>
          <element name="size_iops_sec">
            <data type="unsignedLong"/>
          </element>
        </optional>
        <optional>
          <element name="group_name">
            <text/>
          </element>
        </optional>
        <choice>
          <element name="total_bytes_sec_max_length">
            <data type="unsignedLong"/>
          </element>
          <group>
            <interleave>
              <optional>
                <element name="read_bytes_sec_max_length">
                  <data type="unsignedLong"/>
                </element>
              </optional>
              <optional>
                <element name="write_bytes_sec_max_length">
                  <data type="unsignedLong"/>
                </element>
              </optional>
            </interleave>
          </group>
        </choice>
        <choice>
          <element name="total_iops_sec_max_length">
            <data type="unsignedLong"/>
          </element>
          <group>
            <interleave>
              <optional>
                <element name="read_iops_sec_max_length">
                  <data type="unsignedLong"/>
                </element>
              </optional>
              <optional>
                <element name="write_iops_sec_max_length">
                  <data type="unsignedLong"/>
                </element>
              </optional>
            </interleave>
          </group>
        </choice>
      </interleave>
    </element>
  </define>

  <!-- Optional HyperV Enlightenment features -->
  <define name="hyperv">
    <element name="hyperv">
      <interleave>
        <optional>
          <element name="relaxed">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="vapic">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="spinlocks">
            <ref name="featurestate"/>
            <optional>
              <attribute name="retries">
                <data type="unsignedInt"/>
              </attribute>
            </optional>
          </element>
        </optional>
        <optional>
          <element name="vpindex">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="runtime">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="synic">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="stimer">
            <ref name="stimer"/>
          </element>
        </optional>
        <optional>
          <element name="reset">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="vendor_id">
            <ref name="featurestate"/>
            <optional>
              <attribute name="value">
                <data type="string">
                  <param name="pattern">[^,]{0,12}</param>
                </data>
              </attribute>
            </optional>
          </element>
        </optional>
        <optional>
          <element name="frequencies">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="reenlightenment">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="tlbflush">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="ipi">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="evmcs">
            <ref name="featurestate"/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <!-- Hyper-V stimer features -->
  <define name="stimer">
    <interleave>
      <optional>
        <ref name="featurestate"/>
      </optional>
      <optional>
        <element name="direct">
          <ref name="featurestate"/>
        </element>
      </optional>
    </interleave>
  </define>

  <!-- Optional KVM features -->
  <define name="kvm">
    <element name="kvm">
      <interleave>
        <optional>
          <element name="hidden">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="hint-dedicated">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="poll-control">
            <ref name="featurestate"/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <!-- Optional Xen features -->
  <define name="xen">
    <element name="xen">
      <interleave>
        <optional>
          <element name="e820_host">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="passthrough">
            <ref name="featurestate"/>
            <optional>
              <attribute name="mode">
                <data type="string">
                  <param name="pattern">(sync_pt|share_pt)</param>
                </data>
              </attribute>
            </optional>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <!-- Optional capabilities features -->
  <define name="capabilities">
    <element name="capabilities">
      <ref name="capabilitiespolicy"/>
      <interleave>
        <optional>
          <element name="audit_control">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="audit_write">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="block_suspend">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="chown">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="dac_override">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="dac_read_search">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="fowner">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="fsetid">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="ipc_lock">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="ipc_owner">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="kill">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="lease">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="linux_immutable">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="mac_admin">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="mac_override">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="mknod">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="net_admin">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="net_bind_service">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="net_broadcast">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="net_raw">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="setgid">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="setfcap">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="setpcap">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="setuid">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_admin">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_boot">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_chroot">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_module">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_nice">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_pacct">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_ptrace">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_rawio">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_resource">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_time">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="sys_tty_config">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="syslog">
            <ref name="featurestate"/>
          </element>
        </optional>
        <optional>
          <element name="wake_alarm">
            <ref name="featurestate"/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="pmu">
    <element name="pmu">
      <optional>
        <ref name="featurestate"/>
      </optional>
    </element>
  </define>

  <define name="featurestate">
    <attribute name="state">
      <ref name="virOnOff"/>
    </attribute>
  </define>

  <define name="capabilitiespolicy">
    <attribute name="policy">
      <choice>
        <value>default</value>
        <value>allow</value>
        <value>deny</value>
      </choice>
    </attribute>
  </define>

  <!--
       Optional hypervisor extensions in their own namespace:
         QEMU
    -->
  <define name="qemucmdline">
    <element name="commandline" ns="http://libvirt.org/schemas/domain/qemu/1.0">
      <interleave>
        <zeroOrMore>
          <element name="arg">
            <attribute name="value"/>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="env">
            <attribute name="name">
              <ref name="filter-param-name"/>
            </attribute>
            <optional>
              <attribute name="value"/>
            </optional>
            <empty/>
          </element>
        </zeroOrMore>
      </interleave>
    </element>
  </define>

  <define name="qemucapabilities">
    <element name="capabilities" ns="http://libvirt.org/schemas/domain/qemu/1.0">
      <interleave>
        <zeroOrMore>
          <element name="add">
            <attribute name="capability"/>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="del">
            <attribute name="capability"/>
          </element>
        </zeroOrMore>
      </interleave>
    </element>
  </define>

  <define name="qemudeprecation">
    <element name="deprecation" ns="http://libvirt.org/schemas/domain/qemu/1.0">
      <attribute name="behavior">
        <choice>
          <value>none</value>
          <value>omit</value>
          <value>reject</value>
          <value>crash</value>
        </choice>
      </attribute>
    </element>
  </define>


  <!--
       Optional hypervisor extensions in their own namespace:
       LXC
    -->
  <define name="lxcsharens">
    <element name="namespace" ns="http://libvirt.org/schemas/domain/lxc/1.0">
      <interleave>
        <optional>
          <element name="sharenet">
            <attribute name="type">
              <choice>
                <value>netns</value>
                <value>name</value>
                <value>pid</value>
              </choice>
            </attribute>
            <attribute name="value"/>
          </element>
        </optional>
        <optional>
          <element name="shareipc">
            <attribute name="type">
              <choice>
                <value>name</value>
                <value>pid</value>
              </choice>
            </attribute>
            <attribute name="value"/>
          </element>
        </optional>
        <optional>
          <element name="shareuts">
            <attribute name="type">
              <choice>
                <value>name</value>
                <value>pid</value>
              </choice>
            </attribute>
            <attribute name="value"/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <!--
       Optional hypervisor extensions in their own namespace:
         Bhyve
    -->
  <define name="bhyvecmdline">
    <element name="commandline" ns="http://libvirt.org/schemas/domain/bhyve/1.0">
      <zeroOrMore>
        <element name="arg">
          <attribute name="value"/>
        </element>
      </zeroOrMore>
    </element>
  </define>

  <!--
       Optional hypervisor extensions in their own namespace:
         Xen
    -->
  <define name="xencmdline">
    <element name="commandline" ns="http://libvirt.org/schemas/domain/xen/1.0">
      <zeroOrMore>
        <element name="arg">
          <attribute name="value"/>
        </element>
      </zeroOrMore>
    </element>
  </define>

  <!--
       Optional hypervisor extensions in their own namespace:
         vmware
    -->
  <define name="vmwaredatacenterpath">
    <element name="datacenterpath" ns="http://libvirt.org/schemas/domain/vmware/1.0">
      <text/>
    </element>
  </define>

  <!--
       Type library
    -->
  <define name="countCPU">
    <data type="unsignedShort">
      <param name="pattern">[0-9]+</param>
      <param name="minInclusive">1</param>
    </data>
  </define>
  <define name="vcpuid">
    <data type="unsignedShort">
      <param name="pattern">[0-9]+</param>
    </data>
  </define>
  <define name="cpushares">
    <data type="unsignedInt">
      <param name="pattern">[0-9]+</param>
    </data>
  </define>
  <define name="cpuperiod">
    <data type="unsignedLong">
      <param name="pattern">[0-9]+</param>
      <param name="minInclusive">1000</param>
      <param name="maxInclusive">1000000</param>
    </data>
  </define>
  <define name="cpuquota">
    <data type="long">
      <param name="pattern">-?[0-9]+</param>
      <param name="maxInclusive">17592186044415</param>
      <param name="minInclusive">-1</param>
    </data>
  </define>
  <define name="rebootTimeoutDelay">
    <data type="short">
      <param name="minInclusive">-1</param>
    </data>
  </define>
  <!-- weight currently is in range [100, 1000] -->
  <define name="weight">
    <data type="unsignedInt">
      <param name="pattern">[0-9]+</param>
      <param name="minInclusive">100</param>
      <param name="maxInclusive">1000</param>
    </data>
  </define>
  <define name="diskSerial">
    <data type="string">
      <param name="pattern">[A-Za-z0-9_\.\+\- ]+</param>
    </data>
  </define>
  <define name="bridgeMode">
    <data type="string">
      <param name="pattern">(vepa|bridge|private|passthrough)</param>
    </data>
  </define>
  <define name="addrIPorName">
    <choice>
      <ref name="ipAddr"/>
      <ref name="dnsName"/>
    </choice>
  </define>
  <define name="usbIdDefault">
    <data type="string">
      <param name="pattern">-1</param>
    </data>
  </define>
  <define name="usbId">
    <data type="string">
      <param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
    </data>
  </define>
  <define name="usbVersion">
    <data type="string">
      <param name="pattern">[0-9]{1,2}.[0-9]{1,2}</param>
    </data>
  </define>
  <define name="usbAddr">
    <data type="string">
      <param name="pattern">(0x)?[0-9a-fA-F]{1,3}</param>
    </data>
  </define>
  <define name="usbClass">
    <data type="string">
      <param name="pattern">(0x)?[0-9a-fA-F]{1,2}</param>
    </data>
  </define>
  <define name="usbPort">
    <data type="string">
      <param name="pattern">((0x)?[0-9a-fA-F]{1,3}\.){0,3}(0x)?[0-9a-fA-F]{1,3}</param>
    </data>
  </define>
  <define name="driveController">
    <data type="string">
      <param name="pattern">[0-9]{1,2}</param>
    </data>
  </define>
  <define name="driveBus">
    <data type="string">
      <param name="pattern">[0-9]{1,2}</param>
    </data>
  </define>
  <define name="driveTarget">
    <data type="string">
      <param name="pattern">[0-9]{1,2}</param>
    </data>
  </define>
  <define name="driveSCSITarget">
    <data type="string">
      <param name="pattern">[0-9]{1,10}</param>
    </data>
  </define>
  <define name="driveUnit">
    <data type="string">
      <param name="pattern">[0-9]{1,5}</param>
    </data>
  </define>
  <define name="driveSCSIUnit">
    <data type="string">
      <param name="pattern">[0-9]{1,20}</param>
    </data>
  </define>
  <define name="timeDelta">
    <data type="string">
      <param name="pattern">(-|\+)?[0-9]+</param>
    </data>
  </define>
  <define name="timeZone">
    <data type="string">
      <param name="pattern">[a-zA-Z0-9_\.\+\-/]+</param>
    </data>
  </define>
  <define name="spaprvioReg">
    <data type="string">
      <param name="pattern">(0x)?[0-9a-fA-F]{1,8}</param>
    </data>
  </define>
  <define name="aliasName">
    <data type="string">
      <param name="pattern">[a-zA-Z0-9_\-.]+</param>
    </data>
  </define>
  <define name="virtioserialPort">
    <data type="string">
      <param name="pattern">[0-9]{1,2}</param>
    </data>
  </define>
  <define name="ccidSlot">
    <data type="string">
      <param name="pattern">[0-9]{1,2}</param>
    </data>
  </define>
  <define name="alias">
    <element name="alias">
      <attribute name="name">
        <ref name="aliasName"/>
      </attribute>
    </element>
    <empty/>
  </define>
  <define name="panic">
    <element name="panic">
      <optional>
        <attribute name="model">
          <choice>
            <value>isa</value>
            <value>pseries</value>
            <value>hyperv</value>
            <value>s390</value>
          </choice>
        </attribute>
      </optional>
      <interleave>
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="acpi"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="rawIO">
    <attribute name="rawio">
      <ref name="virYesNo"/>
    </attribute>
  </define>
  <define name="sgIO">
    <attribute name="sgio">
      <choice>
        <value>filtered</value>
        <value>unfiltered</value>
      </choice>
    </attribute>
  </define>

  <define name="coalesce">
    <element name="coalesce">
      <interleave>
        <optional>
          <element name="rx">
            <optional>
              <element name="frames">
                <optional>
                  <attribute name="max">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <!--
                    This is how we'd add more Rx-related settings for
                    frames, like irq, high, and low

                <optional>
                  <attribute name="irq">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="high">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="low">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>

              -->
              </element>
            </optional>
            <!--
                This is how we'd add more Rx-related settings, like
                usecs

            <optional>
              <element name="usecs">
                <optional>
                  <attribute name="max">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="irq">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="high">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="low">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
              </element>
            </optional>
              -->
          </element>
        </optional>
        <!--
            This is how you would add more coalesce settings, like
            Tx-related ones

        <optional>
          <element name="tx">
            <optional>
              <element name="frames">
                <optional>
                  <attribute name="max">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="irq">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="high">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="low">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
              </element>
            </optional>
            <optional>
              <element name="usecs">
                <optional>
                  <attribute name="max">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="irq">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="high">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="low">
                    <ref name="unsignedInt"/>
                  </attribute>
                </optional>
              </element>
            </optional>
          </element>
        </optional>
        -->
      </interleave>
    </element>
  </define>

</grammar>