domain.rng 55.3 KB
Newer Older
1 2
<?xml version="1.0"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3 4
  <!-- We handle only document defining a domain -->
  <start>
5
    <ref name="domain"/>
6
  </start>
7 8

  <include href='storageencryption.rng'/>
9 10 11 12 13 14 15 16 17 18

  <!--
    description element, maybe placed anywhere under the root
    -->
  <define name="description">
    <element name="description">
      <text/>
    </element>
  </define>

19
  <!--
20
      We handle only document defining a domain
21
    -->
22
  <define name="domain">
23
    <element name="domain">
24 25
      <ref name="hvs"/>
      <ref name="ids"/>
26
      <interleave>
27 28 29
        <optional>
          <ref name="description"/>
        </optional>
J
Jiri Denemark 已提交
30 31 32
        <optional>
          <ref name="cpu"/>
        </optional>
33 34 35
        <optional>
          <ref name="sysinfo"/>
        </optional>
36 37 38 39 40 41 42 43 44 45 46
        <ref name="os"/>
        <ref name="clock"/>
        <ref name="resources"/>
        <ref name="features"/>
        <ref name="termination"/>
        <optional>
          <ref name="devices"/>
        </optional>
        <optional>
          <ref name="seclabel"/>
        </optional>
47 48 49
        <optional>
          <ref name='qemucmdline'/>
        </optional>
50
      </interleave>
51
    </element>
52
  </define>
53 54 55 56
  <define name="seclabel">
    <element name="seclabel">
      <attribute name="model">
        <text/>
57
      </attribute>
58
      <attribute name="type">
59 60 61 62 63
        <choice>
          <value>dynamic</value>
          <value>static</value>
        </choice>
      </attribute>
64 65
      <element name="label">
        <text/>
66 67 68
      </element>
    </element>
  </define>
69 70
  <define name="hvs">
    <attribute name="type">
71
      <choice>
72 73 74 75 76 77 78
        <value>xen</value>
        <value>kvm</value>
        <value>kqemu</value>
        <value>qemu</value>
        <value>lxc</value>
        <value>openvz</value>
        <value>test</value>
79 80 81
      </choice>
    </attribute>
  </define>
82
  <define name="os">
83
    <choice>
84 85 86
      <ref name="osxen"/>
      <ref name="oshvm"/>
      <ref name="osexe"/>
87 88
    </choice>
  </define>
89
  <define name="osxen">
90 91
    <choice>
      <group>
92 93 94 95 96 97 98
        <optional>
          <ref name="bootloader"/>
        </optional>
        <element name="os">
          <ref name="ostypexen"/>
          <ref name="osbootkernel"/>
        </element>
99 100
      </group>
      <group>
101 102 103 104 105 106 107 108 109
        <ref name="bootloader"/>
        <optional>
          <element name="os">
            <ref name="ostypexen"/>
            <optional>
              <ref name="osbootkernel"/>
            </optional>
          </element>
        </optional>
110 111 112
      </group>
    </choice>
  </define>
113 114 115
  <define name="oshvm">
    <element name="os">
      <ref name="ostypehvm"/>
116
      <interleave>
117 118 119 120 121 122 123
        <optional>
          <element name="loader">
            <ref name="absFilePath"/>
          </element>
        </optional>
        <choice>
          <ref name="osbootkernel"/>
124 125 126
          <oneOrMore>
            <ref name="osbootdev"/>
          </oneOrMore>
127
        </choice>
128 129 130 131 132 133 134 135 136 137
        <optional>
          <element name="bootmenu">
            <attribute name="enable">
              <choice>
                <value>yes</value>
                <value>no</value>
              </choice>
            </attribute>
          </element>
        </optional>
138 139 140
        <optional>
          <ref name="smbios"/>
        </optional>
141
      </interleave>
142 143
    </element>
  </define>
144 145
  <define name="ostypexen">
    <element name="type">
146
      <optional>
147 148 149 150 151 152 153
        <attribute name="arch">
          <choice>
            <value>i686</value>
            <value>x86_64</value>
            <value>ia64</value>
          </choice>
        </attribute>
154 155
      </optional>
      <optional>
156 157 158 159 160 161
        <attribute name="machine">
          <choice>
            <value>xenpv</value>
            <value>xenner</value>
          </choice>
        </attribute>
162 163
      </optional>
      <choice>
164 165
        <value>xen</value>
        <value>linux</value>
166 167 168
      </choice>
    </element>
  </define>
169 170
  <define name="ostypehvm">
    <element name="type">
171
      <optional>
172 173 174 175 176 177
        <choice>
          <ref name="hvmx86"/>
          <ref name="hvmmips"/>
          <ref name="hvmsparc"/>
          <ref name="hvmppc"/>
        </choice>
178 179 180
      </optional>
      <value>hvm</value>
    </element>
181
  </define>
182
  <define name="hvmx86">
183
    <group>
184 185 186 187 188 189 190 191 192 193
      <optional>
        <attribute name="arch">
          <choice>
            <value>i686</value>
            <value>x86_64</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="machine">
194 195 196
          <data type="string">
            <param name="pattern">[a-zA-Z0-9_\.\-]+</param>
          </data>
197
        </attribute>
198
      </optional>
199 200
    </group>
  </define>
201
  <define name="hvmmips">
202
    <group>
203 204 205 206 207 208 209 210 211 212
      <optional>
        <attribute name="arch">
          <value>mips</value>
        </attribute>
      </optional>
      <optional>
        <attribute name="machine">
          <value>mips</value>
        </attribute>
      </optional>
213 214
    </group>
  </define>
215
  <define name="hvmsparc">
216
    <group>
217 218 219 220 221 222 223 224 225 226
      <optional>
        <attribute name="arch">
          <value>sparc</value>
        </attribute>
      </optional>
      <optional>
        <attribute name="machine">
          <value>sun4m</value>
        </attribute>
      </optional>
227 228
    </group>
  </define>
229
  <define name="hvmppc">
230
    <group>
231 232 233 234 235 236 237 238 239 240 241 242 243 244
      <optional>
        <attribute name="arch">
          <value>ppc</value>
        </attribute>
      </optional>
      <optional>
        <attribute name="machine">
          <choice>
            <value>g3beige</value>
            <value>mac99</value>
            <value>prep</value>
          </choice>
        </attribute>
      </optional>
245 246
    </group>
  </define>
247 248 249 250
  <define name="osexe">
    <element name="os">
      <element name="type">
        <value>exe</value>
251 252
      </element>
      <interleave>
253 254 255 256 257
        <optional>
          <element name="init">
            <ref name="absFilePath"/>
          </element>
        </optional>
258 259 260
      </interleave>
    </element>
  </define>
261
  <!--
262 263 264 265 266
      The Identifiers can be:
      - an optional id attribute with a number on the domain element
      - a mandatory name
      - an optional uuid
    -->
267
  <define name="ids">
268
    <optional>
269 270
      <attribute name="id">
        <ref name="unsignedInt"/>
271 272 273 274
      </attribute>
    </optional>
    <interleave>
      <element name="name">
275
        <ref name="domainName"/>
276 277 278
      </element>
      <optional>
        <element name="uuid">
279
          <ref name="UUID"/>
280 281 282 283 284 285 286
        </element>
      </optional>
    </interleave>
  </define>
  <!--
      Resources usage defines the amount of memory (maximum and possibly
      current usage) and number of virtual CPUs used by that domain.
287
      We can't check here the rule that currentMemory <= memory
288
    -->
289
  <define name="resources">
290
    <interleave>
291 292
      <element name="memory">
        <ref name="memoryKB"/>
293
      </element>
294
      <optional>
295 296
        <element name="currentMemory">
          <ref name="memoryKB"/>
297 298
        </element>
      </optional>
299
      <optional>
R
Richard Jones 已提交
300 301 302 303 304 305 306
        <element name="memoryBacking">
          <optional>
            <element name="hugepages">
              <empty/>
            </element>
          </optional>
        </element>
307
      </optional>
308 309 310

      <!-- All the memory/swap related tunables would go in the memtune -->
      <optional>
D
Daniel Veillard 已提交
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
        <element name="memtune">
          <!-- Maximum memory the VM can use -->
          <optional>
            <element name="hard_limit">
              <ref name="memoryKB"/>
            </element>
          </optional>
          <!-- Minimum memory ascertained for the VM during contention -->
          <optional>
            <element name="soft_limit">
              <ref name="memoryKB"/>
            </element>
          </optional>
          <!-- Minimum amount of memory required to start the VM -->
          <optional>
            <element name="min_guarantee">
              <ref name="memoryKB"/>
            </element>
          </optional>
          <!-- Maximum swap area the VM can use -->
          <optional>
            <element name="swap_hard_limit">
              <ref name="memoryKB"/>
            </element>
          </optional>
        </element>
337 338
      </optional>

339
      <optional>
340
        <element name="vcpu">
341
          <optional>
E
Eric Blake 已提交
342 343 344
            <attribute name="cpuset">
              <ref name="cpuset"/>
            </attribute>
345
          </optional>
346 347 348 349 350
          <optional>
            <attribute name="current">
              <ref name="countCPU"/>
            </attribute>
          </optional>
351
          <ref name="countCPU"/>
352 353
        </element>
      </optional>
354 355
    </interleave>
  </define>
356
  <define name="clock">
357
    <optional>
358
      <element name="clock">
359 360
        <choice>
          <attribute name="offset">
361
            <value>localtime</value>
362 363
          </attribute>
          <attribute name="offset">
364
            <value>utc</value>
365
          </attribute>
366 367 368 369 370 371 372 373 374 375
          <group>
            <attribute name="offset">
              <value>timezone</value>
            </attribute>
            <optional>
              <attribute name="timezone">
                <ref name="timeZone"/>
              </attribute>
            </optional>
          </group>
376 377 378 379 380 381 382 383 384 385 386
          <group>
            <attribute name="offset">
              <value>variable</value>
            </attribute>
            <optional>
              <attribute name="adjustment">
                <ref name="timeDelta"/>
              </attribute>
            </optional>
          </group>
        </choice>
387 388 389
        <zeroOrMore>
          <ref name="timer"/>
        </zeroOrMore>
390 391 392
      </element>
    </optional>
  </define>
L
Laine Stump 已提交
393 394 395 396 397 398 399 400 401 402 403 404
  <define name="timer">
    <element name="timer">
      <attribute name="name">
        <choice>
          <value>platform</value>
          <value>pit</value>
          <value>rtc</value>
          <value>hpet</value>
          <value>tsc</value>
        </choice>
      </attribute>
      <optional>
405
        <attribute name="track">
L
Laine Stump 已提交
406
          <choice>
407
            <value>boot</value>
L
Laine Stump 已提交
408
            <value>guest</value>
409
            <value>wall</value>
L
Laine Stump 已提交
410 411 412 413 414 415 416 417 418 419 420 421 422
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="tickpolicy">
          <choice>
            <value>delay</value>
            <value>catchup</value>
            <value>merge</value>
            <value>discard</value>
          </choice>
        </attribute>
      </optional>
423 424 425
      <optional>
        <ref name="catchup"/>
      </optional>
L
Laine Stump 已提交
426 427 428 429 430 431 432 433 434 435 436 437
      <optional>
        <attribute name="frequency">
          <ref name="unsignedInt"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="mode">
          <choice>
            <value>auto</value>
            <value>native</value>
            <value>emulate</value>
            <value>paravirt</value>
438
            <value>smpsafe</value>
L
Laine Stump 已提交
439 440 441 442 443 444 445 446 447 448 449 450 451 452
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="present">
          <choice>
            <value>yes</value>
            <value>no</value>
          </choice>
        </attribute>
      </optional>
      <empty/>
    </element>
  </define>
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
  <define name="catchup">
    <element name="catchup">
      <optional>
        <attribute name="threshold">
          <ref name="unsignedInt"/>
        </attribute>
        <attribute name="slew">
          <ref name="unsignedInt"/>
        </attribute>
        <attribute name="limit">
          <ref name="unsignedInt"/>
        </attribute>
      </optional>
    </element>
  </define>
L
Laine Stump 已提交
468
<!--
469 470 471 472
      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.
    -->
473
  <define name="bootloader">
474
    <interleave>
475 476 477 478 479
      <element name="bootloader">
        <choice>
          <ref name="absFilePath"/>
          <empty/>
        </choice>
480 481
      </element>
      <optional>
482 483 484
        <element name="bootloader_args">
          <text/>
        </element>
485 486
      </optional>
    </interleave>
487
  </define>
488
  <define name="osbootkernel">
489
    <interleave>
490 491
      <element name="kernel">
        <ref name="absFilePath"/>
492 493
      </element>
      <optional>
494 495 496
        <element name="initrd">
          <ref name="absFilePath"/>
        </element>
497
      </optional>
498
      <optional>
499 500
        <element name="root">
          <ref name="devicePath"/>
501 502
        </element>
      </optional>
503
      <optional>
504 505 506
        <element name="cmdline">
          <text/>
        </element>
507 508 509
      </optional>
    </interleave>
  </define>
510 511 512
  <define name="osbootdev">
    <element name="boot">
      <attribute name="dev">
513 514 515 516 517 518 519 520
        <choice>
          <value>hd</value>
          <value>fd</value>
          <value>cdrom</value>
          <value>network</value>
        </choice>
      </attribute>
      <empty/>
521
    </element>
522
  </define>
523
  <define name="diskspec">
524
    <optional>
525
      <ref name="driver"/>
526
    </optional>
527
    <ref name="target"/>
528
    <optional>
529
      <element name="readonly">
530
        <empty/>
531
      </element>
532 533
    </optional>
    <optional>
534
      <element name="shareable">
535 536 537
        <empty/>
      </element>
    </optional>
538 539 540 541 542
    <optional>
      <element name="serial">
        <ref name="diskSerial"/>
      </element>
    </optional>
543 544 545
    <optional>
      <ref name="encryption"/>
    </optional>
546 547 548
    <optional>
      <ref name="address"/>
    </optional>
549 550 551 552 553 554
  </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

    -->
555 556
  <define name="disk">
    <element name="disk">
557
      <optional>
558 559 560 561 562 563 564
        <attribute name="device">
          <choice>
            <value>floppy</value>
            <value>disk</value>
            <value>cdrom</value>
          </choice>
        </attribute>
565
      </optional>
566 567
      <choice>
        <group>
568 569
          <attribute name="type">
            <value>file</value>
570
          </attribute>
571 572 573 574 575 576 577 578 579 580 581
          <interleave>
            <optional>
              <element name="source">
                <attribute name="file">
                  <ref name="absFilePath"/>
                </attribute>
                <empty/>
              </element>
            </optional>
            <ref name="diskspec"/>
          </interleave>
582 583
        </group>
        <group>
584 585 586 587 588 589 590 591 592 593 594 595 596 597
          <attribute name="type">
            <value>block</value>
          </attribute>
          <interleave>
            <optional>
              <element name="source">
                <attribute name="dev">
                  <ref name="deviceName"/>
                </attribute>
                <empty/>
              </element>
            </optional>
            <ref name="diskspec"/>
          </interleave>
598
        </group>
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614
        <group>
          <attribute name="type">
            <value>dir</value>
          </attribute>
          <interleave>
            <optional>
              <element name="source">
                <attribute name="dir">
                  <ref name="absFilePath"/>
                </attribute>
                <empty/>
              </element>
            </optional>
            <ref name="diskspec"/>
          </interleave>
        </group>
615
        <ref name="diskspec"/>
616 617 618
      </choice>
    </element>
  </define>
619 620 621 622
  <define name="target">
    <element name="target">
      <attribute name="dev">
        <ref name="deviceName"/>
623
      </attribute>
624
      <optional>
625 626 627 628 629 630 631 632 633 634 635
        <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>
          </choice>
        </attribute>
636
      </optional>
637 638 639
    </element>
  </define>
  <!--
640
      Disk may use a special driver for access. Currently this is
641 642 643
      only defined for Xen for tap/aio and file, but will certainly be
      extended in the future, and libvirt doesn't look for specific values.
    -->
644 645
  <define name="driver">
    <element name="driver">
646
      <choice>
647 648 649 650 651 652 653 654 655 656 657 658
        <group>
          <ref name="driverFormat"/>
          <optional>
            <ref name="driverCache"/>
          </optional>
        </group>
        <group>
          <optional>
            <ref name="driverFormat"/>
          </optional>
          <ref name="driverCache"/>
        </group>
659
      </choice>
660 661 662
      <optional>
        <ref name="driverErrorPolicy"/>
      </optional>
663 664
      <empty/>
    </element>
665
  </define>
666 667 668
  <define name="driverFormat">
    <attribute name="name">
      <ref name="genericName"/>
669 670
    </attribute>
    <optional>
671 672
      <attribute name="type">
        <ref name="genericName"/>
673 674 675
      </attribute>
    </optional>
  </define>
676 677
  <define name="driverCache">
    <attribute name="cache">
678
      <choice>
679 680 681
        <value>none</value>
        <value>writeback</value>
        <value>writethrough</value>
682 683 684
      </choice>
    </attribute>
  </define>
685 686 687 688 689
  <define name="driverErrorPolicy">
    <attribute name="error_policy">
      <choice>
        <value>stop</value>
        <value>ignore</value>
690
        <value>enospace</value>
691 692 693
      </choice>
    </attribute>
  </define>
694 695
  <define name="controller">
    <element name="controller">
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
      <choice>
        <group>
          <optional>
            <attribute name="type">
              <choice>
                <value>fdc</value>
                <value>ide</value>
                <value>scsi</value>
                <value>sata</value>
              </choice>
            </attribute>
          </optional>
        </group>
        <!-- virtio-serial can have 2 additional attributes -->
        <group>
          <attribute name="type">
            <value>virtio-serial</value>
          </attribute>
          <optional>
            <attribute name="ports">
              <ref name="unsignedInt"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="vectors">
              <ref name="unsignedInt"/>
            </attribute>
          </optional>
        </group>
      </choice>
726 727 728
      <attribute name="index">
        <ref name="unsignedInt"/>
      </attribute>
729 730 731
      <optional>
        <attribute name="model">
          <choice>
732
            <value>auto</value>
733 734 735
            <value>buslogic</value>
            <value>lsilogic</value>
            <value>lsisas1068</value>
736
            <value>vmpvscsi</value>
737 738 739
          </choice>
        </attribute>
      </optional>
740
      <optional>
M
Matthew Booth 已提交
741
        <ref name="address"/>
742 743 744
      </optional>
    </element>
  </define>
745 746
  <define name="filesystem">
    <element name="filesystem">
747 748
      <choice>
        <group>
749 750
          <attribute name="type">
            <value>file</value>
751
          </attribute>
752 753 754 755 756 757 758 759 760
          <interleave>
            <element name="source">
              <attribute name="file">
                <ref name="absFilePath"/>
              </attribute>
              <empty/>
            </element>
            <ref name="filesystemtgt"/>
          </interleave>
761 762
        </group>
        <group>
763 764 765 766 767 768 769 770 771 772 773 774
          <attribute name="type">
            <value>block</value>
          </attribute>
          <interleave>
            <element name="source">
              <attribute name="dev">
                <ref name="deviceName"/>
              </attribute>
              <empty/>
            </element>
            <ref name="filesystemtgt"/>
          </interleave>
775 776
        </group>
        <group>
777 778 779 780 781 782 783 784 785 786 787 788
          <attribute name="type">
            <value>mount</value>
          </attribute>
          <interleave>
            <element name="source">
              <attribute name="dir">
                <ref name="absFilePath"/>
              </attribute>
              <empty/>
            </element>
            <ref name="filesystemtgt"/>
          </interleave>
789 790
        </group>
        <group>
791 792 793 794 795 796 797 798 799 800 801 802
          <attribute name="type">
            <value>template</value>
          </attribute>
          <interleave>
            <element name="source">
              <attribute name="name">
                <ref name="genericName"/>
              </attribute>
              <empty/>
            </element>
            <ref name="filesystemtgt"/>
          </interleave>
803 804
        </group>
      </choice>
805
      <optional>
M
Matthew Booth 已提交
806
        <ref name="address"/>
807 808 809 810 811 812 813
        <attribute name="accessmode">
        <choice>
          <value>passthrough</value>
          <value>mapped</value>
          <value>squash</value>
        </choice>
        </attribute>
814
      </optional>
815 816
    </element>
  </define>
817 818 819 820
  <define name="filesystemtgt">
    <element name="target">
      <attribute name="dir">
        <ref name="absDirPath"/>
821 822 823 824
      </attribute>
      <empty/>
    </element>
  </define>
825
  <!--
826 827 828
      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
829
      options. FIXME
830
    -->
831 832
  <define name="interface">
    <element name="interface">
833 834
      <choice>
        <group>
835
          <attribute name="type">
836 837
            <value>bridge</value>
          </attribute>
838
          <interleave>
839
            <optional>
840 841 842 843 844 845
              <element name="source">
                <attribute name="bridge">
                  <ref name="deviceName"/>
                </attribute>
                <empty/>
              </element>
846
            </optional>
847 848 849
            <ref name="interface-options"/>
          </interleave>
        </group>
850
        <group>
851
          <attribute name="type">
852 853
            <value>ethernet</value>
          </attribute>
854
          <interleave>
855
            <optional>
856 857 858 859 860 861
              <element name="source">
                <attribute name="dev">
                  <ref name="deviceName"/>
                </attribute>
                <empty/>
              </element>
862
            </optional>
863 864 865
            <ref name="interface-options"/>
          </interleave>
        </group>
866
        <group>
867
          <attribute name="type">
868 869
            <value>network</value>
          </attribute>
870 871 872 873 874 875 876 877 878 879
          <interleave>
            <element name="source">
              <attribute name="network">
                <ref name="deviceName"/>
              </attribute>
              <empty/>
            </element>
            <ref name="interface-options"/>
          </interleave>
        </group>
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895
        <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>
              <empty/>
            </element>
896 897 898
            <optional>
              <ref name="virtualPortProfile"/>
            </optional>
899 900 901
            <ref name="interface-options"/>
          </interleave>
        </group>
902
        <group>
903
          <attribute name="type">
904 905
            <value>user</value>
          </attribute>
906 907 908 909
          <interleave>
            <ref name="interface-options"/>
          </interleave>
        </group>
D
Daniel Veillard 已提交
910 911 912 913 914 915 916 917 918 919 920 921 922 923
        <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>
924 925 926 927 928 929
      </choice>
    </element>
  </define>
  <!--
      The interface options possible are:
        - the MAC address
930 931 932
        - the IP address bound to the interface
        - the name of the script used to set up the binding
        - the target device used
933
    -->
934
  <define name="interface-options">
935 936
    <interleave>
      <optional>
937 938 939 940 941 942
        <element name="target">
          <attribute name="dev">
            <ref name="deviceName"/>
          </attribute>
          <empty/>
        </element>
943 944
      </optional>
      <optional>
945 946 947 948 949 950
        <element name="mac">
          <attribute name="address">
            <ref name="addrMAC"/>
          </attribute>
          <empty/>
        </element>
951 952
      </optional>
      <optional>
953 954 955 956 957 958
        <element name="ip">
          <attribute name="address">
            <ref name="addrIP"/>
          </attribute>
          <empty/>
        </element>
959 960
      </optional>
      <optional>
961 962 963 964 965 966
        <element name="script">
          <attribute name="path">
            <ref name="filePath"/>
          </attribute>
          <empty/>
        </element>
967 968
      </optional>
      <optional>
969 970 971 972
        <element name="model">
          <attribute name="type"/>
          <empty/>
        </element>
973
      </optional>
974
      <optional>
M
Matthew Booth 已提交
975
        <ref name="address"/>
976
      </optional>
977 978 979 980 981
      <optional>
        <element name="filterref">
          <ref name="filterref-node-attributes"/>
        </element>
      </optional>
982
    </interleave>
983
  </define>
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
  <define name="virtualPortProfile">
    <choice>
      <group>
        <element name="virtualport">
          <attribute name="type">
            <value>802.1Qbg</value>
          </attribute>
          <element name="parameters">
            <attribute name="managerid">
              <ref name="uint8range"/>
            </attribute>
            <attribute name="typeid">
              <ref name="uint24range"/>
            </attribute>
            <attribute name="typeidversion">
              <ref name="uint8range"/>
            </attribute>
            <optional>
              <attribute name="instanceid">
                <ref name="UUID"/>
              </attribute>
            </optional>
          </element>
        </element>
      </group>
      <group>
        <element name="virtualport">
          <attribute name="type">
            <value>802.1Qbh</value>
          </attribute>
          <element name="parameters">
            <attribute name="profileid">
              <ref name="virtualPortProfileID"/>
            </attribute>
          </element>
        </element>
      </group>
    </choice>
  </define>
1023
  <!--
1024
      An emulator description is just a path to the binary used for the task
1025
    -->
1026 1027 1028
  <define name="emulator">
    <element name="emulator">
      <ref name="absFilePath"/>
1029 1030 1031
    </element>
  </define>
  <!--
1032
      A graphic description, currently in Xen only 2 types are supported:
1033
        - sdl with optional display, xauth and fullscreen
1034
        - vnc with a required port and optional listen IP address, password
1035
          and keymap
1036
    -->
1037 1038
  <define name="graphic">
    <element name="graphics">
1039
      <choice>
1040 1041 1042 1043 1044 1045 1046 1047 1048
        <group>
          <attribute name="type">
            <value>sdl</value>
          </attribute>
          <optional>
            <attribute name="display">
              <text/>
            </attribute>
          </optional>
1049
          <optional>
1050
            <attribute name="xauth">
1051 1052 1053
              <text/>
            </attribute>
          </optional>
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
          <optional>
            <attribute name="fullscreen">
              <choice>
                <value>yes</value>
                <value>no</value>
              </choice>
            </attribute>
          </optional>
        </group>
        <group>
          <attribute name="type">
            <value>vnc</value>
          </attribute>
          <optional>
            <attribute name="port">
              <ref name="PortNumber"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="autoport">
              <choice>
                <value>yes</value>
                <value>no</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="listen">
              <ref name="addrIP"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="passwd">
1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="keymap">
              <text/>
            </attribute>
          </optional>
        </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">
              <choice>
                <value>yes</value>
                <value>no</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="listen">
              <ref name="addrIP"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="passwd">
1125 1126 1127 1128 1129 1130 1131 1132
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="keymap">
              <text/>
            </attribute>
          </optional>
1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151
          <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>
                </choice>
              </attribute>
              <attribute name="mode">
                <choice>
                  <value>any</value>
                  <value>secure</value>
                  <value>insecure</value>
                </choice>
              </attribute>
1152
              <empty/>
1153 1154
            </element>
          </zeroOrMore>
1155
        </group>
1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212
        <group>
          <attribute name="type">
            <value>rdp</value>
          </attribute>
          <optional>
            <attribute name="port">
              <ref name="PortNumber"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="autoport">
              <choice>
                <value>yes</value>
                <value>no</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="replaceUser">
              <choice>
                <value>yes</value>
                <value>no</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="multiUser">
              <choice>
                <value>yes</value>
                <value>no</value>
              </choice>
            </attribute>
          </optional>
          <optional>
            <attribute name="listen">
              <ref name="addrIP"/>
            </attribute>
          </optional>
        </group>
        <group>
          <attribute name="type">
            <value>desktop</value>
          </attribute>
          <optional>
            <attribute name="display">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="fullscreen">
              <choice>
                <value>yes</value>
                <value>no</value>
              </choice>
            </attribute>
          </optional>
        </group>
1213 1214 1215
      </choice>
    </element>
  </define>
1216
  <!--
1217 1218
     A video adapter description, allowing configuration of device
     model, number of virtual heads, and video ram size
1219 1220 1221 1222
   -->
  <define name="video">
    <element name="video">
      <optional>
R
Richard Jones 已提交
1223
        <element name="model">
1224 1225 1226 1227 1228 1229 1230
          <attribute name="type">
            <choice>
              <value>vga</value>
              <value>cirrus</value>
              <value>vmvga</value>
              <value>xen</value>
              <value>vbox</value>
1231
              <value>qxl</value>
1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243
            </choice>
          </attribute>
          <optional>
            <attribute name="vram">
              <ref name="unsignedInt"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="heads">
              <ref name="unsignedInt"/>
            </attribute>
          </optional>
1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263
          <optional>
            <element name="acceleration">
              <optional>
                <attribute name="accel3d">
                  <choice>
                    <value>yes</value>
                    <value>no</value>
                  </choice>
                </attribute>
              </optional>
              <optional>
                <attribute name="accel2d">
                  <choice>
                    <value>yes</value>
                    <value>no</value>
                  </choice>
                </attribute>
              </optional>
            </element>
          </optional>
R
Richard Jones 已提交
1264
        </element>
1265
      </optional>
1266 1267 1268
      <optional>
        <ref name="address"/>
      </optional>
1269 1270
    </element>
  </define>
1271 1272 1273 1274
  <!--
      When a domain terminates multiple policies can be applied depending
      on how it ended:
    -->
1275
  <define name="termination">
1276 1277
    <interleave>
      <optional>
1278 1279 1280
        <element name="on_reboot">
          <ref name="offOptions"/>
        </element>
1281 1282
      </optional>
      <optional>
1283 1284 1285
        <element name="on_poweroff">
          <ref name="offOptions"/>
        </element>
1286 1287
      </optional>
      <optional>
1288
        <element name="on_crash">
1289
          <ref name="crashOptions"/>
1290
        </element>
1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301
      </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
    -->
1302
  <define name="offOptions">
1303 1304 1305 1306 1307 1308 1309
    <choice>
      <value>destroy</value>
      <value>restart</value>
      <value>preserve</value>
      <value>rename-restart</value>
    </choice>
  </define>
1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332
  <!--
      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>
1333 1334 1335 1336
  <!--
      Specific setup for a qemu emulated character device.  Note: this
      definition doesn't fully specify the constraints on this node.
    -->
1337
  <define name="qemucdev">
1338
    <ref name="qemucdevSrcType"/>
1339 1340 1341 1342 1343
    <optional>
      <attribute name="tty">
        <ref name="devicePath"/>
      </attribute>
    </optional>
1344 1345 1346
    <interleave>
      <ref name="qemucdevSrcDef"/>
      <optional>
1347
        <ref name="qemucdevTgtDef"/>
1348
      </optional>
1349
      <optional>
M
Matthew Booth 已提交
1350
        <ref name="address"/>
1351
      </optional>
1352 1353
    </interleave>
  </define>
1354 1355 1356 1357 1358 1359 1360

  <define name="qemucdevConsoleTgtType">
    <attribute name="type">
      <choice>
        <value>xen</value>
        <value>serial</value>
        <value>uml</value>
C
Cole Robinson 已提交
1361
        <value>virtio</value>
1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378
      </choice>
    </attribute>
  </define>

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

1379
  <define name="qemucdevSrcType">
1380
    <attribute name="type">
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393
      <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>
      </choice>
    </attribute>
1394 1395
  </define>
  <define name="qemucdevSrcDef">
1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414
    <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="wiremode"/>
        </optional>
      </element>
    </zeroOrMore>
1415 1416 1417 1418 1419 1420 1421
    <optional>
      <element name="protocol">
        <optional>
          <attribute name="type"/>
        </optional>
      </element>
    </optional>
1422
  </define>
1423 1424 1425 1426
  <!--
      The description for a console
      just a tty device
    -->
1427 1428
  <define name="console">
    <element name="console">
1429 1430 1431
      <choice>
        <group>
          <optional>
1432 1433
            <attribute name="tty">
              <ref name="devicePath"/>
1434 1435 1436 1437
            </attribute>
          </optional>
          <empty/>
        </group>
C
Cole Robinson 已提交
1438 1439 1440
        <choice>
          <ref name="qemucdev"/>
        </choice>
1441 1442 1443
      </choice>
    </element>
  </define>
1444 1445 1446
  <define name="sound">
    <element name="sound">
      <attribute name="model">
1447 1448 1449 1450
        <choice>
          <value>sb16</value>
          <value>es1370</value>
          <value>pcspk</value>
1451
          <value>ac97</value>
1452
        </choice>
1453
      </attribute>
1454 1455 1456
      <optional>
        <ref name="address"/>
      </optional>
1457 1458
    </element>
  </define>
R
Richard Jones 已提交
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477
  <define name="watchdog">
    <element name="watchdog">
      <attribute name="model">
        <choice>
          <value>i6300esb</value>
          <value>ib700</value>
        </choice>
      </attribute>
      <optional>
        <attribute name="action">
          <choice>
            <value>reset</value>
            <value>shutdown</value>
            <value>poweroff</value>
            <value>pause</value>
            <value>none</value>
          </choice>
        </attribute>
      </optional>
1478 1479 1480
      <optional>
        <ref name="address"/>
      </optional>
R
Richard Jones 已提交
1481 1482
    </element>
  </define>
1483 1484 1485 1486 1487 1488
  <define name="memballoon">
    <element name="memballoon">
      <attribute name="model">
        <choice>
          <value>virtio</value>
          <value>xen</value>
1489
          <value>none</value>
1490 1491 1492 1493 1494 1495 1496
        </choice>
      </attribute>
      <optional>
        <ref name="address"/>
      </optional>
    </element>
  </define>
1497 1498 1499
  <define name="parallel">
    <element name="parallel">
      <ref name="qemucdev"/>
1500 1501
    </element>
  </define>
1502 1503 1504
  <define name="serial">
    <element name="serial">
      <ref name="qemucdev"/>
1505 1506
    </element>
  </define>
1507 1508
  <define name="guestfwdTarget">
    <element name="target">
1509 1510 1511 1512 1513
      <attribute name="type">
        <value>guestfwd</value>
      </attribute>
      <attribute name="address"/>
      <attribute name="port"/>
1514 1515
    </element>
  </define>
1516 1517 1518 1519 1520 1521 1522 1523 1524 1525
  <define name="virtioTarget">
    <element name="target">
      <attribute name="type">
          <value>virtio</value>
      </attribute>
      <optional>
        <attribute name="name"/>
      </optional>
    </element>
  </define>
1526 1527 1528 1529 1530
  <define name="channel">
    <element name="channel">
      <ref name="qemucdevSrcType"/>
      <interleave>
        <ref name="qemucdevSrcDef"/>
1531 1532 1533 1534
        <choice>
          <ref name="guestfwdTarget"/>
          <ref name="virtioTarget"/>
        </choice>
M
Matthew Booth 已提交
1535 1536 1537
        <optional>
          <ref name="address"/>
        </optional>
1538 1539 1540
      </interleave>
    </element>
  </define>
1541 1542 1543
  <define name="input">
    <element name="input">
      <attribute name="type">
1544 1545 1546 1547 1548 1549
        <choice>
          <value>tablet</value>
          <value>mouse</value>
        </choice>
      </attribute>
      <optional>
1550
        <attribute name="bus">
1551 1552 1553 1554 1555 1556 1557
          <choice>
            <value>ps2</value>
            <value>usb</value>
            <value>xen</value>
          </choice>
        </attribute>
      </optional>
1558
      <optional>
M
Matthew Booth 已提交
1559
        <ref name="address"/>
1560
      </optional>
1561 1562
    </element>
  </define>
1563 1564
  <define name="hostdev">
    <element name="hostdev">
1565
      <optional>
1566
        <attribute name="mode">
1567
          <choice>
1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581
            <value>subsystem</value>
            <value>capabilities</value>
          </choice>
        </attribute>
        <attribute name="type">
          <choice>
            <value>usb</value>
            <value>pci</value>
          </choice>
        </attribute>
        <attribute name="managed">
          <choice>
            <value>yes</value>
            <value>no</value>
1582 1583 1584 1585
          </choice>
        </attribute>
      </optional>
      <group>
1586 1587
        <element name="source">
          <choice>
M
Matthew Booth 已提交
1588
            <group>
1589
              <ref name="usbproduct"/>
M
Matthew Booth 已提交
1590 1591 1592 1593
              <optional>
                <ref name="usbaddress"/>
              </optional>
            </group>
1594
            <ref name="usbaddress"/>
1595 1596 1597
            <element name="address">
              <ref name="pciaddress"/>
            </element>
1598 1599
          </choice>
        </element>
1600
      </group>
1601 1602 1603
      <optional>
        <ref name="address"/>
      </optional>
1604 1605 1606 1607 1608
    </element>
  </define>
  <define name="usbproduct">
    <element name="vendor">
      <attribute name="id">
1609
        <ref name="usbId"/>
1610 1611 1612 1613
      </attribute>
    </element>
    <element name="product">
      <attribute name="id">
1614
        <ref name="usbId"/>
1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627
      </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>
1628
  <define name="pciaddress">
1629 1630 1631
    <optional>
      <attribute name="domain">
        <ref name="pciDomain"/>
1632
      </attribute>
1633 1634 1635 1636 1637 1638 1639 1640 1641 1642
    </optional>
    <attribute name="bus">
      <ref name="pciBus"/>
    </attribute>
    <attribute name="slot">
      <ref name="pciSlot"/>
    </attribute>
    <attribute name="function">
      <ref name="pciFunc"/>
    </attribute>
1643
  </define>
1644 1645 1646 1647 1648 1649 1650 1651
  <define name="driveaddress">
    <optional>
      <attribute name="controller">
        <ref name="driveController"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="bus">
M
Matthew Booth 已提交
1652
        <ref name="driveBus"/>
1653 1654 1655 1656 1657 1658
      </attribute>
    </optional>
    <attribute name="unit">
      <ref name="driveUnit"/>
    </attribute>
  </define>
1659 1660 1661 1662 1663 1664 1665 1666 1667
  <define name="virtioserialaddress">
    <attribute name="controller">
      <ref name="driveController"/>
    </attribute>
    <optional>
      <attribute name="bus">
        <ref name="driveBus"/>
      </attribute>
    </optional>
1668 1669 1670 1671 1672
    <optional>
      <attribute name="port">
        <ref name="driveUnit"/>
      </attribute>
    </optional>
1673
  </define>
1674
  <!--
1675
      Devices attached to a domain.
1676
    -->
1677 1678
  <define name="devices">
    <element name="devices">
1679
      <interleave>
1680 1681 1682 1683 1684 1685
        <optional>
          <ref name="emulator"/>
        </optional>
        <zeroOrMore>
          <choice>
            <ref name="disk"/>
1686
            <ref name="controller"/>
1687 1688 1689 1690 1691 1692
            <ref name="filesystem"/>
            <ref name="interface"/>
            <ref name="input"/>
            <ref name="sound"/>
            <ref name="hostdev"/>
            <ref name="graphic"/>
1693
            <ref name="video"/>
1694 1695 1696
            <ref name="console"/>
            <ref name="parallel"/>
            <ref name="serial"/>
1697
            <ref name="channel"/>
1698 1699
          </choice>
        </zeroOrMore>
R
Richard Jones 已提交
1700 1701 1702
        <optional>
          <ref name="watchdog"/>
        </optional>
1703 1704 1705
        <optional>
          <ref name="memballoon"/>
        </optional>
1706 1707 1708
      </interleave>
    </element>
  </define>
1709 1710 1711
  <!--
      A set of optional features: PAE, APIC and ACPI support
    -->
1712
  <define name="features">
1713 1714 1715
    <optional>
      <element name="features">
        <interleave>
1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731
          <optional>
            <element name="pae">
              <empty/>
            </element>
          </optional>
          <optional>
            <element name="apic">
              <empty/>
            </element>
          </optional>
          <optional>
            <element name="acpi">
              <empty/>
            </element>
          </optional>
        </interleave>
1732 1733 1734
      </element>
    </optional>
  </define>
J
Jiri Denemark 已提交
1735 1736 1737 1738 1739
  <!--
      CPU specification
      -->
  <define name="cpu">
    <element name="cpu">
1740 1741 1742 1743 1744 1745 1746
      <choice>
        <ref name="cpuTopology"/>
        <group>
          <ref name="cpuMatch"/>
          <interleave>
            <ref name="cpuModel"/>
            <optional>
J
Jiri Denemark 已提交
1747
              <ref name="cpuVendor"/>
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
              <ref name="cpuTopology"/>
            </optional>
            <zeroOrMore>
              <ref name="cpuFeature"/>
            </zeroOrMore>
          </interleave>
        </group>
      </choice>
    </element>
  </define>

  <define name="cpuMatch">
    <attribute name="match">
      <choice>
        <value>minimum</value>
        <value>exact</value>
        <value>strict</value>
      </choice>
    </attribute>
  </define>

  <define name="cpuModel">
    <element name="model">
      <text/>
    </element>
  </define>

J
Jiri Denemark 已提交
1775 1776 1777 1778 1779 1780
  <define name="cpuVendor">
    <element name="vendor">
      <text/>
    </element>
  </define>

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
  <define name="cpuFeature">
    <element name="feature">
      <attribute name="policy">
        <choice>
          <value>force</value>
          <value>require</value>
          <value>optional</value>
          <value>disable</value>
          <value>forbid</value>
        </choice>
      </attribute>
      <attribute name="name">
        <ref name="featureName"/>
      </attribute>
      <empty/>
    </element>
  </define>

  <define name="cpuTopology">
    <element name="topology">
      <attribute name="sockets">
        <ref name="positiveInteger"/>
      </attribute>
      <attribute name="cores">
        <ref name="positiveInteger"/>
      </attribute>
      <attribute name="threads">
        <ref name="positiveInteger"/>
      </attribute>
J
Jiri Denemark 已提交
1810 1811
    </element>
  </define>
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
  <!--
      System information specification:
       Placeholder for system specific informations 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">
      <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>
      </interleave>
    </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>
    </choice>
  </define>

  <define name="sysinfo-value">
    <data type="string">
      <param name='pattern'>[a-zA-Z0-9/\-_\. ]+</param>
    </data>
  </define>

1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897
  <define name="smbios">
    <element name="smbios">
      <attribute name="mode">
        <choice>
          <value>emulate</value>
          <value>host</value>
          <value>sysinfo</value>
        </choice>
      </attribute>
      <empty/>
    </element>
  </define>

1898 1899 1900
  <define name="address">
    <element name="address">
      <choice>
M
Matthew Booth 已提交
1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912
        <group>
          <attribute name="type">
            <value>pci</value>
          </attribute>
          <ref name="pciaddress"/>
        </group>
        <group>
          <attribute name="type">
            <value>drive</value>
          </attribute>
          <ref name="driveaddress"/>
        </group>
1913 1914 1915 1916 1917 1918
        <group>
          <attribute name="type">
            <value>virtio-serial</value>
          </attribute>
          <ref name="virtioserialaddress"/>
        </group>
1919 1920 1921 1922
      </choice>
    </element>
  </define>

1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938
  <define name="filterref-node-attributes">
    <attribute name="filter">
      <data type="NCName"/>
    </attribute>
    <optional>
      <element name="parameter">
        <attribute name="name">
          <ref name="filter-param-name"/>
        </attribute>
        <attribute name="value">
          <ref name="filter-param-value"/>
        </attribute>
      </element>
    </optional>
  </define>

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
  <!--
       Optional hypervisor extensions in their own namespace:
         QEmu
    -->
  <define name="qemucmdline">
    <element name="commandline" ns="http://libvirt.org/schemas/domain/qemu/1.0">
      <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>
    </element>
  </define>

1964 1965 1966 1967 1968 1969 1970 1971
  <!--
       Type library

       Our unsignedInt doesn't allow a leading '+' in its lexical form
       A domain name shoul be made of ascii, numbers, _-+ and is non-empty
       UUID currently allows only the 32 characters strict syntax
       memoryKB request at least 4Mbytes though Xen will grow bigger if too low
    -->
1972 1973
  <define name="unsignedInt">
    <data type="unsignedInt">
1974 1975 1976
      <param name="pattern">[0-9]+</param>
    </data>
  </define>
J
Jiri Denemark 已提交
1977 1978 1979 1980 1981
  <define name='positiveInteger'>
    <data type='positiveInteger'>
      <param name="pattern">[0-9]+</param>
    </data>
  </define>
E
Eric Blake 已提交
1982 1983 1984 1985 1986
  <define name="cpuset">
    <data type="string">
      <param name="pattern">([0-9]+(-[0-9]+)?|\^[0-9]+)(,([0-9]+(-[0-9]+)?|\^[0-9]+))*</param>
    </data>
  </define>
1987 1988
  <define name="countCPU">
    <data type="unsignedShort">
1989 1990 1991 1992
      <param name="pattern">[0-9]+</param>
      <param name="minInclusive">1</param>
    </data>
  </define>
1993 1994
  <define name="PortNumber">
    <data type="short">
1995
      <param name="minInclusive">-1</param>
1996 1997
    </data>
  </define>
1998 1999
  <define name="memoryKB">
    <data type="unsignedInt">
2000 2001 2002 2003
      <param name="pattern">[0-9]+</param>
      <param name="minInclusive">4000</param>
    </data>
  </define>
2004 2005
  <define name="domainName">
    <data type="string">
2006
      <param name="pattern">[A-Za-z0-9_\.\+\-&amp;:/]+</param>
2007 2008
    </data>
  </define>
2009 2010 2011 2012 2013
  <define name="diskSerial">
    <data type="string">
      <param name="pattern">[A-Za-z0-9_\.\+\-]+</param>
    </data>
  </define>
2014 2015
  <define name="genericName">
    <data type="string">
2016 2017 2018
      <param name="pattern">[a-zA-Z0-9_\+\-]+</param>
    </data>
  </define>
2019
  <define name="UUID">
2020
    <choice>
2021
      <data type="string">
2022 2023
        <param name="pattern">[a-fA-F0-9]{32}</param>
      </data>
2024
      <data type="string">
2025 2026 2027
        <param name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param>
      </data>
    </choice>
2028
  </define>
2029 2030
  <define name="filePath">
    <data type="string">
2031
      <param name="pattern">[a-zA-Z0-9_\.\+\-&amp;/%]+</param>
2032 2033
    </data>
  </define>
2034 2035
  <define name="absFilePath">
    <data type="string">
2036
      <param name="pattern">/[a-zA-Z0-9_\.\+\-&amp;/%]+</param>
2037 2038
    </data>
  </define>
2039 2040
  <define name="absDirPath">
    <data type="string">
2041 2042 2043
      <param name="pattern">/[a-zA-Z0-9_\.\+\-&amp;/%]*</param>
    </data>
  </define>
2044 2045
  <define name="devicePath">
    <data type="string">
2046
      <param name="pattern">/[a-zA-Z0-9_\+\-/%]+</param>
2047 2048
    </data>
  </define>
2049 2050
  <define name="deviceName">
    <data type="string">
2051
      <param name="pattern">[a-zA-Z0-9_\.\-:/]+</param>
2052 2053
    </data>
  </define>
2054 2055 2056 2057 2058
  <define name="bridgeMode">
    <data type="string">
      <param name="pattern">(vepa|bridge|private)</param>
    </data>
  </define>
2059 2060
  <define name="addrMAC">
    <data type="string">
2061 2062 2063
      <param name="pattern">([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}</param>
    </data>
  </define>
2064 2065
  <define name="addrIP">
    <data type="string">
2066 2067 2068
      <param name="pattern">([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9]</param>
    </data>
  </define>
2069 2070
  <define name="usbId">
    <data type="string">
2071 2072 2073
      <param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
    </data>
  </define>
2074 2075
  <define name="usbAddr">
    <data type="string">
2076 2077 2078
      <param name="pattern">(0x)?[0-9a-fA-F]{1,3}</param>
    </data>
  </define>
2079 2080
  <define name="pciDomain">
    <data type="string">
2081 2082 2083
      <param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
    </data>
  </define>
2084 2085
  <define name="pciBus">
    <data type="string">
2086 2087 2088
      <param name="pattern">(0x)?[0-9a-fA-F]{1,2}</param>
    </data>
  </define>
2089 2090
  <define name="pciSlot">
    <data type="string">
2091 2092 2093
      <param name="pattern">(0x)?[0-1]?[0-9a-fA-F]</param>
    </data>
  </define>
2094 2095
  <define name="pciFunc">
    <data type="string">
2096 2097 2098
      <param name="pattern">(0x)?[0-7]</param>
    </data>
  </define>
2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113
  <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="driveUnit">
    <data type="string">
      <param name="pattern">[0-9]{1,2}</param>
    </data>
  </define>
J
Jiri Denemark 已提交
2114 2115 2116 2117 2118
  <define name="featureName">
    <data type="string">
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
2119 2120 2121 2122 2123
  <define name="timeDelta">
    <data type="string">
      <param name="pattern">(-|\+)?[0-9]+</param>
    </data>
  </define>
2124 2125 2126 2127 2128
  <define name="timeZone">
    <data type="string">
      <param name="pattern">[a-zA-Z0-9_\.\+\-/]+</param>
    </data>
  </define>
2129 2130 2131 2132 2133 2134 2135 2136 2137 2138
  <define name="filter-param-name">
    <data type="string">
      <param name="pattern">[a-zA-Z0-9_]+</param>
    </data>
  </define>
  <define name="filter-param-value">
    <data type="string">
      <param name="pattern">[a-zA-Z0-9_\.:]+</param>
    </data>
  </define>
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
  <define name="uint8range">
    <choice>
      <data type="string">
        <param name="pattern">0x[0-9a-fA-F]{1,2}</param>
      </data>
      <data type="int">
        <param name="minInclusive">0</param>
        <param name="maxInclusive">255</param>
      </data>
    </choice>
  </define>
  <define name="uint24range">
    <choice>
      <data type="string">
        <param name="pattern">0x[0-9a-fA-F]{1,6}</param>
      </data>
      <data type="int">
        <param name="minInclusive">0</param>
        <param name="maxInclusive">16777215</param>
      </data>
    </choice>
  </define>
  <define name="virtualPortProfileID">
    <data type="string">
      <param name="maxLength">39</param>
    </data>
  </define>
2166
</grammar>