capability.rng 8.0 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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
  <define name='cpuspec'>
    <element name='model'>
      <text/>
    </element>
    <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>

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

  <define name='topology'>
    <element name='topology'>
      <element name='cells'>
129 130 131 132 133 134
        <attribute name='num'>
          <ref name='uint'/>
        </attribute>
        <oneOrMore>
          <ref name='cell'/>
        </oneOrMore>
135 136 137 138 139 140 141
      </element>
    </element>
  </define>

  <define name='cell'>
    <element name='cell'>
      <attribute name='id'>
142
        <ref name='uint'/>
143 144 145
      </attribute>

      <optional>
146 147 148 149 150 151 152 153
        <element name='cpus'>
          <attribute name='num'>
            <ref name='uint'/>
          </attribute>
          <oneOrMore>
            <ref name='cpu'/>
          </oneOrMore>
        </element>
154 155 156 157 158 159 160
      </optional>
    </element>
  </define>

  <define name='cpu'>
    <element name='cpu'>
      <attribute name='id'>
161
        <ref name='uint'/>
162 163 164 165 166 167 168 169 170
      </attribute>
    </element>
  </define>

  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
171
        <ref name='features'/>
172 173 174 175 176 177 178
      </optional>
    </element>
  </define>

  <define name='ostype'>
    <element name='os_type'>
      <choice>
179 180 181 182 183
        <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 -->
184 185 186 187 188 189 190
      </choice>
    </element>
  </define>

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

  <define name='machine'>
    <element name='machine'>
233 234 235 236 237
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
238 239 240 241 242 243 244
      <text/>
    </element>
  </define>

  <define name='domain'>
    <element name='domain'>
      <attribute name='type'>
245 246 247 248 249 250 251 252 253 254
        <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>
255 256 257
      </attribute>

      <optional>
258
        <ref name='emulator'/>
259
      </optional>
260
      <zeroOrMore>
261
        <ref name='machine'/>
262
      </zeroOrMore>
263 264 265 266 267 268
    </element>
  </define>

  <define name='features'>
    <element name='features'>
      <optional>
269 270 271
        <element name='pae'>
          <empty/>
        </element>
272 273
      </optional>
      <optional>
274 275 276
        <element name='nonpae'>
          <empty/>
        </element>
277 278
      </optional>
      <optional>
279 280 281
        <element name='ia64_be'>
          <empty/>
        </element>
282 283
      </optional>
      <optional>
284 285 286 287
        <element name='acpi'>
          <ref name='featuretoggle'/>
          <empty/>
        </element>
288 289
      </optional>
      <optional>
290 291 292 293
        <element name='apic'>
          <ref name='featuretoggle'/>
          <empty/>
        </element>
294
      </optional>
J
Jiri Denemark 已提交
295 296 297 298 299
      <optional>
        <element name='cpuselection'>
          <empty/>
        </element>
      </optional>
300 301 302 303 304 305
    </element>
  </define>

  <define name='featuretoggle'>
    <attribute name='toggle'>
      <choice>
306 307
        <value>yes</value>
        <value>no</value>
308 309 310 311
      </choice>
    </attribute>
    <attribute name='default'>
      <choice>
312 313
        <value>on</value>
        <value>off</value>
314 315 316 317 318 319
      </choice>
    </attribute>
  </define>

  <define name='archnames'>
    <choice>
320
      <value>arm</value>
321 322 323 324
      <value>i686</value>
      <value>ia64</value>
      <value>mips</value>
      <value>mipsel</value>
325 326 327
      <value>ppc64</value>
      <value>ppc</value>
      <value>s390</value>
328
      <value>sparc</value>
329
      <value>x86_64</value>
330 331 332 333
    </choice>
  </define>


J
Jiri Denemark 已提交
334 335 336 337 338 339
  <define name='positiveInteger'>
    <data type='positiveInteger'>
      <param name="pattern">[0-9]+</param>
    </data>
  </define>

340
  <define name='uint'>
J
Jiri Denemark 已提交
341
    <data type='unsignedInt'>
342 343 344 345 346 347 348 349 350 351
      <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 已提交
352 353 354 355 356
  <define name='featureName'>
    <data type='string'>
      <param name='pattern'>[a-zA-Z0-9\-_]+</param>
    </data>
  </define>
357 358 359 360 361 362 363 364 365 366 367

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