]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
docs: schemas: Extract disk source host specification
authorPeter Krempa <pkrempa@redhat.com>
Thu, 20 Apr 2017 14:20:26 +0000 (16:20 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 28 Apr 2017 07:48:26 +0000 (09:48 +0200)
'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

index 5c354eb647029ec11fae39b41d1ec59675f86283..41bd400f1bd09a59cace2045b48974480d97a3e9 100644 (file)
     </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>
           <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">