d76c62
From d7aeea8dfb78168ae305252bf581d46766496e24 Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <d7aeea8dfb78168ae305252bf581d46766496e24@dist-git>
d76c62
From: Han Han <hhan@redhat.com>
d76c62
Date: Mon, 30 Mar 2020 17:21:44 +0200
d76c62
Subject: [PATCH] schemas: rng: Use interleave in the disk source element
d76c62
d76c62
Signed-off-by: Han Han <hhan@redhat.com>
d76c62
Reviewed-by: Erik Skultety <eskultet@redhat.com>
d76c62
(cherry picked from commit 8b41b21aee4fb3b0f5fed1ecc73c5a7fd6879a93)
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1804750
d76c62
Message-Id: <79373ae94fb73576d1433b22545327a4afca2d99.1585581552.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
d76c62
---
d76c62
 docs/schemas/domaincommon.rng | 398 ++++++++++++++++++----------------
d76c62
 1 file changed, 211 insertions(+), 187 deletions(-)
d76c62
d76c62
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
d76c62
index ac6f180382..e17f7ff8c0 100644
d76c62
--- a/docs/schemas/domaincommon.rng
d76c62
+++ b/docs/schemas/domaincommon.rng
d76c62
@@ -1642,21 +1642,23 @@
d76c62
     </optional>
d76c62
     <optional>
d76c62
       <element name="source">
d76c62
-        <optional>
d76c62
-          <attribute name="file">
d76c62
-            <ref name="absFilePath"/>
d76c62
-          </attribute>
d76c62
-        </optional>
d76c62
-        <ref name="diskSourceCommon"/>
d76c62
-        <optional>
d76c62
-          <ref name="storageStartupPolicy"/>
d76c62
-        </optional>
d76c62
-        <optional>
d76c62
-          <ref name="encryption"/>
d76c62
-        </optional>
d76c62
-        <zeroOrMore>
d76c62
-          <ref name='devSeclabel'/>
d76c62
-        </zeroOrMore>
d76c62
+        <interleave>
d76c62
+          <optional>
d76c62
+            <attribute name="file">
d76c62
+              <ref name="absFilePath"/>
d76c62
+            </attribute>
d76c62
+          </optional>
d76c62
+          <ref name="diskSourceCommon"/>
d76c62
+          <optional>
d76c62
+            <ref name="storageStartupPolicy"/>
d76c62
+          </optional>
d76c62
+          <optional>
d76c62
+            <ref name="encryption"/>
d76c62
+          </optional>
d76c62
+          <zeroOrMore>
d76c62
+            <ref name='devSeclabel'/>
d76c62
+          </zeroOrMore>
d76c62
+        </interleave>
d76c62
       </element>
d76c62
     </optional>
d76c62
   </define>
d76c62
@@ -1667,24 +1669,26 @@
d76c62
     </attribute>
d76c62
     <optional>
d76c62
       <element name="source">
d76c62
-        <optional>
d76c62
-          <attribute name="dev">
d76c62
-            <ref name="absFilePath"/>
d76c62
-          </attribute>
d76c62
-        </optional>
d76c62
-        <ref name="diskSourceCommon"/>
d76c62
-        <optional>
d76c62
-          <ref name="storageStartupPolicy"/>
d76c62
-        </optional>
d76c62
-        <optional>
d76c62
-          <ref name="encryption"/>
d76c62
-        </optional>
d76c62
-        <optional>
d76c62
-          <ref name="reservations"/>
d76c62
-        </optional>
d76c62
-        <zeroOrMore>
d76c62
-          <ref name='devSeclabel'/>
d76c62
-        </zeroOrMore>
d76c62
+        <interleave>
d76c62
+          <optional>
d76c62
+            <attribute name="dev">
d76c62
+              <ref name="absFilePath"/>
d76c62
+            </attribute>
d76c62
+          </optional>
d76c62
+          <ref name="diskSourceCommon"/>
d76c62
+          <optional>
d76c62
+            <ref name="storageStartupPolicy"/>
d76c62
+          </optional>
d76c62
+          <optional>
d76c62
+            <ref name="encryption"/>
d76c62
+          </optional>
d76c62
+          <optional>
d76c62
+            <ref name="reservations"/>
d76c62
+          </optional>
d76c62
+          <zeroOrMore>
d76c62
+            <ref name='devSeclabel'/>
d76c62
+          </zeroOrMore>
d76c62
+        </interleave>
d76c62
       </element>
d76c62
     </optional>
d76c62
   </define>
d76c62
@@ -1695,17 +1699,19 @@
d76c62
     </attribute>
d76c62
     <optional>
d76c62
       <element name="source">
d76c62
-        <attribute name="dir">
d76c62
-          <ref name="absFilePath"/>
d76c62
-        </attribute>
d76c62
-        <ref name="diskSourceCommon"/>
d76c62
-        <optional>
d76c62
-          <ref name="storageStartupPolicy"/>
d76c62
-        </optional>
d76c62
-        <optional>
d76c62
-          <ref name="encryption"/>
d76c62
-        </optional>
d76c62
-        <empty/>
d76c62
+        <interleave>
d76c62
+          <attribute name="dir">
d76c62
+            <ref name="absFilePath"/>
d76c62
+          </attribute>
d76c62
+          <ref name="diskSourceCommon"/>
d76c62
+          <optional>
d76c62
+            <ref name="storageStartupPolicy"/>
d76c62
+          </optional>
d76c62
+          <optional>
d76c62
+            <ref name="encryption"/>
d76c62
+          </optional>
d76c62
+          <empty/>
d76c62
+        </interleave>
d76c62
       </element>
d76c62
     </optional>
d76c62
   </define>
d76c62
@@ -1856,138 +1862,152 @@
d76c62
 
d76c62
   <define name="diskSourceNetworkProtocolHTTPS">
d76c62
     <element name="source">
d76c62
-      <attribute name="protocol">
d76c62
-        <choice>
d76c62
-          <value>https</value>
d76c62
-        </choice>
d76c62
-      </attribute>
d76c62
-      <attribute name="name"/>
d76c62
-      <ref name="diskSourceCommon"/>
d76c62
-      <ref name="diskSourceNetworkHost"/>
d76c62
-      <optional>
d76c62
-        <ref name="encryption"/>
d76c62
-      </optional>
d76c62
-      <optional>
d76c62
-        <ref name="diskSourceNetworkProtocolSSLVerify"/>
d76c62
-      </optional>
d76c62
-      <optional>
d76c62
-        <ref name="diskSourceNetworkProtocolHTTPCookies"/>
d76c62
-      </optional>
d76c62
-      <ref name="diskSourceNetworkProtocolPropsCommon"/>
d76c62
+      <interleave>
d76c62
+        <attribute name="protocol">
d76c62
+          <choice>
d76c62
+            <value>https</value>
d76c62
+          </choice>
d76c62
+        </attribute>
d76c62
+        <attribute name="name"/>
d76c62
+        <ref name="diskSourceCommon"/>
d76c62
+        <ref name="diskSourceNetworkHost"/>
d76c62
+        <optional>
d76c62
+          <ref name="encryption"/>
d76c62
+        </optional>
d76c62
+        <optional>
d76c62
+          <ref name="diskSourceNetworkProtocolSSLVerify"/>
d76c62
+        </optional>
d76c62
+        <optional>
d76c62
+          <ref name="diskSourceNetworkProtocolHTTPCookies"/>
d76c62
+        </optional>
d76c62
+        <ref name="diskSourceNetworkProtocolPropsCommon"/>
d76c62
+        </interleave>
d76c62
     </element>
d76c62
   </define>
d76c62
 
d76c62
   <define name="diskSourceNetworkProtocolHTTP">
d76c62
     <element name="source">
d76c62
-      <attribute name="protocol">
d76c62
-        <choice>
d76c62
-          <value>http</value>
d76c62
-        </choice>
d76c62
-      </attribute>
d76c62
-      <attribute name="name"/>
d76c62
-      <ref name="diskSourceCommon"/>
d76c62
-      <ref name="diskSourceNetworkHost"/>
d76c62
-      <optional>
d76c62
-        <ref name="encryption"/>
d76c62
-      </optional>
d76c62
-      <optional>
d76c62
-        <ref name="diskSourceNetworkProtocolHTTPCookies"/>
d76c62
-      </optional>
d76c62
-      <ref name="diskSourceNetworkProtocolPropsCommon"/>
d76c62
+      <interleave>
d76c62
+        <attribute name="protocol">
d76c62
+          <choice>
d76c62
+            <value>http</value>
d76c62
+          </choice>
d76c62
+        </attribute>
d76c62
+        <attribute name="name"/>
d76c62
+        <ref name="diskSourceCommon"/>
d76c62
+        <ref name="diskSourceNetworkHost"/>
d76c62
+        <optional>
d76c62
+          <ref name="encryption"/>
d76c62
+        </optional>
d76c62
+        <optional>
d76c62
+          <ref name="diskSourceNetworkProtocolHTTPCookies"/>
d76c62
+        </optional>
d76c62
+        <ref name="diskSourceNetworkProtocolPropsCommon"/>
d76c62
+      </interleave>
d76c62
     </element>
d76c62
   </define>
d76c62
 
d76c62
   <define name="diskSourceNetworkProtocolFTPS">
d76c62
     <element name="source">
d76c62
-      <attribute name="protocol">
d76c62
-        <choice>
d76c62
-          <value>ftps</value>
d76c62
-        </choice>
d76c62
-      </attribute>
d76c62
-      <attribute name="name"/>
d76c62
-      <ref name="diskSourceCommon"/>
d76c62
-      <ref name="diskSourceNetworkHost"/>
d76c62
-      <optional>
d76c62
-        <ref name="encryption"/>
d76c62
-      </optional>
d76c62
-      <optional>
d76c62
-        <ref name="diskSourceNetworkProtocolSSLVerify"/>
d76c62
-      </optional>
d76c62
-      <ref name="diskSourceNetworkProtocolPropsCommon"/>
d76c62
+      <interleave>
d76c62
+        <attribute name="protocol">
d76c62
+          <choice>
d76c62
+            <value>ftps</value>
d76c62
+          </choice>
d76c62
+        </attribute>
d76c62
+        <attribute name="name"/>
d76c62
+        <ref name="diskSourceCommon"/>
d76c62
+        <ref name="diskSourceNetworkHost"/>
d76c62
+        <optional>
d76c62
+          <ref name="encryption"/>
d76c62
+        </optional>
d76c62
+        <optional>
d76c62
+          <ref name="diskSourceNetworkProtocolSSLVerify"/>
d76c62
+        </optional>
d76c62
+        <ref name="diskSourceNetworkProtocolPropsCommon"/>
d76c62
+      </interleave>
d76c62
     </element>
d76c62
   </define>
d76c62
 
d76c62
   <define name="diskSourceNetworkProtocolSimple">
d76c62
     <element name="source">
d76c62
-      <attribute name="protocol">
d76c62
-        <choice>
d76c62
-          <value>sheepdog</value>
d76c62
-          <value>ftp</value>
d76c62
-          <value>tftp</value>
d76c62
-        </choice>
d76c62
-      </attribute>
d76c62
-      <attribute name="name"/>
d76c62
-      <ref name="diskSourceCommon"/>
d76c62
-      <ref name="diskSourceNetworkHost"/>
d76c62
-      <optional>
d76c62
-        <ref name="encryption"/>
d76c62
-      </optional>
d76c62
-      <ref name="diskSourceNetworkProtocolPropsCommon"/>
d76c62
+      <interleave>
d76c62
+        <attribute name="protocol">
d76c62
+          <choice>
d76c62
+            <value>sheepdog</value>
d76c62
+            <value>ftp</value>
d76c62
+            <value>tftp</value>
d76c62
+          </choice>
d76c62
+        </attribute>
d76c62
+        <attribute name="name"/>
d76c62
+        <ref name="diskSourceCommon"/>
d76c62
+        <ref name="diskSourceNetworkHost"/>
d76c62
+        <optional>
d76c62
+          <ref name="encryption"/>
d76c62
+        </optional>
d76c62
+        <ref name="diskSourceNetworkProtocolPropsCommon"/>
d76c62
+      </interleave>
d76c62
     </element>
d76c62
   </define>
d76c62
 
d76c62
   <define name="diskSourceNetworkProtocolNBD">
d76c62
     <element name="source">
d76c62
-      <attribute name="protocol">
d76c62
-        <value>nbd</value>
d76c62
-      </attribute>
d76c62
-      <optional>
d76c62
-        <attribute name="name"/>
d76c62
-      </optional>
d76c62
-      <optional>
d76c62
-        <attribute name="tls">
d76c62
-          <ref name="virYesNo"/>
d76c62
+      <interleave>
d76c62
+        <attribute name="protocol">
d76c62
+          <value>nbd</value>
d76c62
         </attribute>
d76c62
-      </optional>
d76c62
-      <ref name="diskSourceCommon"/>
d76c62
-      <ref name="diskSourceNetworkHost"/>
d76c62
-      <optional>
d76c62
-        <ref name="encryption"/>
d76c62
-      </optional>
d76c62
+        <optional>
d76c62
+          <attribute name="name"/>
d76c62
+        </optional>
d76c62
+        <optional>
d76c62
+          <attribute name="tls">
d76c62
+            <ref name="virYesNo"/>
d76c62
+          </attribute>
d76c62
+        </optional>
d76c62
+        <ref name="diskSourceCommon"/>
d76c62
+        <ref name="diskSourceNetworkHost"/>
d76c62
+        <optional>
d76c62
+          <ref name="encryption"/>
d76c62
+        </optional>
d76c62
+      </interleave>
d76c62
     </element>
d76c62
   </define>
d76c62
 
d76c62
   <define name="diskSourceNetworkProtocolGluster">
d76c62
     <element name="source">
d76c62
-      <attribute name="protocol">
d76c62
-        <value>gluster</value>
d76c62
-      </attribute>
d76c62
-      <attribute name="name"/>
d76c62
-      <ref name="diskSourceCommon"/>
d76c62
-      <oneOrMore>
d76c62
-        <ref name="diskSourceNetworkHost"/>
d76c62
-      </oneOrMore>
d76c62
-      <optional>
d76c62
-        <ref name="encryption"/>
d76c62
-      </optional>
d76c62
+      <interleave>
d76c62
+        <attribute name="protocol">
d76c62
+          <value>gluster</value>
d76c62
+        </attribute>
d76c62
+        <attribute name="name"/>
d76c62
+        <ref name="diskSourceCommon"/>
d76c62
+        <oneOrMore>
d76c62
+          <ref name="diskSourceNetworkHost"/>
d76c62
+        </oneOrMore>
d76c62
+        <optional>
d76c62
+          <ref name="encryption"/>
d76c62
+        </optional>
d76c62
+      </interleave>
d76c62
     </element>
d76c62
   </define>
d76c62
 
d76c62
   <define name="diskSourceNetworkProtocolVxHS">
d76c62
     <element name="source">
d76c62
-      <attribute name="protocol">
d76c62
-        <choice>
d76c62
-          <value>vxhs</value>
d76c62
-        </choice>
d76c62
-      </attribute>
d76c62
-      <attribute name="name"/>
d76c62
-      <ref name="diskSourceCommon"/>
d76c62
-      <optional>
d76c62
-        <attribute name="tls">
d76c62
-          <ref name="virYesNo"/>
d76c62
+      <interleave>
d76c62
+        <attribute name="protocol">
d76c62
+          <choice>
d76c62
+            <value>vxhs</value>
d76c62
+          </choice>
d76c62
         </attribute>
d76c62
-      </optional>
d76c62
-      <ref name="diskSourceNetworkHost"/>
d76c62
+        <attribute name="name"/>
d76c62
+        <ref name="diskSourceCommon"/>
d76c62
+        <optional>
d76c62
+          <attribute name="tls">
d76c62
+            <ref name="virYesNo"/>
d76c62
+          </attribute>
d76c62
+        </optional>
d76c62
+        <ref name="diskSourceNetworkHost"/>
d76c62
+      </interleave>
d76c62
     </element>
d76c62
   </define>
d76c62
 
d76c62
@@ -2014,30 +2034,32 @@
d76c62
     </attribute>
d76c62
     <optional>
d76c62
       <element name="source">
d76c62
-        <attribute name="pool">
d76c62
-          <ref name="poolName"/>
d76c62
-        </attribute>
d76c62
-        <attribute name="volume">
d76c62
-          <ref name="volName"/>
d76c62
-        </attribute>
d76c62
-        <optional>
d76c62
-          <attribute name="mode">
d76c62
-            <choice>
d76c62
-              <value>host</value>
d76c62
-              <value>direct</value>
d76c62
-            </choice>
d76c62
+        <interleave>
d76c62
+          <attribute name="pool">
d76c62
+            <ref name="poolName"/>
d76c62
           </attribute>
d76c62
-        </optional>
d76c62
-        <ref name="diskSourceCommon"/>
d76c62
-        <optional>
d76c62
-          <ref name="storageStartupPolicy"/>
d76c62
-        </optional>
d76c62
-        <optional>
d76c62
-          <ref name="encryption"/>
d76c62
-        </optional>
d76c62
-        <zeroOrMore>
d76c62
-          <ref name='devSeclabel'/>
d76c62
-        </zeroOrMore>
d76c62
+          <attribute name="volume">
d76c62
+            <ref name="volName"/>
d76c62
+          </attribute>
d76c62
+          <optional>
d76c62
+            <attribute name="mode">
d76c62
+              <choice>
d76c62
+                <value>host</value>
d76c62
+                <value>direct</value>
d76c62
+              </choice>
d76c62
+            </attribute>
d76c62
+          </optional>
d76c62
+          <ref name="diskSourceCommon"/>
d76c62
+          <optional>
d76c62
+            <ref name="storageStartupPolicy"/>
d76c62
+          </optional>
d76c62
+          <optional>
d76c62
+            <ref name="encryption"/>
d76c62
+          </optional>
d76c62
+          <zeroOrMore>
d76c62
+            <ref name='devSeclabel'/>
d76c62
+          </zeroOrMore>
d76c62
+        </interleave>
d76c62
       </element>
d76c62
     </optional>
d76c62
   </define>
d76c62
@@ -2048,27 +2070,29 @@
d76c62
     </attribute>
d76c62
     <optional>
d76c62
       <element name="source">
d76c62
-        <attribute name="type">
d76c62
-          <value>pci</value>
d76c62
-        </attribute>
d76c62
-        <attribute name="namespace">
d76c62
-          <ref name="uint32"/>
d76c62
-        </attribute>
d76c62
-        <optional>
d76c62
-          <attribute name="managed">
d76c62
-            <ref name="virYesNo"/>
d76c62
+        <interleave>
d76c62
+          <attribute name="type">
d76c62
+            <value>pci</value>
d76c62
           </attribute>
d76c62
-        </optional>
d76c62
-        <element name="address">
d76c62
-          <ref name="pciaddress"/>
d76c62
-        </element>
d76c62
-        <ref name="diskSourceCommon"/>
d76c62
-        <optional>
d76c62
-          <ref name="storageStartupPolicy"/>
d76c62
-        </optional>
d76c62
-        <optional>
d76c62
-          <ref name="encryption"/>
d76c62
-        </optional>
d76c62
+          <attribute name="namespace">
d76c62
+            <ref name="uint32"/>
d76c62
+          </attribute>
d76c62
+          <optional>
d76c62
+            <attribute name="managed">
d76c62
+              <ref name="virYesNo"/>
d76c62
+            </attribute>
d76c62
+          </optional>
d76c62
+          <element name="address">
d76c62
+            <ref name="pciaddress"/>
d76c62
+          </element>
d76c62
+          <ref name="diskSourceCommon"/>
d76c62
+          <optional>
d76c62
+            <ref name="storageStartupPolicy"/>
d76c62
+          </optional>
d76c62
+          <optional>
d76c62
+            <ref name="encryption"/>
d76c62
+          </optional>
d76c62
+        </interleave>
d76c62
       </element>
d76c62
     </optional>
d76c62
   </define>
d76c62
-- 
d76c62
2.26.0
d76c62