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


  <define name='pool'>
    <element name='pool'>
      <choice>
14 15 16 17 18 19 20 21
        <ref name='pooldir'/>
        <ref name='poolfs'/>
        <ref name='poolnetfs'/>
        <ref name='poollogical'/>
        <ref name='pooldisk'/>
        <ref name='pooliscsi'/>
        <ref name='poolscsi'/>
        <ref name='poolmpath'/>
22
        <ref name='poolrbd'/>
23
        <ref name='poolsheepdog'/>
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
      </choice>
    </element>
  </define>

  <define name='pooldir'>
    <attribute name='type'>
      <value>dir</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <ref name='sourcedir'/>
    <ref name='target'/>
  </define>

  <define name='poolfs'>
    <attribute name='type'>
      <value>fs</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <ref name='sourcefs'/>
    <ref name='target'/>
  </define>

  <define name='poolnetfs'>
    <attribute name='type'>
      <value>netfs</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <ref name='sourcenetfs'/>
    <ref name='target'/>
  </define>

  <define name='poollogical'>
    <attribute name='type'>
      <value>logical</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <ref name='sourcelogical'/>
    <ref name='target'/>
  </define>

  <define name='pooldisk'>
    <attribute name='type'>
      <value>disk</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <ref name='sourcedisk'/>
    <ref name='target'/>
  </define>

  <define name='pooliscsi'>
    <attribute name='type'>
      <value>iscsi</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <ref name='sourceiscsi'/>
    <ref name='target'/>
  </define>

  <define name='poolscsi'>
    <attribute name='type'>
      <value>scsi</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <ref name='sourcescsi'/>
    <ref name='target'/>
  </define>

98 99 100 101 102 103 104 105 106 107 108 109
  <define name='poolmpath'>
    <attribute name='type'>
      <value>mpath</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <optional>
      <ref name='sourcempath'/>
    </optional>
    <ref name='target'/>
  </define>

110 111 112 113 114 115 116 117 118
  <define name='poolrbd'>
    <attribute name='type'>
      <value>rbd</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <ref name='sourcerbd'/>
  </define>

119 120 121 122 123 124 125 126 127
  <define name='poolsheepdog'>
    <attribute name='type'>
      <value>sheepdog</value>
    </attribute>
    <ref name='commonmetadata'/>
    <ref name='sizing'/>
    <ref name='sourcesheepdog'/>
  </define>

128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
  <define name='sourceinfovendor'>
    <optional>
      <element name='vendor'>
        <attribute name='name'>
          <text/>
        </attribute>
      </element>
    </optional>
    <optional>
      <element name='product'>
        <attribute name='name'>
          <text/>
        </attribute>
      </element>
    </optional>
  </define>

145 146
  <define name='commonmetadata'>
    <element name='name'>
147
      <ref name='genericName'/>
148 149 150
    </element>
    <optional>
      <element name='uuid'>
E
Eric Blake 已提交
151
        <ref name='UUID'/>
152 153 154 155 156 157 158
      </element>
    </optional>
  </define>

  <define name='sizing'>
    <optional>
      <element name='capacity'>
E
Eric Blake 已提交
159
        <ref name='scaledInteger'/>
160 161 162 163
      </element>
    </optional>
    <optional>
      <element name='allocation'>
E
Eric Blake 已提交
164
        <ref name='scaledInteger'/>
165 166 167 168
      </element>
    </optional>
    <optional>
      <element name='available'>
E
Eric Blake 已提交
169
        <ref name='scaledInteger'/>
170 171 172 173 174 175 176
      </element>
    </optional>
  </define>

  <define name='permissions'>
    <optional>
      <element name='permissions'>
177
        <element name='mode'>
P
Philipp Hahn 已提交
178
          <ref name='octalMode'/>
179 180
        </element>
        <element name='owner'>
181 182 183 184
          <choice>
            <ref name='unsignedInt'/>
            <value>-1</value>
          </choice>
185 186
        </element>
        <element name='group'>
187 188 189 190
          <choice>
            <ref name='unsignedInt'/>
            <value>-1</value>
          </choice>
191 192 193 194 195 196
        </element>
        <optional>
          <element name='label'>
            <text/>
        </element>
        </optional>
197 198 199 200 201 202 203
      </element>
    </optional>
  </define>

  <define name='target'>
    <element name='target'>
      <optional>
204
        <element name='path'>
E
Eric Blake 已提交
205
          <ref name='absFilePath'/>
206
        </element>
207 208 209 210 211 212
      </optional>
      <ref name='permissions'/>
    </element>
  </define>

  <define name='sourceinfohost'>
213 214 215 216
    <oneOrMore>
      <element name='host'>
        <attribute name='name'>
          <text/>
217
        </attribute>
218 219 220 221 222 223 224 225
        <optional>
          <attribute name='port'>
            <ref name="PortNumber"/>
          </attribute>
        </optional>
        <empty/>
      </element>
    </oneOrMore>
226 227 228 229 230
  </define>

  <define name='sourceinfodev'>
    <element name='device'>
      <attribute name='path'>
231
        <choice>
E
Eric Blake 已提交
232
          <ref name='absFilePath'/>
233
          <ref name='genericName'/>
234
        </choice>
235 236
      </attribute>
      <choice>
237 238
        <empty/>
        <ref name='devextents'/>
239 240 241 242
      </choice>
    </element>
  </define>

D
David Allan 已提交
243 244 245 246 247 248 249 250
  <define name='initiatorinfo'>
    <element name='initiator'>
      <element name='iqn'>
        <attribute name='name'>
          <text/>
        </attribute>
        <empty/>
      </element>
D
David Allan 已提交
251 252 253
    </element>
  </define>

254 255 256
  <define name='devextents'>
    <oneOrMore>
      <element name='freeExtent'>
257
        <attribute name='start'>
E
Eric Blake 已提交
258
          <ref name='unsignedLong'/>
259 260
        </attribute>
        <attribute name='end'>
E
Eric Blake 已提交
261
          <ref name='unsignedLong'/>
262
        </attribute>
263 264 265 266 267 268 269
      </element>
    </oneOrMore>
  </define>

  <define name='sourceinfodir'>
    <element name='dir'>
      <attribute name='path'>
E
Eric Blake 已提交
270
        <ref name='absFilePath'/>
271 272 273 274 275 276 277 278
      </attribute>
      <empty/>
    </element>
  </define>

  <define name='sourceinfoadapter'>
    <element name='adapter'>
      <attribute name='name'>
279
        <text/>
280 281 282 283 284 285 286 287 288 289 290
      </attribute>
      <empty/>
    </element>
  </define>

  <define name='sourceinfoname'>
    <element name='name'>
      <text/>
    </element>
  </define>

291 292 293 294 295
  <define name='sourceinfoauth'>
    <element name='auth'>
      <attribute name='type'>
        <choice>
          <value>chap</value>
296
          <value>ceph</value>
297 298
        </choice>
      </attribute>
299 300 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
      <choice>
        <attribute name='login'>
          <text/>
        </attribute>
        <attribute name='username'>
          <text/>
        </attribute>
      </choice>
      <optional>
        <attribute name='passwd'>
          <text/>
        </attribute>
      </optional>
      <optional>
        <ref name='sourceinfoauthsecret'/>
      </optional>
    </element>
  </define>

  <define name='sourceinfoauthsecret'>
    <element name='secret'>
      <choice>
        <attribute name='uuid'>
          <text/>
        </attribute>
        <attribute name='usage'>
          <text/>
        </attribute>
      </choice>
328 329 330
    </element>
  </define>

331 332 333
  <define name='sourcefmtfs'>
    <optional>
      <element name='format'>
334 335 336 337 338
        <attribute name='type'>
          <choice>
            <value>auto</value>
            <value>ext2</value>
            <value>ext3</value>
339
            <value>ext4</value>
340 341 342
            <value>ufs</value>
            <value>iso9660</value>
            <value>udf</value>
343
            <value>gfs</value>
344 345 346 347 348 349 350
            <value>gfs2</value>
            <value>vfat</value>
            <value>hfs+</value>
            <value>xfs</value>
            <value>ocfs2</value>
          </choice>
        </attribute>
351 352 353 354 355 356 357 358
      </element>
    </optional>
  </define>


  <define name='sourcefmtnetfs'>
    <optional>
      <element name='format'>
359 360 361 362 363 364
        <attribute name='type'>
          <choice>
            <value>auto</value>
            <value>nfs</value>
          </choice>
        </attribute>
365 366 367
        <optional>
          <ref name='sourceinfovendor'/>
        </optional>
368 369 370 371 372 373 374 375
      </element>
    </optional>
  </define>


  <define name='sourcefmtdisk'>
    <optional>
      <element name='format'>
376 377 378 379 380 381 382 383 384 385 386 387 388
        <attribute name='type'>
          <choice>
            <value>none</value>
            <value>dos</value>
            <value>dvh</value>
            <value>gpt</value>
            <value>mac</value>
            <value>bsd</value>
            <value>pc98</value>
            <value>sun</value>
            <value>lvm2</value>
          </choice>
        </attribute>
389 390 391
        <optional>
          <ref name='sourceinfovendor'/>
        </optional>
392 393 394 395 396 397 398 399
      </element>
    </optional>
  </define>


  <define name='sourcefmtlogical'>
    <optional>
      <element name='format'>
400 401 402 403 404 405
        <attribute name='type'>
          <choice>
            <value>auto</value>
            <value>lvm2</value>
          </choice>
        </attribute>
406 407 408
        <optional>
          <ref name='sourceinfovendor'/>
        </optional>
409 410 411 412 413 414 415 416
      </element>
    </optional>
  </define>


  <define name='sourcedir'>
    <optional>
      <element name='source'>
417
        <empty/>
418 419 420
        <optional>
          <ref name='sourceinfovendor'/>
        </optional>
421 422 423
      </element>
    </optional>
  </define>
424

425 426 427 428
  <define name='sourcefs'>
    <element name='source'>
      <ref name='sourceinfodev'/>
      <ref name='sourcefmtfs'/>
429 430 431
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
432 433 434 435 436 437 438 439
    </element>
  </define>

  <define name='sourcenetfs'>
    <element name='source'>
      <ref name='sourceinfohost'/>
      <ref name='sourceinfodir'/>
      <ref name='sourcefmtnetfs'/>
440 441 442
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
443 444 445 446 447
    </element>
  </define>

  <define name='sourcelogical'>
    <element name='source'>
448 449 450 451 452 453 454 455
      <oneOrMore>
        <optional>
          <ref name='sourceinfoname'/>
        </optional>
        <optional>
          <ref name='sourceinfodev'/>
        </optional>
      </oneOrMore>
456
      <ref name='sourcefmtlogical'/>
457 458 459
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
460 461 462 463 464 465 466
    </element>
  </define>

  <define name='sourcedisk'>
    <element name='source'>
      <ref name='sourceinfodev'/>
      <ref name='sourcefmtdisk'/>
467 468 469
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
470 471 472 473 474 475 476
    </element>
  </define>

  <define name='sourceiscsi'>
    <element name='source'>
      <ref name='sourceinfohost'/>
      <ref name='sourceinfodev'/>
D
David Allan 已提交
477
      <optional>
D
David Allan 已提交
478
        <ref name='initiatorinfo'/>
D
David Allan 已提交
479
      </optional>
480 481 482
      <optional>
        <ref name='sourceinfoauth'/>
      </optional>
483 484 485
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
486 487 488 489 490
    </element>
  </define>

  <define name='sourcescsi'>
    <element name='source'>
491
      <ref name='sourceinfoadapter'/>
492 493 494 495
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>

496 497 498
    </element>
  </define>

499 500 501 502 503
  <define name='sourcempath'>
    <element name='source'>
      <empty/>
    </element>
  </define>
504

505 506 507 508 509 510 511 512 513 514
  <define name='sourcerbd'>
    <element name='source'>
      <ref name='sourceinfoname'/>
      <ref name='sourceinfohost'/>
      <optional>
        <ref name='sourceinfoauth'/>
      </optional>
    </element>
  </define>

515 516 517 518 519 520 521
  <define name='sourcesheepdog'>
    <element name='source'>
      <ref name='sourceinfohost'/>
      <ref name='sourceinfoname'/>
    </element>
  </define>

522 523 524 525 526
  <define name="PortNumber">
    <data type="short">
      <param name="minInclusive">-1</param>
    </data>
  </define>
527 528

</grammar>