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


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

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

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

  <define name='secmodel'>
    <element name='secmodel'>
55 56 57 58 59 60 61 62
      <interleave>
          <element name='model'>
            <text/>
          </element>
          <element name='doi'>
            <text/>
          </element>
       </interleave>
63 64 65
    </element>
  </define>

66

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

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

114 115 116 117
  <define name='power_management'>
    <element name='power_management'>
      <interleave>
        <optional>
118
          <element name='suspend_mem'>
119 120 121 122
            <empty/>
          </element>
        </optional>
        <optional>
123
          <element name='suspend_disk'>
124 125 126
            <empty/>
          </element>
        </optional>
127
        <optional>
128
          <element name='suspend_hybrid'>
129 130 131
            <empty/>
          </element>
        </optional>
132 133 134 135
      </interleave>
    </element>
  </define>

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

  <define name='topology'>
    <element name='topology'>
      <element name='cells'>
162
        <attribute name='num'>
163
          <ref name='unsignedInt'/>
164 165 166 167
        </attribute>
        <oneOrMore>
          <ref name='cell'/>
        </oneOrMore>
168 169 170 171 172 173 174
      </element>
    </element>
  </define>

  <define name='cell'>
    <element name='cell'>
      <attribute name='id'>
175
        <ref name='unsignedInt'/>
176 177 178
      </attribute>

      <optional>
179 180
        <element name='cpus'>
          <attribute name='num'>
181
            <ref name='unsignedInt'/>
182 183 184 185 186
          </attribute>
          <oneOrMore>
            <ref name='cpu'/>
          </oneOrMore>
        </element>
187 188 189 190 191 192 193
      </optional>
    </element>
  </define>

  <define name='cpu'>
    <element name='cpu'>
      <attribute name='id'>
194
        <ref name='unsignedInt'/>
195 196 197 198 199 200 201 202 203
      </attribute>
    </element>
  </define>

  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
204
        <ref name='features'/>
205 206 207 208 209 210 211
      </optional>
    </element>
  </define>

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

  <define name='arch'>
    <element name='arch'>
      <attribute name='name'>
224
        <ref name='archnames'/>
225 226 227
      </attribute>
      <ref name='wordsize'/>
      <optional>
228
        <ref name='emulator'/>
229 230
      </optional>
      <optional>
231
        <ref name='loader'/>
232 233
      </optional>
      <zeroOrMore>
234
        <ref name='machine'/>
235 236
      </zeroOrMore>
      <oneOrMore>
237
        <ref name='domain'/>
238 239 240 241 242 243
      </oneOrMore>
    </element>
  </define>

  <define name='emulator'>
    <element name='emulator'>
244
      <ref name='absFilePath'/>
245 246 247 248 249
    </element>
  </define>

  <define name='loader'>
    <element name='loader'>
250
      <ref name='absFilePath'/>
251 252 253 254 255 256
    </element>
  </define>

  <define name='wordsize'>
    <element name='wordsize'>
      <choice>
257 258 259
        <value>31</value>
        <value>32</value>
        <value>64</value>
260 261 262 263 264 265
      </choice>
    </element>
  </define>

  <define name='machine'>
    <element name='machine'>
266 267 268 269 270
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
271 272 273 274 275 276 277
      <text/>
    </element>
  </define>

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

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

  <define name='features'>
    <element name='features'>
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
      <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>
      </interleave>
340 341 342 343 344 345
    </element>
  </define>

  <define name='featuretoggle'>
    <attribute name='toggle'>
      <choice>
346 347
        <value>yes</value>
        <value>no</value>
348 349 350 351
      </choice>
    </attribute>
    <attribute name='default'>
      <choice>
352 353
        <value>on</value>
        <value>off</value>
354 355 356 357 358 359
      </choice>
    </attribute>
  </define>

  <define name='archnames'>
    <choice>
360
      <value>arm</value>
361 362
      <value>i686</value>
      <value>ia64</value>
363 364
      <value>microblaze</value>
      <value>microblazeel</value>
365 366
      <value>mips</value>
      <value>mipsel</value>
367 368 369
      <value>ppc64</value>
      <value>ppc</value>
      <value>s390</value>
370
      <value>sparc</value>
371
      <value>x86_64</value>
372 373 374
    </choice>
  </define>

J
Jiri Denemark 已提交
375 376 377 378 379
  <define name='featureName'>
    <data type='string'>
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
380
</grammar>