capability.rng 9.0 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
      <optional>
192 193
        <element name='cpus'>
          <attribute name='num'>
194
            <ref name='unsignedInt'/>
195 196 197 198 199
          </attribute>
          <oneOrMore>
            <ref name='cpu'/>
          </oneOrMore>
        </element>
200 201 202 203
      </optional>
    </element>
  </define>

204 205 206 207 208 209
  <define name='memory'>
    <element name='memory'>
      <ref name='scaledInteger'/>
    </element>
  </define>

210 211 212
  <define name='cpu'>
    <element name='cpu'>
      <attribute name='id'>
213
        <ref name='unsignedInt'/>
214
      </attribute>
215 216 217 218 219 220 221 222 223 224 225
      <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>
226 227 228 229 230 231 232 233
    </element>
  </define>

  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
234
        <ref name='features'/>
235 236 237 238 239 240 241
      </optional>
    </element>
  </define>

  <define name='ostype'>
    <element name='os_type'>
      <choice>
242 243 244 245 246
        <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 -->
247 248 249 250 251 252 253
      </choice>
    </element>
  </define>

  <define name='arch'>
    <element name='arch'>
      <attribute name='name'>
254
        <ref name='archnames'/>
255 256 257
      </attribute>
      <ref name='wordsize'/>
      <optional>
258
        <ref name='emulator'/>
259 260
      </optional>
      <optional>
261
        <ref name='loader'/>
262 263
      </optional>
      <zeroOrMore>
264
        <ref name='machine'/>
265 266
      </zeroOrMore>
      <oneOrMore>
267
        <ref name='domain'/>
268 269 270 271 272 273
      </oneOrMore>
    </element>
  </define>

  <define name='emulator'>
    <element name='emulator'>
274
      <ref name='absFilePath'/>
275 276 277 278 279
    </element>
  </define>

  <define name='loader'>
    <element name='loader'>
280
      <ref name='absFilePath'/>
281 282 283 284 285 286
    </element>
  </define>

  <define name='wordsize'>
    <element name='wordsize'>
      <choice>
287 288 289
        <value>31</value>
        <value>32</value>
        <value>64</value>
290 291 292 293 294 295
      </choice>
    </element>
  </define>

  <define name='machine'>
    <element name='machine'>
296 297 298 299 300
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
301 302 303 304 305
      <optional>
        <attribute name='maxCpus'>
          <ref name='unsignedInt'/>
        </attribute>
      </optional>
306 307 308 309 310 311 312
      <text/>
    </element>
  </define>

  <define name='domain'>
    <element name='domain'>
      <attribute name='type'>
313 314 315 316 317 318 319 320 321 322
        <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>
323 324 325
      </attribute>

      <optional>
326
        <ref name='emulator'/>
327
      </optional>
328
      <zeroOrMore>
329
        <ref name='machine'/>
330
      </zeroOrMore>
331 332 333 334 335
    </element>
  </define>

  <define name='features'>
    <element name='features'>
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
      <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>
374 375 376 377 378 379
        <optional>
          <element name='disksnapshot'>
            <ref name='featuretoggle'/>
            <empty/>
          </element>
        </optional>
380
      </interleave>
381 382 383 384 385 386
    </element>
  </define>

  <define name='featuretoggle'>
    <attribute name='toggle'>
      <choice>
387 388
        <value>yes</value>
        <value>no</value>
389 390 391 392
      </choice>
    </attribute>
    <attribute name='default'>
      <choice>
393 394
        <value>on</value>
        <value>off</value>
395 396 397 398
      </choice>
    </attribute>
  </define>

J
Jiri Denemark 已提交
399 400 401 402 403
  <define name='featureName'>
    <data type='string'>
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
404
</grammar>