[PATCH 2/3] schema: Don't enforce ordering of hostcpu capabilities elements

Jim Fehlig jfehlig at suse.com
Thu Aug 11 22:44:17 UTC 2022


The change to caps-test.xml demonstrates the need for the change to
cputypes.rng.

Signed-off-by: Jim Fehlig <jfehlig at suse.com>
---
 src/conf/schemas/cputypes.rng            | 166 ++++++++++++-----------
 tests/capabilityschemadata/caps-test.xml |   1 +
 2 files changed, 85 insertions(+), 82 deletions(-)

diff --git a/src/conf/schemas/cputypes.rng b/src/conf/schemas/cputypes.rng
index 6fbb069661..219acaef14 100644
--- a/src/conf/schemas/cputypes.rng
+++ b/src/conf/schemas/cputypes.rng
@@ -326,90 +326,92 @@
       <element name="arch">
         <ref name="archnames"/>
       </element>
-      <optional>
-        <element name="features">
-          <optional>
-            <element name="pae"><empty/></element>
-          </optional>
-          <optional>
-            <element name="nonpae"><empty/></element>
-          </optional>
-          <optional>
-            <element name="vmx"><empty/></element>
-          </optional>
-          <optional>
-            <element name="svm"><empty/></element>
-          </optional>
-        </element>
-      </optional>
-      <optional>
-        <element name="model">
-          <text/>
-        </element>
-      </optional>
-      <optional>
-        <element name="vendor">
-          <text/>
-        </element>
-      </optional>
-      <optional>
-        <element name="microcode">
-          <attribute name="version">
-            <ref name="positiveInteger"/>
-          </attribute>
-        </element>
-      </optional>
-      <optional>
-        <element name="signature">
-          <attribute name="family">
-            <ref name="positiveInteger"/>
-          </attribute>
-          <attribute name="model">
-            <ref name="unsignedInt"/>
-          </attribute>
-          <attribute name="stepping">
-            <ref name="unsignedInt"/>
-          </attribute>
-        </element>
-      </optional>
-      <optional>
-        <element name="counter">
-          <attribute name="name">
+      <interleave>
+        <optional>
+          <element name="features">
+            <optional>
+              <element name="pae"><empty/></element>
+            </optional>
+            <optional>
+              <element name="nonpae"><empty/></element>
+            </optional>
+            <optional>
+              <element name="vmx"><empty/></element>
+            </optional>
+            <optional>
+              <element name="svm"><empty/></element>
+            </optional>
+          </element>
+        </optional>
+        <optional>
+          <element name="model">
             <text/>
-          </attribute>
-          <attribute name="frequency">
-            <ref name="positiveInteger"/>
-          </attribute>
-          <attribute name="scaling">
-            <ref name="virYesNo"/>
-          </attribute>
-        </element>
-      </optional>
-      <optional>
-        <ref name="cpuTopology"/>
-      </optional>
-      <zeroOrMore>
-        <element name="feature">
-          <attribute name="name">
-            <data type="string">
-              <param name="pattern">[a-zA-Z0-9\-_]+</param>
-            </data>
-          </attribute>
-          <empty/>
-        </element>
-      </zeroOrMore>
-      <zeroOrMore>
-        <element name="pages">
-          <optional>
-            <attribute name="unit">
-              <ref name="unit"/>
+          </element>
+        </optional>
+        <optional>
+          <element name="vendor">
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name="microcode">
+            <attribute name="version">
+              <ref name="positiveInteger"/>
+            </attribute>
+          </element>
+        </optional>
+        <optional>
+          <element name="signature">
+            <attribute name="family">
+              <ref name="positiveInteger"/>
+            </attribute>
+            <attribute name="model">
+              <ref name="unsignedInt"/>
+            </attribute>
+            <attribute name="stepping">
+              <ref name="unsignedInt"/>
+            </attribute>
+          </element>
+        </optional>
+        <optional>
+          <element name="counter">
+            <attribute name="name">
+              <text/>
+            </attribute>
+            <attribute name="frequency">
+              <ref name="positiveInteger"/>
+            </attribute>
+            <attribute name="scaling">
+              <ref name="virYesNo"/>
+            </attribute>
+          </element>
+        </optional>
+        <optional>
+          <ref name="cpuTopology"/>
+        </optional>
+        <zeroOrMore>
+          <element name="feature">
+            <attribute name="name">
+              <data type="string">
+                <param name="pattern">[a-zA-Z0-9\-_]+</param>
+              </data>
+            </attribute>
+            <empty/>
+          </element>
+        </zeroOrMore>
+        <zeroOrMore>
+          <element name="pages">
+            <optional>
+              <attribute name="unit">
+                <ref name="unit"/>
+              </attribute>
+            </optional>
+            <attribute name="size">
+              <ref name="unsignedInt"/>
             </attribute>
-          </optional>
-          <attribute name="size">
-            <ref name="unsignedInt"/>
-          </attribute>
-        </element>
-      </zeroOrMore>
+          </element>
+        </zeroOrMore>
+      </interleave>
     </element>
   </define>
 
diff --git a/tests/capabilityschemadata/caps-test.xml b/tests/capabilityschemadata/caps-test.xml
index da199611ea..44a390a5b6 100644
--- a/tests/capabilityschemadata/caps-test.xml
+++ b/tests/capabilityschemadata/caps-test.xml
@@ -3,6 +3,7 @@
   <host>
     <cpu>
       <arch>i686</arch>
+      <vendor>Intel</vendor>
       <features>
         <pae/>
         <nonpae/>
-- 
2.37.1



More information about the libvir-list mailing list