[libvirt] [PATCH 02/14] docs: schemas: Extract disk source host specification

Peter Krempa posted 14 patches 8 years, 9 months ago
[libvirt] [PATCH 02/14] docs: schemas: Extract disk source host specification
Posted by Peter Krempa 8 years, 9 months ago
'diskSourceNetwork' schema define was rather big and it would be hard to
simplify it. Split out the host portion subelement into a separate
define.
---
 docs/schemas/domaincommon.rng | 70 +++++++++++++++++++++++--------------------
 1 file changed, 37 insertions(+), 33 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 79ea56960..5d17809b3 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1485,6 +1485,42 @@
     </optional>
   </define>

+  <define name="diskSourceNetworkHost">
+    <element name="host">
+      <choice>
+        <group>
+          <optional>
+            <attribute name="transport">
+              <choice>
+                <value>tcp</value>
+                <value>rdma</value>
+              </choice>
+            </attribute>
+          </optional>
+          <attribute name="name">
+            <choice>
+              <ref name="dnsName"/>
+              <ref name="ipAddr"/>
+            </choice>
+          </attribute>
+          <optional>
+            <attribute name="port">
+              <ref name="unsignedInt"/>
+            </attribute>
+          </optional>
+        </group>
+        <group>
+          <attribute name="transport">
+            <value>unix</value>
+          </attribute>
+          <attribute name="socket">
+            <ref name="absFilePath"/>
+          </attribute>
+        </group>
+      </choice>
+    </element>
+  </define>
+
   <define name="diskSourceNetwork">
     <attribute name="type">
       <value>network</value>
@@ -1509,39 +1545,7 @@
           <attribute name="name"/>
         </optional>
         <zeroOrMore>
-          <element name="host">
-            <choice>
-              <group>
-                <optional>
-                  <attribute name="transport">
-                    <choice>
-                      <value>tcp</value>
-                      <value>rdma</value>
-                    </choice>
-                  </attribute>
-                </optional>
-                <attribute name="name">
-                  <choice>
-                    <ref name="dnsName"/>
-                    <ref name="ipAddr"/>
-                  </choice>
-                </attribute>
-                <optional>
-                  <attribute name="port">
-                    <ref name="unsignedInt"/>
-                  </attribute>
-                </optional>
-              </group>
-              <group>
-                <attribute name="transport">
-                  <value>unix</value>
-                </attribute>
-                <attribute name="socket">
-                  <ref name="absFilePath"/>
-                </attribute>
-              </group>
-            </choice>
-          </element>
+          <ref name="diskSourceNetworkHost"/>
         </zeroOrMore>
         <optional>
           <element name="snapshot">
-- 
2.12.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 02/14] docs: schemas: Extract disk source host specification
Posted by Jiri Denemark 8 years, 9 months ago
On Wed, Apr 26, 2017 at 19:52:32 +0200, Peter Krempa wrote:
> 'diskSourceNetwork' schema define was rather big and it would be hard to
> simplify it. Split out the host portion subelement into a separate
> define.
> ---
>  docs/schemas/domaincommon.rng | 70 +++++++++++++++++++++++--------------------
>  1 file changed, 37 insertions(+), 33 deletions(-)

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list