[libvirt] [PATCH 07/14] docs: schemas: Split up definitions for NBD and gluster

Peter Krempa pkrempa at redhat.com
Wed Apr 26 17:52:37 UTC 2017


NBD does not mandate a "filename". Gluster can have more servers. Split
them so that we can tighten the schema.
---
 docs/schemas/domaincommon.rng | 43 +++++++++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 16 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index d5e6bdb6b..0c51f5151 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1585,31 +1585,42 @@
     </element>
   </define>

-  <define name="diskSourceNetworkProtocolGeneric">
+  <define name="diskSourceNetworkProtocolNBD">
     <element name="source">
-      <interleave>
-        <attribute name="protocol">
-          <choice>
-            <value>nbd</value>
-            <value>gluster</value>
-          </choice>
-        </attribute>
-        <optional>
-          <attribute name="name"/>
-        </optional>
-        <zeroOrMore>
-          <ref name="diskSourceNetworkHost"/>
-        </zeroOrMore>
-      </interleave>
+      <attribute name="protocol">
+        <choice>
+          <value>nbd</value>
+        </choice>
+      </attribute>
+      <optional>
+        <attribute name="name"/>
+      </optional>
+      <ref name="diskSourceNetworkHost"/>
+    </element>
+  </define>
+
+  <define name="diskSourceNetworkProtocolGluster">
+    <element name="source">
+      <attribute name="protocol">
+        <choice>
+          <value>gluster</value>
+        </choice>
+      </attribute>
+      <attribute name="name"/>
+      <oneOrMore>
+        <ref name="diskSourceNetworkHost"/>
+      </oneOrMore>
     </element>
   </define>

+
   <define name="diskSourceNetwork">
     <attribute name="type">
       <value>network</value>
     </attribute>
     <choice>
-      <ref name="diskSourceNetworkProtocolGeneric"/>
+      <ref name="diskSourceNetworkProtocolNBD"/>
+      <ref name="diskSourceNetworkProtocolGluster"/>
       <ref name="diskSourceNetworkProtocolRBD"/>
       <ref name="diskSourceNetworkProtocolHTTP"/>
       <ref name="diskSourceNetworkProtocolSimple"/>
-- 
2.12.2




More information about the libvir-list mailing list