capability.rng 11.3 KB
Newer Older
1
<?xml version="1.0"?>
A
Aron Griffis 已提交
2
<!-- A Relax NG schema for the libvirt capabilities XML format -->
3 4
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
5
  <include href='basictypes.rng'/>
6 7 8 9 10 11 12 13 14 15
  <start>
    <ref name='capabilities'/>
  </start>


  <define name='capabilities'>
    <element name='capabilities'>
      <ref name='hostcaps'/>

      <zeroOrMore>
16
        <ref name='guestcaps'/>
17 18 19 20 21 22
      </zeroOrMore>
    </element>
  </define>

  <define name='hostcaps'>
    <element name='host'>
23 24 25 26 27
      <optional>
        <element name='uuid'>
          <ref name='UUID'/>
        </element>
      </optional>
28
      <element name='cpu'>
29 30 31 32 33 34 35 36 37
        <element name='arch'>
          <ref name='archnames'/>
        </element>
        <optional>
          <ref name='cpufeatures'/>
        </optional>
        <optional>
          <ref name='cpuspec'/>
        </optional>
38
      </element>
39 40 41
      <optional>
        <ref name='power_management'/>
      </optional>
42
      <optional>
43
        <ref name='migration'/>
44 45
      </optional>
      <optional>
46
        <ref name='topology'/>
47
      </optional>
48 49 50
      <optional>
        <ref name='cache'/>
      </optional>
51
      <zeroOrMore>
52
        <ref name='secmodel'/>
53
      </zeroOrMore>
54 55 56 57 58
    </element>
  </define>

  <define name='secmodel'>
    <element name='secmodel'>
59
      <interleave>
M
Michal Privoznik 已提交
60 61 62 63 64 65 66 67 68 69 70
        <element name='model'>
          <text/>
        </element>
        <element name='doi'>
          <text/>
        </element>
        <zeroOrMore>
          <element name='baselabel'>
            <attribute name='type'>
              <text/>
            </attribute>
71 72
            <text/>
          </element>
M
Michal Privoznik 已提交
73 74
        </zeroOrMore>
      </interleave>
75 76 77
    </element>
  </define>

78

79 80 81
  <define name='cpufeatures'>
    <element name='features'>
      <optional>
82
        <element name='pae'><empty/></element>
83 84
      </optional>
      <optional>
85
        <element name='nonpae'><empty/></element>
86 87
      </optional>
      <optional>
88
        <element name='vmx'><empty/></element>
89 90
      </optional>
      <optional>
91
        <element name='svm'><empty/></element>
92 93 94 95
      </optional>
    </element>
  </define>

J
Jiri Denemark 已提交
96 97 98 99
  <define name='cpuspec'>
    <element name='model'>
      <text/>
    </element>
J
Jiri Denemark 已提交
100 101 102 103 104
    <optional>
      <element name='vendor'>
        <text/>
      </element>
    </optional>
J
Jiri Denemark 已提交
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
    <element name='topology'>
      <attribute name='sockets'>
        <ref name='positiveInteger'/>
      </attribute>
      <attribute name='cores'>
        <ref name='positiveInteger'/>
      </attribute>
      <attribute name='threads'>
        <ref name='positiveInteger'/>
      </attribute>
    </element>
    <zeroOrMore>
      <element name='feature'>
        <attribute name='name'>
          <ref name='featureName'/>
        </attribute>
        <empty/>
      </element>
    </zeroOrMore>
M
Michal Privoznik 已提交
124 125 126
    <zeroOrMore>
      <ref name='pagesElem'/>
    </zeroOrMore>
J
Jiri Denemark 已提交
127 128
  </define>

129 130 131 132
  <define name='power_management'>
    <element name='power_management'>
      <interleave>
        <optional>
133
          <element name='suspend_mem'>
134 135 136 137
            <empty/>
          </element>
        </optional>
        <optional>
138
          <element name='suspend_disk'>
139 140 141
            <empty/>
          </element>
        </optional>
142
        <optional>
143
          <element name='suspend_hybrid'>
144 145 146
            <empty/>
          </element>
        </optional>
147 148 149 150
      </interleave>
    </element>
  </define>

151 152 153
  <define name='migration'>
    <element name='migration_features'>
      <optional>
154 155 156
        <element name='live'>
          <empty/>
        </element>
157 158
      </optional>
      <optional>
159 160 161 162
        <element name='uri_transports'>
          <oneOrMore>
            <element name='uri_transport'>
              <choice>
163
                <value>vpxmigr</value>
164
                <value>tcp</value>
165
                <value>rdma</value>
166 167 168 169
              </choice>
            </element>
          </oneOrMore>
        </element>
170 171 172 173 174 175 176
      </optional>
    </element>
  </define>

  <define name='topology'>
    <element name='topology'>
      <element name='cells'>
177
        <attribute name='num'>
178
          <ref name='unsignedInt'/>
179 180 181 182
        </attribute>
        <oneOrMore>
          <ref name='cell'/>
        </oneOrMore>
183 184 185 186 187 188 189
      </element>
    </element>
  </define>

  <define name='cell'>
    <element name='cell'>
      <attribute name='id'>
190
        <ref name='unsignedInt'/>
191 192
      </attribute>

193 194 195 196
      <optional>
        <ref name='memory'/>
      </optional>

M
Michal Privoznik 已提交
197 198 199 200
      <zeroOrMore>
        <ref name='pagesElem'/>
      </zeroOrMore>

201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
      <optional>
        <element name='distances'>
          <zeroOrMore>
            <element name='sibling'>
              <attribute name='id'>
                <ref name='unsignedInt'/>
              </attribute>
              <attribute name='value'>
                <ref name='unsignedInt'/>
              </attribute>
            </element>
          </zeroOrMore>
        </element>
      </optional>

216
      <optional>
217 218
        <element name='cpus'>
          <attribute name='num'>
219
            <ref name='unsignedInt'/>
220 221 222 223 224
          </attribute>
          <oneOrMore>
            <ref name='cpu'/>
          </oneOrMore>
        </element>
225 226 227 228
      </optional>
    </element>
  </define>

229 230 231 232 233 234
  <define name='memory'>
    <element name='memory'>
      <ref name='scaledInteger'/>
    </element>
  </define>

235 236 237
  <define name='cpu'>
    <element name='cpu'>
      <attribute name='id'>
238
        <ref name='unsignedInt'/>
239
      </attribute>
240 241 242 243 244 245 246 247 248 249 250
      <optional>
        <attribute name='socket_id'>
          <ref name='unsignedInt'/>
        </attribute>
        <attribute name='core_id'>
          <ref name='unsignedInt'/>
        </attribute>
        <attribute name='siblings'>
          <ref name='cpuset'/>
        </attribute>
      </optional>
251 252 253
    </element>
  </define>

254 255 256 257 258 259 260 261 262 263
  <define name='cache'>
    <element name='cache'>
      <oneOrMore>
        <element name='bank'>
          <attribute name='id'>
            <ref name='unsignedInt'/>
          </attribute>
          <attribute name='level'>
            <ref name='unsignedInt'/>
          </attribute>
264
          <ref name='cacheType'/>
265 266 267 268 269 270 271 272 273
          <attribute name='size'>
            <ref name='unsignedInt'/>
          </attribute>
          <attribute name='unit'>
            <ref name='unit'/>
          </attribute>
          <attribute name='cpus'>
            <ref name='cpuset'/>
          </attribute>
274 275
          <zeroOrMore>
            <element name='control'>
276
              <attribute name='granularity'>
277 278
                <ref name='unsignedInt'/>
              </attribute>
279 280 281 282 283
              <optional>
                <attribute name='min'>
                  <ref name='unsignedInt'/>
                </attribute>
              </optional>
284 285 286 287 288 289 290 291 292
              <attribute name='unit'>
                <ref name='unit'/>
              </attribute>
              <ref name='cacheType'/>
              <attribute name='maxAllocs'>
                <ref name='unsignedInt'/>
              </attribute>
            </element>
          </zeroOrMore>
293 294 295 296 297
        </element>
      </oneOrMore>
    </element>
  </define>

298 299 300 301 302 303 304 305 306 307
  <define name='cacheType'>
    <attribute name='type'>
      <choice>
        <value>both</value>
        <value>code</value>
        <value>data</value>
      </choice>
    </attribute>
  </define>

308 309 310 311 312
  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
313
        <ref name='features'/>
314 315 316 317 318 319 320
      </optional>
    </element>
  </define>

  <define name='ostype'>
    <element name='os_type'>
      <choice>
321
        <value>xen</value> <!-- Xen 3.0 pv -->
322 323
        <value>linux</value> <!-- same as 'xen' - meant to be legacy,
                                  but is also used by phyp driver -->
324 325 326
        <value>hvm</value> <!-- unmodified OS -->
        <value>exe</value> <!-- For container based virt -->
        <value>uml</value> <!-- user mode linux -->
327 328 329 330 331 332 333
      </choice>
    </element>
  </define>

  <define name='arch'>
    <element name='arch'>
      <attribute name='name'>
334
        <ref name='archnames'/>
335 336 337
      </attribute>
      <ref name='wordsize'/>
      <optional>
338
        <ref name='emulator'/>
339 340
      </optional>
      <optional>
341
        <ref name='loader'/>
342 343
      </optional>
      <zeroOrMore>
344
        <ref name='machine'/>
345 346
      </zeroOrMore>
      <oneOrMore>
347
        <ref name='domain'/>
348 349 350 351 352 353
      </oneOrMore>
    </element>
  </define>

  <define name='emulator'>
    <element name='emulator'>
354
      <ref name='absFilePath'/>
355 356 357 358 359
    </element>
  </define>

  <define name='loader'>
    <element name='loader'>
360
      <ref name='absFilePath'/>
361 362 363 364 365 366
    </element>
  </define>

  <define name='wordsize'>
    <element name='wordsize'>
      <choice>
367 368 369
        <value>31</value>
        <value>32</value>
        <value>64</value>
370 371 372 373 374 375
      </choice>
    </element>
  </define>

  <define name='machine'>
    <element name='machine'>
376 377 378 379 380
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
381 382 383 384 385
      <optional>
        <attribute name='maxCpus'>
          <ref name='unsignedInt'/>
        </attribute>
      </optional>
386 387 388 389 390 391 392
      <text/>
    </element>
  </define>

  <define name='domain'>
    <element name='domain'>
      <attribute name='type'>
393 394 395 396 397 398 399 400 401 402
        <choice>
          <value>qemu</value>
          <value>kqemu</value>
          <value>kvm</value>
          <value>xen</value>
          <value>uml</value>
          <value>lxc</value>
          <value>openvz</value>
          <value>test</value>
        </choice>
403 404 405
      </attribute>

      <optional>
406
        <ref name='emulator'/>
407
      </optional>
408
      <zeroOrMore>
409
        <ref name='machine'/>
410
      </zeroOrMore>
411 412 413 414 415
    </element>
  </define>

  <define name='features'>
    <element name='features'>
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
      <interleave>
        <optional>
          <element name='pae'>
            <empty/>
          </element>
        </optional>
        <optional>
          <element name='nonpae'>
            <empty/>
          </element>
        </optional>
        <optional>
          <element name='ia64_be'>
            <empty/>
          </element>
        </optional>
        <optional>
          <element name='acpi'>
            <ref name='featuretoggle'/>
            <empty/>
          </element>
        </optional>
        <optional>
          <element name='apic'>
            <ref name='featuretoggle'/>
            <empty/>
          </element>
        </optional>
        <optional>
          <element name='cpuselection'>
            <empty/>
          </element>
        </optional>
        <optional>
          <element name='deviceboot'>
            <empty/>
          </element>
        </optional>
454 455 456 457 458 459
        <optional>
          <element name='disksnapshot'>
            <ref name='featuretoggle'/>
            <empty/>
          </element>
        </optional>
460
      </interleave>
461 462 463 464 465
    </element>
  </define>

  <define name='featuretoggle'>
    <attribute name='toggle'>
466
      <ref name="virYesNo"/>
467 468
    </attribute>
    <attribute name='default'>
469
      <ref name="virOnOff"/>
470 471 472
    </attribute>
  </define>

J
Jiri Denemark 已提交
473 474 475 476 477
  <define name='featureName'>
    <data type='string'>
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
M
Michal Privoznik 已提交
478 479 480 481 482 483 484 485 486 487 488 489 490 491

  <define name='pagesElem'>
    <element name='pages'>
      <optional>
        <attribute name='unit'>
          <ref name='unit'/>
        </attribute>
      </optional>
      <attribute name='size'>
        <ref name='unsignedInt'/>
      </attribute>
      <ref name='unsignedInt'/>
    </element>
  </define>
492
</grammar>