>From 9e42a0b002e61f8d8beab0f9c44b200d788bca2c Mon Sep 17 00:00:00 2001
From: Guido Guenther <agx@sigxcpu.org>
Date: Thu, 7 Aug 2008 12:46:55 +0200
Subject: [PATCH] hostdev: add RNG schema

---
 docs/libvirt.rng |   62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/docs/libvirt.rng b/docs/libvirt.rng
index cd5d798..60e181f 100644
--- a/docs/libvirt.rng
+++ b/docs/libvirt.rng
@@ -848,6 +848,57 @@
     </element>
   </define>
 
+  <define name='hostdev'>
+    <element name='hostdev'>
+      <optional>
+	<attribute name='mode'>
+	  <choice>
+	    <value>subsystem</value>
+	    <value>capabilities</value>
+	  </choice>
+	</attribute>
+        <attribute name='type'>
+          <choice>
+	    <value>usb</value>
+	    <value>pci</value>
+          </choice>
+        </attribute>
+      </optional>
+      <group>
+          <element name='source'>
+            <choice>
+              <ref name="usbproduct"/>
+              <ref name="usbaddress"/>
+            </choice>
+          </element>
+      </group>
+    </element>
+  </define>
+
+  <define name="usbproduct">
+    <element name="vendor">
+      <attribute name="id">
+          <ref name="usbId"/>
+      </attribute>
+    </element>
+    <element name="product">
+      <attribute name="id">
+          <ref name="usbId"/>
+      </attribute>
+    </element>
+  </define>
+  
+  <define name="usbaddress">
+    <element name="address">
+      <attribute name="bus">
+        <ref name="usbAddr"/>
+      </attribute>
+      <attribute name="device">
+        <ref name="usbAddr"/>
+      </attribute>
+    </element>
+  </define>
+
   <!--
       Devices attached to a domain.
     -->
@@ -868,6 +919,7 @@
             <ref name='parallel'/>
             <ref name='serial'/>
             <ref name='input'/>
+            <ref name='hostdev'/>
 	  </choice>
 	</zeroOrMore>
       </interleave>
@@ -986,4 +1038,14 @@
       <param name="pattern">([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9]</param>
     </data>
   </define>
+  <define name='usbId'>
+    <data type='string'>
+      <param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
+    </data>
+  </define>
+  <define name='usbAddr'>
+    <data type='string'>
+      <param name="pattern">(0x)?[0-9a-fA-F]{1,3}</param>
+    </data>
+  </define>
 </grammar>
-- 
1.5.6.3

