[libvirt PATCH v3 2/8] schema: Move host cpu definition to cputypes.rng

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This also inlines the defintions for "cpufeature", "cpuspec",
"featureName" and "pagesHost", as "cpu" was the only user.

Doing so avoids a naming collision when cputypes.rng is included in
other schemas in a later patch.

Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 docs/schemas/capability.rng | 82 +------------------------------------
 docs/schemas/cputypes.rng   | 74 +++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 80 deletions(-)

diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng
index 68bdb29695..91a046eb48 100644
--- a/docs/schemas/capability.rng
+++ b/docs/schemas/capability.rng
@@ -3,6 +3,7 @@
 <grammar xmlns="http://relaxng.org/ns/structure/1.0";
     datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
   <include href="basictypes.rng"/>
+  <include href="cputypes.rng"/>
   <start>
     <ref name="capabilities"/>
   </start>
@@ -25,17 +26,7 @@
           <ref name="UUID"/>
         </element>
       </optional>
-      <element name="cpu">
-        <element name="arch">
-          <ref name="archnames"/>
-        </element>
-        <optional>
-          <ref name="cpufeatures"/>
-        </optional>
-        <optional>
-          <ref name="cpuspec"/>
-        </optional>
-      </element>
+      <ref name="hostcpu"/>
       <optional>
         <ref name="power_management"/>
       </optional>
@@ -81,64 +72,6 @@
     </element>
   </define>
 
-
-  <define name="cpufeatures">
-    <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>
-  </define>
-
-  <define name="cpuspec">
-    <element name="model">
-      <text/>
-    </element>
-    <optional>
-      <element name="vendor">
-        <text/>
-      </element>
-    </optional>
-    <optional>
-      <element name="microcode">
-        <attribute name="version">
-          <ref name="positiveInteger"/>
-        </attribute>
-      </element>
-    </optional>
-    <element name="topology">
-      <attribute name="sockets">
-        <ref name="positiveInteger"/>
-      </attribute>
-      <attribute name="cores">
-        <ref name="positiveInteger"/>
-      </attribute>
-      <attribute name="threads">
-        <ref name="positiveInteger"/>
-      </attribute>
-    </element>
-    <zeroOrMore>
-      <element name="feature">
-        <attribute name="name">
-          <ref name="featureName"/>
-        </attribute>
-        <empty/>
-      </element>
-    </zeroOrMore>
-    <zeroOrMore>
-      <ref name="pagesHost"/>
-    </zeroOrMore>
-  </define>
-
   <define name="power_management">
     <element name="power_management">
       <interleave>
@@ -567,17 +500,6 @@
     </attribute>
   </define>
 
-  <define name="featureName">
-    <data type="string">
-      <param name="pattern">[a-zA-Z0-9\-_]+</param>
-    </data>
-  </define>
-
-  <define name="pagesHost">
-    <element name="pages">
-      <ref name="pagesElem"/>
-    </element>
-  </define>
   <define name="pagesNuma">
     <element name="pages">
       <ref name="pagesElem"/>
diff --git a/docs/schemas/cputypes.rng b/docs/schemas/cputypes.rng
index e6e82b5fd2..a2d4dbe9d1 100644
--- a/docs/schemas/cputypes.rng
+++ b/docs/schemas/cputypes.rng
@@ -299,4 +299,78 @@
     </element>
   </define>
 
+  <define name="hostcpu">
+    <element name="cpu">
+      <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>
+          <element name="vendor">
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name="microcode">
+            <attribute name="version">
+              <ref name="positiveInteger"/>
+            </attribute>
+          </element>
+        </optional>
+        <element name="topology">
+          <attribute name="sockets">
+            <ref name="positiveInteger"/>
+          </attribute>
+          <attribute name="cores">
+            <ref name="positiveInteger"/>
+          </attribute>
+          <attribute name="threads">
+            <ref name="positiveInteger"/>
+          </attribute>
+        </element>
+        <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>
+          </element>
+        </zeroOrMore>
+      </optional>
+    </element>
+  </define>
+
 </grammar>
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux