capability.rng 10.7 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 60 61 62 63 64 65
      <interleave>
          <element name='model'>
            <text/>
          </element>
          <element name='doi'>
            <text/>
          </element>
66 67 68 69 70 71 72 73
          <zeroOrMore>
            <element name='baselabel'>
              <attribute name='type'>
                <text/>
              </attribute>
              <text/>
            </element>
          </zeroOrMore>
74
       </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 163 164 165 166 167 168 169
        <element name='uri_transports'>
          <oneOrMore>
            <element name='uri_transport'>
              <choice>
                <value>esx</value>
                <value>tcp</value>
                <value>xenmigr</value>
              </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 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
  <define name='cache'>
    <element name='cache'>
      <oneOrMore>
        <element name='bank'>
          <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='unsignedInt'/>
          </attribute>
          <attribute name='unit'>
            <ref name='unit'/>
          </attribute>
          <attribute name='cpus'>
            <ref name='cpuset'/>
          </attribute>
        </element>
      </oneOrMore>
    </element>
  </define>

285 286 287 288 289
  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
290
        <ref name='features'/>
291 292 293 294 295 296 297
      </optional>
    </element>
  </define>

  <define name='ostype'>
    <element name='os_type'>
      <choice>
298
        <value>xen</value> <!-- Xen 3.0 pv -->
299 300
        <value>linux</value> <!-- same as 'xen' - meant to be legacy,
                                  but is also used by phyp driver -->
301 302 303
        <value>hvm</value> <!-- unmodified OS -->
        <value>exe</value> <!-- For container based virt -->
        <value>uml</value> <!-- user mode linux -->
304 305 306 307 308 309 310
      </choice>
    </element>
  </define>

  <define name='arch'>
    <element name='arch'>
      <attribute name='name'>
311
        <ref name='archnames'/>
312 313 314
      </attribute>
      <ref name='wordsize'/>
      <optional>
315
        <ref name='emulator'/>
316 317
      </optional>
      <optional>
318
        <ref name='loader'/>
319 320
      </optional>
      <zeroOrMore>
321
        <ref name='machine'/>
322 323
      </zeroOrMore>
      <oneOrMore>
324
        <ref name='domain'/>
325 326 327 328 329 330
      </oneOrMore>
    </element>
  </define>

  <define name='emulator'>
    <element name='emulator'>
331
      <ref name='absFilePath'/>
332 333 334 335 336
    </element>
  </define>

  <define name='loader'>
    <element name='loader'>
337
      <ref name='absFilePath'/>
338 339 340 341 342 343
    </element>
  </define>

  <define name='wordsize'>
    <element name='wordsize'>
      <choice>
344 345 346
        <value>31</value>
        <value>32</value>
        <value>64</value>
347 348 349 350 351 352
      </choice>
    </element>
  </define>

  <define name='machine'>
    <element name='machine'>
353 354 355 356 357
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
358 359 360 361 362
      <optional>
        <attribute name='maxCpus'>
          <ref name='unsignedInt'/>
        </attribute>
      </optional>
363 364 365 366 367 368 369
      <text/>
    </element>
  </define>

  <define name='domain'>
    <element name='domain'>
      <attribute name='type'>
370 371 372 373 374 375 376 377 378 379
        <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>
380 381 382
      </attribute>

      <optional>
383
        <ref name='emulator'/>
384
      </optional>
385
      <zeroOrMore>
386
        <ref name='machine'/>
387
      </zeroOrMore>
388 389 390 391 392
    </element>
  </define>

  <define name='features'>
    <element name='features'>
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
      <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>
431 432 433 434 435 436
        <optional>
          <element name='disksnapshot'>
            <ref name='featuretoggle'/>
            <empty/>
          </element>
        </optional>
437
      </interleave>
438 439 440 441 442
    </element>
  </define>

  <define name='featuretoggle'>
    <attribute name='toggle'>
443
      <ref name="virYesNo"/>
444 445
    </attribute>
    <attribute name='default'>
446
      <ref name="virOnOff"/>
447 448 449
    </attribute>
  </define>

J
Jiri Denemark 已提交
450 451 452 453 454
  <define name='featureName'>
    <data type='string'>
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
M
Michal Privoznik 已提交
455 456 457 458 459 460 461 462 463 464 465 466 467 468

  <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>
469
</grammar>