summaryrefslogtreecommitdiffstats
path: root/src/main/resources/libvirt/rng/storagecommon.rng
blob: 14704c737eff2040fdb7fae6f8d81619e5efca27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<?xml version="1.0"?>
<!-- A Relax NG schema for common libvirt XML storage elements -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

  <!-- This schema is not designed for standalone use; another file
       must include both this file and basictypes.rng -->

  <define name="encryption">
    <element name="encryption">
      <attribute name="format">
        <choice>
          <value>default</value>
          <value>qcow</value>
          <value>luks</value>
          <value>luks2</value>
          <value>luks-any</value>
        </choice>
      </attribute>
      <optional>
        <attribute name="engine">
          <choice>
            <value>qemu</value>
            <value>librbd</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <interleave>
          <oneOrMore>
            <ref name="secret"/>
          </oneOrMore>
          <optional>
            <interleave>
              <element name="cipher">
                <ref name="keycipher"/>
              </element>
              <element name="ivgen">
                <ref name="keyivgen"/>
              </element>
            </interleave>
          </optional>
        </interleave>
      </optional>
    </element>
  </define>

  <define name="initiatorinfo">
    <element name="initiator">
      <element name="iqn">
        <attribute name="name">
          <text/>
        </attribute>
        <empty/>
      </element>
    </element>
  </define>

  <define name="reconnect">
    <element name="reconnect">
      <choice>
        <group>
          <attribute name="enabled">
            <ref name="virYesNo"/>
          </attribute>
          <optional>
            <attribute name="timeout">
              <ref name="unsignedInt"/>
            </attribute>
          </optional>
        </group>
        <attribute name="delay">
          <ref name="unsignedInt"/>
        </attribute>
      </choice>
    </element>
  </define>

  <define name="unixSocketSource">
    <element name="source">
      <attribute name="type">
        <value>unix</value>
      </attribute>
      <attribute name="path">
        <ref name="absFilePath"/>
      </attribute>
      <attribute name="mode">
        <choice>
          <value>server</value>
          <value>client</value>
        </choice>
      </attribute>
      <optional>
         <ref name="reconnect"/>
      </optional>
      <empty/>
    </element>
  </define>

  <define name="reservations">
    <element name="reservations">
      <optional>
        <attribute name="managed">
          <ref name="virYesNo"/>
        </attribute>
      </optional>
      <optional>
        <ref name="unixSocketSource"/>
      </optional>
    </element>
  </define>

  <define name="secret">
    <element name="secret">
      <attribute name="type">
        <value>passphrase</value>
      </attribute>
      <choice>
        <attribute name="uuid">
          <ref name="UUID"/>
        </attribute>
        <attribute name="usage">
          <text/>
        </attribute>
      </choice>
    </element>
  </define>

  <define name="compat">
    <element name="compat">
      <data type="string">
        <param name="pattern">[0-9]+\.[0-9]+</param>
      </data>
    </element>
  </define>

  <define name="clusterSize">
    <element name="clusterSize">
      <ref name="scaledInteger"/>
    </element>
  </define>

  <define name="fileFormatFeatures">
    <element name="features">
      <interleave>
        <optional>
          <element name="lazy_refcounts">
            <empty/>
          </element>
        </optional>
        <optional>
          <element name="extended_l2">
            <empty/>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <!-- split the list of known storage formats into two, those where
       we know how to follow backing chains, and all others -->
  <define name="storageFormatBacking">
    <choice>
      <value>cow</value>
      <value>qcow</value>
      <value>qcow2</value>
      <value>qed</value>
      <value>vmdk</value>
    </choice>
  </define>
  <define name="storageFormat">
    <choice>
      <value>raw</value>
      <value>dir</value>
      <value>bochs</value>
      <value>cloop</value>
      <value>dmg</value>
      <value>iso</value>
      <value>vpc</value>
      <value>vdi</value>
      <value>fat</value>
      <value>vhd</value>
      <value>ploop</value>
      <value>luks</value>
      <ref name="storageFormatBacking"/>
    </choice>
  </define>

  <define name="storageStartupPolicy">
    <!-- Use a combine="choice" override in client files that want to
         add additional attributes to a <source> sub-element
         associated with a storage source -->
    <notAllowed/>
  </define>

  <define name="storageSourceExtra">
    <!-- Use a combine="choice" override in client files that want to
         add additional elements as siblings of a <source> sub-element
         associated with a storage source -->
    <notAllowed/>
  </define>

  <define name="permissions">
    <optional>
      <element name="permissions">
        <interleave>
          <optional>
            <element name="mode">
              <ref name="octalMode"/>
            </element>
          </optional>
          <optional>
            <element name="owner">
              <choice>
                <ref name="unsignedInt"/>
                <value>-1</value>
              </choice>
            </element>
          </optional>
          <optional>
            <element name="group">
              <choice>
                <ref name="unsignedInt"/>
                <value>-1</value>
              </choice>
            </element>
          </optional>
          <optional>
            <element name="label">
              <text/>
            </element>
          </optional>
        </interleave>
      </element>
    </optional>
  </define>

  <define name="keycipher">
    <attribute name="name">
      <text/>
    </attribute>
    <attribute name="size">
      <ref name="unsignedInt"/>
    </attribute>
    <optional>
      <attribute name="mode">
        <text/>
      </attribute>
      <attribute name="hash">
        <text/>
      </attribute>
    </optional>
  </define>

  <define name="keyivgen">
    <attribute name="name">
      <text/>
    </attribute>
    <optional>
      <attribute name="hash">
        <text/>
      </attribute>
    </optional>
  </define>

  <define name="refreshVolumeAllocation">
    <choice>
      <value>default</value>
      <value>capacity</value>
    </choice>
  </define>

</grammar>