capability.rng 8.8 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
  <define name='power_management'>
    <element name='power_management'>
      <interleave>
        <optional>
          <element name='S3'>
            <empty/>
          </element>
        </optional>
        <optional>
          <element name='S4'>
            <empty/>
          </element>
        </optional>
124 125 126 127 128
        <optional>
          <element name='Hybrid-Suspend'>
            <empty/>
          </element>
        </optional>
129 130 131 132
      </interleave>
    </element>
  </define>

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

  <define name='topology'>
    <element name='topology'>
      <element name='cells'>
159 160 161 162 163 164
        <attribute name='num'>
          <ref name='uint'/>
        </attribute>
        <oneOrMore>
          <ref name='cell'/>
        </oneOrMore>
165 166 167 168 169 170 171
      </element>
    </element>
  </define>

  <define name='cell'>
    <element name='cell'>
      <attribute name='id'>
172
        <ref name='uint'/>
173 174 175
      </attribute>

      <optional>
176 177 178 179 180 181 182 183
        <element name='cpus'>
          <attribute name='num'>
            <ref name='uint'/>
          </attribute>
          <oneOrMore>
            <ref name='cpu'/>
          </oneOrMore>
        </element>
184 185 186 187 188 189 190
      </optional>
    </element>
  </define>

  <define name='cpu'>
    <element name='cpu'>
      <attribute name='id'>
191
        <ref name='uint'/>
192 193 194 195 196 197 198 199 200
      </attribute>
    </element>
  </define>

  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
201
        <ref name='features'/>
202 203 204 205 206 207 208
      </optional>
    </element>
  </define>

  <define name='ostype'>
    <element name='os_type'>
      <choice>
209 210 211 212 213
        <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 -->
214 215 216 217 218 219 220
      </choice>
    </element>
  </define>

  <define name='arch'>
    <element name='arch'>
      <attribute name='name'>
221
        <ref name='archnames'/>
222 223 224
      </attribute>
      <ref name='wordsize'/>
      <optional>
225
        <ref name='emulator'/>
226 227
      </optional>
      <optional>
228
        <ref name='loader'/>
229 230
      </optional>
      <zeroOrMore>
231
        <ref name='machine'/>
232 233
      </zeroOrMore>
      <oneOrMore>
234
        <ref name='domain'/>
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
      </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>
254 255 256
        <value>31</value>
        <value>32</value>
        <value>64</value>
257 258 259 260 261 262
      </choice>
    </element>
  </define>

  <define name='machine'>
    <element name='machine'>
263 264 265 266 267
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
268 269 270 271 272 273 274
      <text/>
    </element>
  </define>

  <define name='domain'>
    <element name='domain'>
      <attribute name='type'>
275 276 277 278 279 280 281 282 283 284
        <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>
285 286 287
      </attribute>

      <optional>
288
        <ref name='emulator'/>
289
      </optional>
290
      <zeroOrMore>
291
        <ref name='machine'/>
292
      </zeroOrMore>
293 294 295 296 297 298
    </element>
  </define>

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

  <define name='featuretoggle'>
    <attribute name='toggle'>
      <choice>
341 342
        <value>yes</value>
        <value>no</value>
343 344 345 346
      </choice>
    </attribute>
    <attribute name='default'>
      <choice>
347 348
        <value>on</value>
        <value>off</value>
349 350 351 352 353 354
      </choice>
    </attribute>
  </define>

  <define name='archnames'>
    <choice>
355
      <value>arm</value>
356 357
      <value>i686</value>
      <value>ia64</value>
358 359
      <value>microblaze</value>
      <value>microblazeel</value>
360 361
      <value>mips</value>
      <value>mipsel</value>
362 363 364
      <value>ppc64</value>
      <value>ppc</value>
      <value>s390</value>
365
      <value>sparc</value>
366
      <value>x86_64</value>
367 368 369 370
    </choice>
  </define>


J
Jiri Denemark 已提交
371 372 373 374 375 376
  <define name='positiveInteger'>
    <data type='positiveInteger'>
      <param name="pattern">[0-9]+</param>
    </data>
  </define>

377
  <define name='uint'>
J
Jiri Denemark 已提交
378
    <data type='unsignedInt'>
379 380 381 382 383 384 385 386 387 388
      <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 已提交
389 390 391 392 393
  <define name='featureName'>
    <data type='string'>
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
394 395 396 397 398 399 400 401 402 403 404

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