capability.rng 8.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 63
      <interleave>
          <element name='model'>
            <text/>
          </element>
          <element name='doi'>
            <text/>
          </element>
       </interleave>
64 65 66
    </element>
  </define>

67

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  <define name='features'>
    <element name='features'>
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 340
      <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>
341 342 343 344 345 346
    </element>
  </define>

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

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

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