]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
schema: Allow lxc:namepsace children to appear individually
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 15 Dec 2020 15:27:47 +0000 (16:27 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Dec 2020 08:39:26 +0000 (09:39 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
docs/schemas/domaincommon.rng

index 795b654feb863891725e3aade9eb937d8e0577cf..17e25f14f2a580386f735926bd71833df28d0438 100644 (file)
     -->
   <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>