[PATCH 05/15] schema: domain: Allow interleaving of subelements of disk's 'mirror'

Peter Krempa pkrempa at redhat.com
Mon Oct 17 12:37:48 UTC 2022


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 at redhat.com>
---
 src/conf/schemas/domaincommon.rng | 79 ++++++++++++++++---------------
 1 file changed, 41 insertions(+), 38 deletions(-)

diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index 99a705aa3c..a1b004921b 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -7141,57 +7141,60 @@

   <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">
-- 
2.37.3



More information about the libvir-list mailing list