capability.rng 9.4 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
      <zeroOrMore>
49
        <ref name='secmodel'/>
50
      </zeroOrMore>
51 52 53 54 55
    </element>
  </define>

  <define name='secmodel'>
    <element name='secmodel'>
56 57 58 59 60 61 62
      <interleave>
          <element name='model'>
            <text/>
          </element>
          <element name='doi'>
            <text/>
          </element>
63 64 65 66 67 68 69 70
          <zeroOrMore>
            <element name='baselabel'>
              <attribute name='type'>
                <text/>
              </attribute>
              <text/>
            </element>
          </zeroOrMore>
71
       </interleave>
72 73 74
    </element>
  </define>

75

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

J
Jiri Denemark 已提交
93 94 95 96
  <define name='cpuspec'>
    <element name='model'>
      <text/>
    </element>
J
Jiri Denemark 已提交
97 98 99 100 101
    <optional>
      <element name='vendor'>
        <text/>
      </element>
    </optional>
J
Jiri Denemark 已提交
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
    <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>

123 124 125 126
  <define name='power_management'>
    <element name='power_management'>
      <interleave>
        <optional>
127
          <element name='suspend_mem'>
128 129 130 131
            <empty/>
          </element>
        </optional>
        <optional>
132
          <element name='suspend_disk'>
133 134 135
            <empty/>
          </element>
        </optional>
136
        <optional>
137
          <element name='suspend_hybrid'>
138 139 140
            <empty/>
          </element>
        </optional>
141 142 143 144
      </interleave>
    </element>
  </define>

145 146 147
  <define name='migration'>
    <element name='migration_features'>
      <optional>
148 149 150
        <element name='live'>
          <empty/>
        </element>
151 152
      </optional>
      <optional>
153 154 155 156 157 158 159 160 161 162 163
        <element name='uri_transports'>
          <oneOrMore>
            <element name='uri_transport'>
              <choice>
                <value>esx</value>
                <value>tcp</value>
                <value>xenmigr</value>
              </choice>
            </element>
          </oneOrMore>
        </element>
164 165 166 167 168 169 170
      </optional>
    </element>
  </define>

  <define name='topology'>
    <element name='topology'>
      <element name='cells'>
171
        <attribute name='num'>
172
          <ref name='unsignedInt'/>
173 174 175 176
        </attribute>
        <oneOrMore>
          <ref name='cell'/>
        </oneOrMore>
177 178 179 180 181 182 183
      </element>
    </element>
  </define>

  <define name='cell'>
    <element name='cell'>
      <attribute name='id'>
184
        <ref name='unsignedInt'/>
185 186
      </attribute>

187 188 189 190
      <optional>
        <ref name='memory'/>
      </optional>

191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
      <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>

206
      <optional>
207 208
        <element name='cpus'>
          <attribute name='num'>
209
            <ref name='unsignedInt'/>
210 211 212 213 214
          </attribute>
          <oneOrMore>
            <ref name='cpu'/>
          </oneOrMore>
        </element>
215 216 217 218
      </optional>
    </element>
  </define>

219 220 221 222 223 224
  <define name='memory'>
    <element name='memory'>
      <ref name='scaledInteger'/>
    </element>
  </define>

225 226 227
  <define name='cpu'>
    <element name='cpu'>
      <attribute name='id'>
228
        <ref name='unsignedInt'/>
229
      </attribute>
230 231 232 233 234 235 236 237 238 239 240
      <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>
241 242 243 244 245 246 247 248
    </element>
  </define>

  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
249
        <ref name='features'/>
250 251 252 253 254 255 256
      </optional>
    </element>
  </define>

  <define name='ostype'>
    <element name='os_type'>
      <choice>
257 258 259 260 261
        <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 -->
262 263 264 265 266 267 268
      </choice>
    </element>
  </define>

  <define name='arch'>
    <element name='arch'>
      <attribute name='name'>
269
        <ref name='archnames'/>
270 271 272
      </attribute>
      <ref name='wordsize'/>
      <optional>
273
        <ref name='emulator'/>
274 275
      </optional>
      <optional>
276
        <ref name='loader'/>
277 278
      </optional>
      <zeroOrMore>
279
        <ref name='machine'/>
280 281
      </zeroOrMore>
      <oneOrMore>
282
        <ref name='domain'/>
283 284 285 286 287 288
      </oneOrMore>
    </element>
  </define>

  <define name='emulator'>
    <element name='emulator'>
289
      <ref name='absFilePath'/>
290 291 292 293 294
    </element>
  </define>

  <define name='loader'>
    <element name='loader'>
295
      <ref name='absFilePath'/>
296 297 298 299 300 301
    </element>
  </define>

  <define name='wordsize'>
    <element name='wordsize'>
      <choice>
302 303 304
        <value>31</value>
        <value>32</value>
        <value>64</value>
305 306 307 308 309 310
      </choice>
    </element>
  </define>

  <define name='machine'>
    <element name='machine'>
311 312 313 314 315
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
316 317 318 319 320
      <optional>
        <attribute name='maxCpus'>
          <ref name='unsignedInt'/>
        </attribute>
      </optional>
321 322 323 324 325 326 327
      <text/>
    </element>
  </define>

  <define name='domain'>
    <element name='domain'>
      <attribute name='type'>
328 329 330 331 332 333 334 335 336 337
        <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>
338 339 340
      </attribute>

      <optional>
341
        <ref name='emulator'/>
342
      </optional>
343
      <zeroOrMore>
344
        <ref name='machine'/>
345
      </zeroOrMore>
346 347 348 349 350
    </element>
  </define>

  <define name='features'>
    <element name='features'>
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
      <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>
389 390 391 392 393 394
        <optional>
          <element name='disksnapshot'>
            <ref name='featuretoggle'/>
            <empty/>
          </element>
        </optional>
395
      </interleave>
396 397 398 399 400 401
    </element>
  </define>

  <define name='featuretoggle'>
    <attribute name='toggle'>
      <choice>
402 403
        <value>yes</value>
        <value>no</value>
404 405 406 407
      </choice>
    </attribute>
    <attribute name='default'>
      <choice>
408 409
        <value>on</value>
        <value>off</value>
410 411 412 413
      </choice>
    </attribute>
  </define>

J
Jiri Denemark 已提交
414 415 416 417 418
  <define name='featureName'>
    <data type='string'>
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
419
</grammar>