Since its introduction in v1.2.19-rc1~8 our schema mandates that
LXC domain namespace child elements appear either all three at
once or not at all:

     <lxc:namespace>
       <lxc:sharenet type='netns' value='red'/>
       <lxc:shareipc type='pid' value='12345'/>
       <lxc:shareuts type='name' value='container1'/>
     </lxc:namespace>

This is not mandated by our parser though. Neither by code that
later uses it (virLXCProcessSetupNamespaces()). Relax the schema.

Signed-off-by: Michal Privoznik <mpriv...@redhat.com>
---
 docs/schemas/domaincommon.rng | 66 +++++++++++++++++++----------------
 1 file changed, 36 insertions(+), 30 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 795b654feb..17e25f14f2 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -6821,36 +6821,42 @@
     -->
   <define name="lxcsharens">
     <element name="namespace" ns="http://libvirt.org/schemas/domain/lxc/1.0";>
-      <zeroOrMore>
-        <element name="sharenet">
-          <attribute name="type">
-            <choice>
-              <value>netns</value>
-              <value>name</value>
-              <value>pid</value>
-            </choice>
-          </attribute>
-          <attribute name="value"/>
-        </element>
-        <element name="shareipc">
-          <attribute name="type">
-            <choice>
-              <value>name</value>
-              <value>pid</value>
-            </choice>
-          </attribute>
-          <attribute name="value"/>
-        </element>
-        <element name="shareuts">
-          <attribute name="type">
-            <choice>
-              <value>name</value>
-              <value>pid</value>
-            </choice>
-          </attribute>
-          <attribute name="value"/>
-        </element>
-      </zeroOrMore>
+      <interleave>
+        <optional>
+          <element name="sharenet">
+            <attribute name="type">
+              <choice>
+                <value>netns</value>
+                <value>name</value>
+                <value>pid</value>
+              </choice>
+            </attribute>
+            <attribute name="value"/>
+          </element>
+        </optional>
+        <optional>
+          <element name="shareipc">
+            <attribute name="type">
+              <choice>
+                <value>name</value>
+                <value>pid</value>
+              </choice>
+            </attribute>
+            <attribute name="value"/>
+          </element>
+        </optional>
+        <optional>
+          <element name="shareuts">
+            <attribute name="type">
+              <choice>
+                <value>name</value>
+                <value>pid</value>
+              </choice>
+            </attribute>
+            <attribute name="value"/>
+          </element>
+        </optional>
+      </interleave>
     </element>
   </define>
 
-- 
2.26.2

Reply via email to