capability.rng 8.5 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
      </attribute>

179 180 181 182
      <optional>
        <ref name='memory'/>
      </optional>

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

196 197 198 199 200 201
  <define name='memory'>
    <element name='memory'>
      <ref name='scaledInteger'/>
    </element>
  </define>

202 203 204
  <define name='cpu'>
    <element name='cpu'>
      <attribute name='id'>
205
        <ref name='unsignedInt'/>
206
      </attribute>
207 208 209 210 211 212 213 214 215 216 217
      <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>
218 219 220 221 222 223 224 225
    </element>
  </define>

  <define name='guestcaps'>
    <element name='guest'>
      <ref name='ostype'/>
      <ref name='arch'/>
      <optional>
226
        <ref name='features'/>
227 228 229 230 231 232 233
      </optional>
    </element>
  </define>

  <define name='ostype'>
    <element name='os_type'>
      <choice>
234 235 236 237 238
        <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 -->
239 240 241 242 243 244 245
      </choice>
    </element>
  </define>

  <define name='arch'>
    <element name='arch'>
      <attribute name='name'>
246
        <ref name='archnames'/>
247 248 249
      </attribute>
      <ref name='wordsize'/>
      <optional>
250
        <ref name='emulator'/>
251 252
      </optional>
      <optional>
253
        <ref name='loader'/>
254 255
      </optional>
      <zeroOrMore>
256
        <ref name='machine'/>
257 258
      </zeroOrMore>
      <oneOrMore>
259
        <ref name='domain'/>
260 261 262 263 264 265
      </oneOrMore>
    </element>
  </define>

  <define name='emulator'>
    <element name='emulator'>
266
      <ref name='absFilePath'/>
267 268 269 270 271
    </element>
  </define>

  <define name='loader'>
    <element name='loader'>
272
      <ref name='absFilePath'/>
273 274 275 276 277 278
    </element>
  </define>

  <define name='wordsize'>
    <element name='wordsize'>
      <choice>
279 280 281
        <value>31</value>
        <value>32</value>
        <value>64</value>
282 283 284 285 286 287
      </choice>
    </element>
  </define>

  <define name='machine'>
    <element name='machine'>
288 289 290 291 292
      <optional>
        <attribute name='canonical'>
          <text/>
        </attribute>
      </optional>
293 294 295 296 297 298 299
      <text/>
    </element>
  </define>

  <define name='domain'>
    <element name='domain'>
      <attribute name='type'>
300 301 302 303 304 305 306 307 308 309
        <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>
310 311 312
      </attribute>

      <optional>
313
        <ref name='emulator'/>
314
      </optional>
315
      <zeroOrMore>
316
        <ref name='machine'/>
317
      </zeroOrMore>
318 319 320 321 322
    </element>
  </define>

  <define name='features'>
    <element name='features'>
323 324 325 326 327 328 329 330 331 332 333 334 335 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
      <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>
362 363 364 365 366 367
    </element>
  </define>

  <define name='featuretoggle'>
    <attribute name='toggle'>
      <choice>
368 369
        <value>yes</value>
        <value>no</value>
370 371 372 373
      </choice>
    </attribute>
    <attribute name='default'>
      <choice>
374 375
        <value>on</value>
        <value>off</value>
376 377 378 379
      </choice>
    </attribute>
  </define>

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