capability.rng 8.2 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 37
      </element>
      <optional>
38
        <ref name='migration'/>
39 40
      </optional>
      <optional>
41
        <ref name='topology'/>
42
      </optional>
43
      <optional>
44
        <ref name='secmodel'/>
45 46 47 48 49 50 51 52 53 54 55 56
      </optional>
    </element>
  </define>

  <define name='secmodel'>
    <element name='secmodel'>
      <element name='model'>
        <text/>
      </element>
      <element name='doi'>
        <text/>
      </element>
57 58 59
    </element>
  </define>

60

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

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

108 109 110
  <define name='migration'>
    <element name='migration_features'>
      <optional>
111 112 113
        <element name='live'>
          <empty/>
        </element>
114 115
      </optional>
      <optional>
116 117 118 119 120 121 122 123 124 125 126
        <element name='uri_transports'>
          <oneOrMore>
            <element name='uri_transport'>
              <choice>
                <value>esx</value>
                <value>tcp</value>
                <value>xenmigr</value>
              </choice>
            </element>
          </oneOrMore>
        </element>
127 128 129 130 131 132 133
      </optional>
    </element>
  </define>

  <define name='topology'>
    <element name='topology'>
      <element name='cells'>
134 135 136 137 138 139
        <attribute name='num'>
          <ref name='uint'/>
        </attribute>
        <oneOrMore>
          <ref name='cell'/>
        </oneOrMore>
140 141 142 143 144 145 146
      </element>
    </element>
  </define>

  <define name='cell'>
    <element name='cell'>
      <attribute name='id'>
147
        <ref name='uint'/>
148 149 150
      </attribute>

      <optional>
151 152 153 154 155 156 157 158
        <element name='cpus'>
          <attribute name='num'>
            <ref name='uint'/>
          </attribute>
          <oneOrMore>
            <ref name='cpu'/>
          </oneOrMore>
        </element>
159 160 161 162 163 164 165
      </optional>
    </element>
  </define>

  <define name='cpu'>
    <element name='cpu'>
      <attribute name='id'>
166
        <ref name='uint'/>
167 168 169 170 171 172 173 174 175
      </attribute>
    </element>
  </define>

  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
176
        <ref name='features'/>
177 178 179 180 181 182 183
      </optional>
    </element>
  </define>

  <define name='ostype'>
    <element name='os_type'>
      <choice>
184 185 186 187 188
        <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 -->
189 190 191 192 193 194 195
      </choice>
    </element>
  </define>

  <define name='arch'>
    <element name='arch'>
      <attribute name='name'>
196
        <ref name='archnames'/>
197 198 199
      </attribute>
      <ref name='wordsize'/>
      <optional>
200
        <ref name='emulator'/>
201 202
      </optional>
      <optional>
203
        <ref name='loader'/>
204 205
      </optional>
      <zeroOrMore>
206
        <ref name='machine'/>
207 208
      </zeroOrMore>
      <oneOrMore>
209
        <ref name='domain'/>
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
      </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>
229 230 231
        <value>31</value>
        <value>32</value>
        <value>64</value>
232 233 234 235 236 237
      </choice>
    </element>
  </define>

  <define name='machine'>
    <element name='machine'>
238 239 240 241 242
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
243 244 245 246 247 248 249
      <text/>
    </element>
  </define>

  <define name='domain'>
    <element name='domain'>
      <attribute name='type'>
250 251 252 253 254 255 256 257 258 259
        <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>
260 261 262
      </attribute>

      <optional>
263
        <ref name='emulator'/>
264
      </optional>
265
      <zeroOrMore>
266
        <ref name='machine'/>
267
      </zeroOrMore>
268 269 270 271 272 273
    </element>
  </define>

  <define name='features'>
    <element name='features'>
      <optional>
274 275 276
        <element name='pae'>
          <empty/>
        </element>
277 278
      </optional>
      <optional>
279 280 281
        <element name='nonpae'>
          <empty/>
        </element>
282 283
      </optional>
      <optional>
284 285 286
        <element name='ia64_be'>
          <empty/>
        </element>
287 288
      </optional>
      <optional>
289 290 291 292
        <element name='acpi'>
          <ref name='featuretoggle'/>
          <empty/>
        </element>
293 294
      </optional>
      <optional>
295 296 297 298
        <element name='apic'>
          <ref name='featuretoggle'/>
          <empty/>
        </element>
299
      </optional>
J
Jiri Denemark 已提交
300 301 302 303 304
      <optional>
        <element name='cpuselection'>
          <empty/>
        </element>
      </optional>
P
Philipp Hahn 已提交
305 306 307 308 309
      <optional>
        <element name='deviceboot'>
          <empty/>
        </element>
      </optional>
310 311 312 313 314 315
    </element>
  </define>

  <define name='featuretoggle'>
    <attribute name='toggle'>
      <choice>
316 317
        <value>yes</value>
        <value>no</value>
318 319 320 321
      </choice>
    </attribute>
    <attribute name='default'>
      <choice>
322 323
        <value>on</value>
        <value>off</value>
324 325 326 327 328 329
      </choice>
    </attribute>
  </define>

  <define name='archnames'>
    <choice>
330
      <value>arm</value>
331 332
      <value>i686</value>
      <value>ia64</value>
333 334
      <value>microblaze</value>
      <value>microblazeel</value>
335 336
      <value>mips</value>
      <value>mipsel</value>
337 338 339
      <value>ppc64</value>
      <value>ppc</value>
      <value>s390</value>
340
      <value>sparc</value>
341
      <value>x86_64</value>
342 343 344 345
    </choice>
  </define>


J
Jiri Denemark 已提交
346 347 348 349 350 351
  <define name='positiveInteger'>
    <data type='positiveInteger'>
      <param name="pattern">[0-9]+</param>
    </data>
  </define>

352
  <define name='uint'>
J
Jiri Denemark 已提交
353
    <data type='unsignedInt'>
354 355 356 357 358 359 360 361 362 363
      <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 已提交
364 365 366 367 368
  <define name='featureName'>
    <data type='string'>
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
369 370 371 372 373 374 375 376 377 378 379

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