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

Peter Krempa posted 14 patches 8 years, 9 months ago
[libvirt] [PATCH 07/14] docs: schemas: Split up definitions for NBD and gluster
Posted by Peter Krempa 8 years, 9 months ago
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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 07/14] docs: schemas: Split up definitions for NBD and gluster
Posted by Jiri Denemark 8 years, 9 months ago
On Wed, Apr 26, 2017 at 19:52:37 +0200, Peter Krempa wrote:
> 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>
> 
> +

This looks like an unintended new line.

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

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

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