[virt-tools-list] [libosinfo][PATCH] RNG: Adapt to new code

Michal Privoznik mprivozn at redhat.com
Thu Sep 6 06:51:20 UTC 2012


Although there is not much deployment data, we should keep the RNG
consistent to the code so if anybody else wants to populate the DB
he got a clue. This patch also fixes some other small issues
like interleaving or s/network/net/ in demo XML.
---
 data/schemas/libosinfo.rng        |   40 ++++++++++++++++++++++++++++++++----
 examples/demo.js                  |    2 +-
 examples/demo.py                  |    2 +-
 examples/libosinfo-dummy-data.xml |    5 ++-
 4 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng
index 1392f74..3442bd0 100644
--- a/data/schemas/libosinfo.rng
+++ b/data/schemas/libosinfo.rng
@@ -75,6 +75,16 @@
             <ref name='hexid'/>
           </element>
         </optional>
+        <optional>
+          <element name='product'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='subsystem'>
+            <text/>
+          </element>
+        </optional>
       </interleave>
     </element>
   </define>
@@ -169,6 +179,11 @@
           <attribute name='id'>
             <ref name='url'/>
           </attribute>
+          <optional>
+            <element name='driver'>
+              <text/>
+            </element>
+          </optional>
         </element>
       </zeroOrMore>
     </element>
@@ -358,9 +373,9 @@
 
   <define name='os'>
     <element name='os'>
-      <ref name='product-attr'/>
-      <ref name='product-content'/>
       <interleave>
+        <ref name='product-attr'/>
+        <ref name='product-content'/>
         <ref name='product-dates'/>
         <ref name='product-rel'/>
         <optional>
@@ -384,9 +399,9 @@
 
   <define name='platform'>
     <element name='platform'>
-      <ref name='product-attr'/>
-      <ref name='product-content'/>
       <interleave>
+        <ref name='product-attr'/>
+        <ref name='product-content'/>
         <ref name='product-dates'/>
         <ref name='product-rel'/>
         <optional>
@@ -398,7 +413,22 @@
 
   <define name='deployment'>
     <element name='deployment'>
-      <empty/>
+      <attribute name='id'>
+        <ref name='url'/>
+      </attribute>
+      <interleave>
+        <element name='os'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+        <element name='platform'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+        <ref name='devices-rel'/>
+      </interleave>
     </element>
   </define>
 
diff --git a/examples/demo.js b/examples/demo.js
index 2839063..28cf805 100755
--- a/examples/demo.js
+++ b/examples/demo.js
@@ -34,7 +34,7 @@ for (idx in osnames) {
 
 var osid = "http://fedoraproject.org/fedora-11"
 var hvid = "http://qemu.org/qemu-kvm-0.11.0"
-var drvclass = "network"
+var drvclass = "net"
 //var drvclass = "audio"
 
 var os = db.get_os(osid)
diff --git a/examples/demo.py b/examples/demo.py
index 1aceef3..bdc9b9a 100755
--- a/examples/demo.py
+++ b/examples/demo.py
@@ -35,7 +35,7 @@ for name in hvnames:
 
 osid = "http://fedoraproject.org/fedora-11"
 hvid = "http://qemu.org/qemu-kvm-0.11.0"
-drvclass = "network"
+drvclass = "net"
 #drvclass = "audio"
 
 os = db.get_os(osid)
diff --git a/examples/libosinfo-dummy-data.xml b/examples/libosinfo-dummy-data.xml
index 251df76..65d23b7 100644
--- a/examples/libosinfo-dummy-data.xml
+++ b/examples/libosinfo-dummy-data.xml
@@ -8,7 +8,6 @@
   <vendor>0x1274</vendor>
   <product>0x5000</product>
   <name>ES1370</name>
-  <name>es1370</name>
 </device>
 
 <device id="http://pci-ids.ucw.cz/read/PC/1274/1371/80864541">
@@ -32,7 +31,7 @@
 
 <device id="http://pci-ids.ucw.cz/read/PC/a727/0013">
   <!-- 3CRPAG175 Wireless PC Card -->
-  <class>network</class>
+  <class>net</class>
   <bus-type>pci</bus-type>
   <vendor>0xa727</vendor>
   <product>0x0013</product>
@@ -44,6 +43,7 @@
   <short-id>kvm-0.11.0</short-id>
   <name>KVM 0.11.0</name>
   <version>0.11.0</version>
+  <vendor>qemu</vendor>
   <devices>
     <device id="http://pci-ids.ucw.cz/read/PC/1002/4382" />
     <device id="http://pci-ids.ucw.cz/read/PC/1274/5000" />
@@ -88,6 +88,7 @@
 <os id="http://fedoraproject.org/fedora-10">
   <short-id>fedora10</short-id>
   <name>Fedora 10</name>
+  <version>10</version>
   <vendor>Fedora Project</vendor>
 
   <!-- Device support for unspecified platform -->
-- 
1.7.8.6




More information about the virt-tools-list mailing list