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


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

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

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

  <define name='secmodel'>
    <element name='secmodel'>
      <element name='model'>
        <text/>
      </element>
      <element name='doi'>
        <text/>
      </element>
60 61 62
    </element>
  </define>

63

64 65 66
  <define name='cpufeatures'>
    <element name='features'>
      <optional>
67
        <element name='pae'><empty/></element>
68 69
      </optional>
      <optional>
70
        <element name='nonpae'><empty/></element>
71 72
      </optional>
      <optional>
73
        <element name='vmx'><empty/></element>
74 75
      </optional>
      <optional>
76
        <element name='svm'><empty/></element>
77 78 79 80
      </optional>
    </element>
  </define>

J
Jiri Denemark 已提交
81 82 83 84
  <define name='cpuspec'>
    <element name='model'>
      <text/>
    </element>
J
Jiri Denemark 已提交
85 86 87 88 89
    <optional>
      <element name='vendor'>
        <text/>
      </element>
    </optional>
J
Jiri Denemark 已提交
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
    <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>
  </define>

111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
  <define name='power_management'>
    <element name='power_management'>
      <interleave>
        <optional>
          <element name='S3'>
            <empty/>
          </element>
        </optional>
        <optional>
          <element name='S4'>
            <empty/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

128 129 130
  <define name='migration'>
    <element name='migration_features'>
      <optional>
131 132 133
        <element name='live'>
          <empty/>
        </element>
134 135
      </optional>
      <optional>
136 137 138 139 140 141 142 143 144 145 146
        <element name='uri_transports'>
          <oneOrMore>
            <element name='uri_transport'>
              <choice>
                <value>esx</value>
                <value>tcp</value>
                <value>xenmigr</value>
              </choice>
            </element>
          </oneOrMore>
        </element>
147 148 149 150 151 152 153
      </optional>
    </element>
  </define>

  <define name='topology'>
    <element name='topology'>
      <element name='cells'>
154 155 156 157 158 159
        <attribute name='num'>
          <ref name='uint'/>
        </attribute>
        <oneOrMore>
          <ref name='cell'/>
        </oneOrMore>
160 161 162 163 164 165 166
      </element>
    </element>
  </define>

  <define name='cell'>
    <element name='cell'>
      <attribute name='id'>
167
        <ref name='uint'/>
168 169 170
      </attribute>

      <optional>
171 172 173 174 175 176 177 178
        <element name='cpus'>
          <attribute name='num'>
            <ref name='uint'/>
          </attribute>
          <oneOrMore>
            <ref name='cpu'/>
          </oneOrMore>
        </element>
179 180 181 182 183 184 185
      </optional>
    </element>
  </define>

  <define name='cpu'>
    <element name='cpu'>
      <attribute name='id'>
186
        <ref name='uint'/>
187 188 189 190 191 192 193 194 195
      </attribute>
    </element>
  </define>

  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
196
        <ref name='features'/>
197 198 199 200 201 202 203
      </optional>
    </element>
  </define>

  <define name='ostype'>
    <element name='os_type'>
      <choice>
204 205 206 207 208
        <value>xen</value> <!-- Xen 3.0 pv -->
        <value>linux</value> <!-- same as 'xen' - legacy -->
        <value>hvm</value> <!-- unmodified OS -->
        <value>exe</value> <!-- For container based virt -->
        <value>uml</value> <!-- user mode linux -->
209 210 211 212 213 214 215
      </choice>
    </element>
  </define>

  <define name='arch'>
    <element name='arch'>
      <attribute name='name'>
216
        <ref name='archnames'/>
217 218 219
      </attribute>
      <ref name='wordsize'/>
      <optional>
220
        <ref name='emulator'/>
221 222
      </optional>
      <optional>
223
        <ref name='loader'/>
224 225
      </optional>
      <zeroOrMore>
226
        <ref name='machine'/>
227 228
      </zeroOrMore>
      <oneOrMore>
229
        <ref name='domain'/>
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
      </oneOrMore>
    </element>
  </define>

  <define name='emulator'>
    <element name='emulator'>
      <ref name='path'/>
    </element>
  </define>

  <define name='loader'>
    <element name='loader'>
      <ref name='path'/>
    </element>
  </define>

  <define name='wordsize'>
    <element name='wordsize'>
      <choice>
249 250 251
        <value>31</value>
        <value>32</value>
        <value>64</value>
252 253 254 255 256 257
      </choice>
    </element>
  </define>

  <define name='machine'>
    <element name='machine'>
258 259 260 261 262
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
263 264 265 266 267 268 269
      <text/>
    </element>
  </define>

  <define name='domain'>
    <element name='domain'>
      <attribute name='type'>
270 271 272 273 274 275 276 277 278 279
        <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>
280 281 282
      </attribute>

      <optional>
283
        <ref name='emulator'/>
284
      </optional>
285
      <zeroOrMore>
286
        <ref name='machine'/>
287
      </zeroOrMore>
288 289 290 291 292 293
    </element>
  </define>

  <define name='features'>
    <element name='features'>
      <optional>
294 295 296
        <element name='pae'>
          <empty/>
        </element>
297 298
      </optional>
      <optional>
299 300 301
        <element name='nonpae'>
          <empty/>
        </element>
302 303
      </optional>
      <optional>
304 305 306
        <element name='ia64_be'>
          <empty/>
        </element>
307 308
      </optional>
      <optional>
309 310 311 312
        <element name='acpi'>
          <ref name='featuretoggle'/>
          <empty/>
        </element>
313 314
      </optional>
      <optional>
315 316 317 318
        <element name='apic'>
          <ref name='featuretoggle'/>
          <empty/>
        </element>
319
      </optional>
J
Jiri Denemark 已提交
320 321 322 323 324
      <optional>
        <element name='cpuselection'>
          <empty/>
        </element>
      </optional>
P
Philipp Hahn 已提交
325 326 327 328 329
      <optional>
        <element name='deviceboot'>
          <empty/>
        </element>
      </optional>
330 331 332 333 334 335
    </element>
  </define>

  <define name='featuretoggle'>
    <attribute name='toggle'>
      <choice>
336 337
        <value>yes</value>
        <value>no</value>
338 339 340 341
      </choice>
    </attribute>
    <attribute name='default'>
      <choice>
342 343
        <value>on</value>
        <value>off</value>
344 345 346 347 348 349
      </choice>
    </attribute>
  </define>

  <define name='archnames'>
    <choice>
350
      <value>arm</value>
351 352
      <value>i686</value>
      <value>ia64</value>
353 354
      <value>microblaze</value>
      <value>microblazeel</value>
355 356
      <value>mips</value>
      <value>mipsel</value>
357 358 359
      <value>ppc64</value>
      <value>ppc</value>
      <value>s390</value>
360
      <value>sparc</value>
361
      <value>x86_64</value>
362 363 364 365
    </choice>
  </define>


J
Jiri Denemark 已提交
366 367 368 369 370 371
  <define name='positiveInteger'>
    <data type='positiveInteger'>
      <param name="pattern">[0-9]+</param>
    </data>
  </define>

372
  <define name='uint'>
J
Jiri Denemark 已提交
373
    <data type='unsignedInt'>
374 375 376 377 378 379 380 381 382 383
      <param name="pattern">[0-9]+</param>
    </data>
  </define>

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

J
Jiri Denemark 已提交
384 385 386 387 388
  <define name='featureName'>
    <data type='string'>
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
389 390 391 392 393 394 395 396 397 398 399

  <define name="UUID">
    <choice>
      <data type="string">
        <param name="pattern">[a-fA-F0-9]{32}</param>
      </data>
      <data type="string">
        <param name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param>
      </data>
    </choice>
  </define>
400
</grammar>