storagepool.rng 10.0 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 23 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
      </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>

96 97 98 99 100 101 102 103 104 105 106 107
  <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>

108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
  <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>

125 126 127 128 129 130
  <define name='commonmetadata'>
    <element name='name'>
      <ref name='name'/>
    </element>
    <optional>
      <element name='uuid'>
E
Eric Blake 已提交
131
        <ref name='UUID'/>
132 133 134 135 136 137 138
      </element>
    </optional>
  </define>

  <define name='sizing'>
    <optional>
      <element name='capacity'>
E
Eric Blake 已提交
139
        <ref name='unsignedLong'/>
140 141 142 143
      </element>
    </optional>
    <optional>
      <element name='allocation'>
E
Eric Blake 已提交
144
        <ref name='unsignedLong'/>
145 146 147 148
      </element>
    </optional>
    <optional>
      <element name='available'>
E
Eric Blake 已提交
149
        <ref name='unsignedLong'/>
150 151 152 153 154 155 156
      </element>
    </optional>
  </define>

  <define name='permissions'>
    <optional>
      <element name='permissions'>
157
        <element name='mode'>
E
Eric Blake 已提交
158
          <ref name='unsignedInt'/>
159 160
        </element>
        <element name='owner'>
E
Eric Blake 已提交
161
          <ref name='unsignedInt'/>
162 163
        </element>
        <element name='group'>
E
Eric Blake 已提交
164
          <ref name='unsignedInt'/>
165 166 167 168 169 170
        </element>
        <optional>
          <element name='label'>
            <text/>
        </element>
        </optional>
171 172 173 174 175 176 177
      </element>
    </optional>
  </define>

  <define name='target'>
    <element name='target'>
      <optional>
178
        <element name='path'>
E
Eric Blake 已提交
179
          <ref name='absFilePath'/>
180
        </element>
181 182 183 184 185 186 187 188
      </optional>
      <ref name='permissions'/>
    </element>
  </define>

  <define name='sourceinfohost'>
    <element name='host'>
      <attribute name='name'>
189
        <text/>
190
      </attribute>
191 192 193 194 195
      <optional>
        <attribute name='port'>
          <ref name="PortNumber"/>
        </attribute>
      </optional>
196 197 198 199 200 201 202
      <empty/>
    </element>
  </define>

  <define name='sourceinfodev'>
    <element name='device'>
      <attribute name='path'>
203
        <choice>
E
Eric Blake 已提交
204
          <ref name='absFilePath'/>
205 206
          <ref name='name'/>
        </choice>
207 208
      </attribute>
      <choice>
209 210
        <empty/>
        <ref name='devextents'/>
211 212 213 214
      </choice>
    </element>
  </define>

D
David Allan 已提交
215 216 217 218 219 220 221 222
  <define name='initiatorinfo'>
    <element name='initiator'>
      <element name='iqn'>
        <attribute name='name'>
          <text/>
        </attribute>
        <empty/>
      </element>
D
David Allan 已提交
223 224 225
    </element>
  </define>

226 227 228
  <define name='devextents'>
    <oneOrMore>
      <element name='freeExtent'>
229
        <attribute name='start'>
E
Eric Blake 已提交
230
          <ref name='unsignedLong'/>
231 232
        </attribute>
        <attribute name='end'>
E
Eric Blake 已提交
233
          <ref name='unsignedLong'/>
234
        </attribute>
235 236 237 238 239 240 241
      </element>
    </oneOrMore>
  </define>

  <define name='sourceinfodir'>
    <element name='dir'>
      <attribute name='path'>
E
Eric Blake 已提交
242
        <ref name='absFilePath'/>
243 244 245 246 247 248 249 250
      </attribute>
      <empty/>
    </element>
  </define>

  <define name='sourceinfoadapter'>
    <element name='adapter'>
      <attribute name='name'>
251
        <text/>
252 253 254 255 256 257 258 259 260 261 262
      </attribute>
      <empty/>
    </element>
  </define>

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

263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
  <define name='sourceinfoauth'>
    <element name='auth'>
      <attribute name='type'>
        <choice>
          <value>chap</value>
        </choice>
      </attribute>
      <attribute name='login'>
        <text/>
      </attribute>
      <attribute name='passwd'>
        <text/>
      </attribute>
    </element>
  </define>

279 280 281
  <define name='sourcefmtfs'>
    <optional>
      <element name='format'>
282 283 284 285 286
        <attribute name='type'>
          <choice>
            <value>auto</value>
            <value>ext2</value>
            <value>ext3</value>
287
            <value>ext4</value>
288 289 290
            <value>ufs</value>
            <value>iso9660</value>
            <value>udf</value>
291
            <value>gfs</value>
292 293 294 295 296 297 298
            <value>gfs2</value>
            <value>vfat</value>
            <value>hfs+</value>
            <value>xfs</value>
            <value>ocfs2</value>
          </choice>
        </attribute>
299 300 301 302 303 304 305 306
      </element>
    </optional>
  </define>


  <define name='sourcefmtnetfs'>
    <optional>
      <element name='format'>
307 308 309 310 311 312
        <attribute name='type'>
          <choice>
            <value>auto</value>
            <value>nfs</value>
          </choice>
        </attribute>
313 314 315
        <optional>
          <ref name='sourceinfovendor'/>
        </optional>
316 317 318 319 320 321 322 323
      </element>
    </optional>
  </define>


  <define name='sourcefmtdisk'>
    <optional>
      <element name='format'>
324 325 326 327 328 329 330 331 332 333 334 335 336
        <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>
337 338 339
        <optional>
          <ref name='sourceinfovendor'/>
        </optional>
340 341 342 343 344 345 346 347
      </element>
    </optional>
  </define>


  <define name='sourcefmtlogical'>
    <optional>
      <element name='format'>
348 349 350 351 352 353
        <attribute name='type'>
          <choice>
            <value>auto</value>
            <value>lvm2</value>
          </choice>
        </attribute>
354 355 356
        <optional>
          <ref name='sourceinfovendor'/>
        </optional>
357 358 359 360 361 362 363 364
      </element>
    </optional>
  </define>


  <define name='sourcedir'>
    <optional>
      <element name='source'>
365
        <empty/>
366 367 368
        <optional>
          <ref name='sourceinfovendor'/>
        </optional>
369 370 371
      </element>
    </optional>
  </define>
372

373 374 375 376
  <define name='sourcefs'>
    <element name='source'>
      <ref name='sourceinfodev'/>
      <ref name='sourcefmtfs'/>
377 378 379
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
380 381 382 383 384 385 386 387
    </element>
  </define>

  <define name='sourcenetfs'>
    <element name='source'>
      <ref name='sourceinfohost'/>
      <ref name='sourceinfodir'/>
      <ref name='sourcefmtnetfs'/>
388 389 390
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
391 392 393 394 395
    </element>
  </define>

  <define name='sourcelogical'>
    <element name='source'>
396 397 398 399 400 401 402 403
      <oneOrMore>
        <optional>
          <ref name='sourceinfoname'/>
        </optional>
        <optional>
          <ref name='sourceinfodev'/>
        </optional>
      </oneOrMore>
404
      <ref name='sourcefmtlogical'/>
405 406 407
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
408 409 410 411 412 413 414
    </element>
  </define>

  <define name='sourcedisk'>
    <element name='source'>
      <ref name='sourceinfodev'/>
      <ref name='sourcefmtdisk'/>
415 416 417
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
418 419 420 421 422 423 424
    </element>
  </define>

  <define name='sourceiscsi'>
    <element name='source'>
      <ref name='sourceinfohost'/>
      <ref name='sourceinfodev'/>
D
David Allan 已提交
425
      <optional>
D
David Allan 已提交
426
        <ref name='initiatorinfo'/>
D
David Allan 已提交
427
      </optional>
428 429 430
      <optional>
        <ref name='sourceinfoauth'/>
      </optional>
431 432 433
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>
434 435 436 437 438
    </element>
  </define>

  <define name='sourcescsi'>
    <element name='source'>
439
      <ref name='sourceinfoadapter'/>
440 441 442 443
      <optional>
        <ref name='sourceinfovendor'/>
      </optional>

444 445 446
    </element>
  </define>

447 448 449 450 451
  <define name='sourcempath'>
    <element name='source'>
      <empty/>
    </element>
  </define>
452 453 454 455 456 457 458

  <define name='name'>
    <data type='string'>
      <param name="pattern">[a-zA-Z0-9_\+\-]+</param>
    </data>
  </define>

459 460 461 462 463
  <define name="PortNumber">
    <data type="short">
      <param name="minInclusive">-1</param>
    </data>
  </define>
464 465

</grammar>