]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
schema: domain: Allow interleaving of subelements of disk's 'mirror'
authorPeter Krempa <pkrempa@redhat.com>
Thu, 13 Oct 2022 14:38:23 +0000 (16:38 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 1 Nov 2022 12:07:20 +0000 (13:07 +0100)
While for now the 'mirror' element is output only, the idea was to allow
it to be used for input too to restore the mirror job if that becomes
the necessity. Allowing interleaving of the subelements can be done
regardless.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/schemas/domaincommon.rng

index 99a705aa3c8adfa451fcdb7b12229bd420cb21e7..a1b004921b2275b37588d9d943fa9e33b138d7f0 100644 (file)
 
   <define name="diskMirror">
     <element name="mirror">
-      <choice>
-        <group> <!-- old format, for block copy back-compat -->
-          <attribute name="file">
-            <ref name="absFilePath"/>
-          </attribute>
-          <optional>
-            <attribute name="format">
-              <ref name="storageFormat"/>
+      <interleave>
+        <choice>
+          <group> <!-- old format, for block copy back-compat -->
+            <attribute name="file">
+              <ref name="absFilePath"/>
             </attribute>
-          </optional>
-          <optional>
+            <optional>
+              <attribute name="format">
+                <ref name="storageFormat"/>
+              </attribute>
+            </optional>
+            <optional>
+              <attribute name="job">
+                <value>copy</value>
+              </attribute>
+            </optional>
+            <optional>
+              <interleave>
+                <ref name="diskSourceFile"/>
+                <optional>
+                  <ref name="diskFormat"/>
+                </optional>
+              </interleave>
+            </optional>
+          </group>
+          <group> <!-- preferred format -->
             <attribute name="job">
-              <value>copy</value>
+              <choice>
+                <value>copy</value>
+                <value>active-commit</value>
+              </choice>
             </attribute>
-          </optional>
-          <optional>
             <interleave>
-              <ref name="diskSourceFile"/>
+              <ref name="diskSource"/>
               <optional>
                 <ref name="diskFormat"/>
               </optional>
             </interleave>
-          </optional>
-        </group>
-        <group> <!-- preferred format -->
-          <attribute name="job">
+          </group>
+        </choice>
+        <optional>
+          <attribute name="ready">
             <choice>
-              <value>copy</value>
-              <value>active-commit</value>
+              <value>yes</value>
+              <value>abort</value>
+              <value>pivot</value>
             </choice>
           </attribute>
-          <interleave>
-            <ref name="diskSource"/>
-            <optional>
-              <ref name="diskFormat"/>
-            </optional>
-          </interleave>
-        </group>
-      </choice>
-      <optional>
-        <attribute name="ready">
-          <choice>
-            <value>yes</value>
-            <value>abort</value>
-            <value>pivot</value>
-          </choice>
-        </attribute>
-      </optional>
-      <ref name="diskBackingChain"/>
+        </optional>
+        <ref name="diskBackingChain"/>
+      </interleave>
     </element>
   </define>
+
   <define name="diskAuth">
     <element name="auth">
       <attribute name="username">