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

[libvirt] [PATCH 04/10] xml: create an RNG file for common types and move some definitions there



domain.rng, network.rng, and interface.rng already use a few of the
same types (or in some cases *should* but don't), and an upcoming code
change will have them sharing even more. To prepare for that, this
patch takes those common data type definitions and moves them into
basictypes.rng.

This may break some rule about the need to RNG files to be autonomous
or something, but I saw that storageencryption.rng is used in this
way, so I figured it must not be completely against the law...
---
 docs/schemas/Makefile.am    |    1 +
 docs/schemas/basictypes.rng |  130 +++++++++++++++++++++++++++++++++++++++++++
 docs/schemas/domain.rng     |   86 +---------------------------
 docs/schemas/interface.rng  |   71 ++++-------------------
 docs/schemas/network.rng    |   79 +++++++-------------------
 libvirt.spec.in             |    1 +
 6 files changed, 168 insertions(+), 200 deletions(-)
 create mode 100644 docs/schemas/basictypes.rng

diff --git a/docs/schemas/Makefile.am b/docs/schemas/Makefile.am
index 36b9aeb..5ef7737 100644
--- a/docs/schemas/Makefile.am
+++ b/docs/schemas/Makefile.am
@@ -2,6 +2,7 @@
 
 schemadir = $(pkgdatadir)/schemas
 schema_DATA = \
+	basictypes.rng \
 	capability.rng \
 	domain.rng \
 	domainsnapshot.rng \
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
new file mode 100644
index 0000000..b3267f5
--- /dev/null
+++ b/docs/schemas/basictypes.rng
@@ -0,0 +1,130 @@
+<?xml version="1.0"?>
+<!-- network-related definitions used in multiple grammars -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"; datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
+
+  <!-- Our unsignedInt doesn"t allow a leading "+" in its lexical form -->
+  <define name="unsignedInt">
+    <data type="unsignedInt">
+      <param name="pattern">[0-9]+</param>
+    </data>
+  </define>
+
+  <define name="positiveInteger">
+    <data type="positiveInteger">
+      <param name="pattern">[0-9]+</param>
+    </data>
+  </define>
+
+  <define name="uint8range">
+    <choice>
+      <data type="string">
+        <param name="pattern">0x[0-9a-fA-F]{1,2}</param>
+      </data>
+      <data type="int">
+        <param name="minInclusive">0</param>
+        <param name="maxInclusive">255</param>
+      </data>
+    </choice>
+  </define>
+  <define name="uint24range">
+    <choice>
+      <data type="string">
+        <param name="pattern">0x[0-9a-fA-F]{1,6}</param>
+      </data>
+      <data type="int">
+        <param name="minInclusive">0</param>
+        <param name="maxInclusive">16777215</param>
+      </data>
+    </choice>
+  </define>
+
+  <define name="UUID">
+    <choice>
+      <data type="string">
+        <param name="pattern">[a-fA-F0-9]{32}</param>
+      </data>
+      <data type="string">
+        <param name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param>
+      </data>
+    </choice>
+  </define>
+
+  <!-- a 6 byte MAC address in ASCII-hex format, eg "12:34:56:78:9A:BC" -->
+  <define name="macAddr">
+    <data type="string">
+      <param name="pattern">([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}</param>
+    </data>
+  </define>
+
+  <!-- An ipv4 "dotted quad" address -->
+  <define name="ipv4Addr">
+    <data type="string">
+      <param name="pattern">(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))</param>
+    </data>
+  </define>
+
+  <!-- Based on http://blog.mes-stats.fr/2008/10/09/regex-ipv4-et-ipv6 -->
+  <define name="ipv6Addr">
+    <data type="string">
+      <!-- To understand this better, take apart the toplevel "|"s -->
+<param name="pattern">(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9])))|(([0-9A-Fa-f]{1,4}:){0,5}:(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9])))|(::([0-9A-Fa-f]{1,4}:){0,5}(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9])))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)</param>
+    </data>
+  </define>
+
+  <define name="ipAddr">
+    <choice>
+      <ref name="ipv4Addr"/>
+      <ref name="ipv6Addr"/>
+    </choice>
+  </define>
+
+  <define name="ipv4Prefix">
+    <data type="unsignedInt">
+      <param name="maxInclusive">32</param>
+    </data>
+  </define>
+
+  <define name="ipv6Prefix">
+    <data type="unsignedInt">
+      <param name="maxInclusive">128</param>
+    </data>
+  </define>
+
+  <define name="ipPrefix">
+    <choice>
+      <ref name="ipv4Prefix"/>
+      <ref name="ipv6Prefix"/>
+    </choice>
+  </define>
+
+  <define name="dnsName">
+    <data type="string">
+      <param name="pattern">[a-zA-Z0-9\.\-]+</param>
+    </data>
+  </define>
+
+  <define name="deviceName">
+    <data type="string">
+      <param name="pattern">[a-zA-Z0-9_\.\-\\:/]+</param>
+    </data>
+  </define>
+
+  <define name="filePath">
+    <data type="string">
+      <param name="pattern">[a-zA-Z0-9_\.\+\-\\&amp;&quot;&apos;&lt;&gt;/%]+</param>
+    </data>
+  </define>
+
+  <define name="absFilePath">
+    <data type="string">
+      <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&amp;&quot;&apos;&lt;&gt;/%]+</param>
+    </data>
+  </define>
+
+  <define name="absDirPath">
+    <data type="string">
+      <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&amp;&quot;&apos;&lt;&gt;/%]*</param>
+    </data>
+  </define>
+
+</grammar>
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index fb1497b..3c8414e 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -5,6 +5,7 @@
     <ref name="domain"/>
   </start>
 
+  <include href='basictypes.rng'/>
   <include href='storageencryption.rng'/>
 
   <!--
@@ -723,7 +724,7 @@
                 <zeroOrMore>
                   <element name="host">
                     <attribute name="name">
-                      <ref name="hostName"/>
+                      <ref name="dnsName"/>
                     </attribute>
                     <attribute name="port">
                       <ref name="unsignedInt"/>
@@ -1092,7 +1093,7 @@
       <optional>
         <element name="mac">
           <attribute name="address">
-            <ref name="addrMAC"/>
+            <ref name="macAddr"/>
           </attribute>
           <empty/>
         </element>
@@ -1100,7 +1101,7 @@
       <optional>
         <element name="ip">
           <attribute name="address">
-            <ref name="addrIP"/>
+            <ref name="ipv4Addr"/>
           </attribute>
           <empty/>
         </element>
@@ -2344,22 +2345,10 @@
   <!--
        Type library
 
-       Our unsignedInt doesn't allow a leading '+' in its lexical form
        A domain name should be made of ascii, numbers, _-+ and is non-empty
-       UUID currently allows only the 32 characters strict syntax
        memoryKB request at least 4Mbytes though Xen will grow bigger if too low
        weight currently is in range [100, 1000]
     -->
-  <define name="unsignedInt">
-    <data type="unsignedInt">
-      <param name="pattern">[0-9]+</param>
-    </data>
-  </define>
-  <define name='positiveInteger'>
-    <data type='positiveInteger'>
-      <param name="pattern">[0-9]+</param>
-    </data>
-  </define>
   <define name="cpuset">
     <data type="string">
       <param name="pattern">([0-9]+(-[0-9]+)?|\^[0-9]+)(,([0-9]+(-[0-9]+)?|\^[0-9]+))*</param>
@@ -2381,11 +2370,6 @@
       <param name="pattern">[0-9]+</param>
     </data>
    </define>
-  <define name="hostName">
-    <data type="string">
-      <param name="pattern">[a-zA-Z0-9\.\-]+</param>
-    </data>
-  </define>
   <define name="PortNumber">
     <data type="short">
       <param name="minInclusive">-1</param>
@@ -2419,51 +2403,11 @@
       <param name="pattern">[a-zA-Z0-9_\+\-]+</param>
     </data>
   </define>
-  <define name="UUID">
-    <choice>
-      <data type="string">
-        <param name="pattern">[a-fA-F0-9]{32}</param>
-      </data>
-      <data type="string">
-        <param name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param>
-      </data>
-    </choice>
-  </define>
-  <define name="filePath">
-    <data type="string">
-      <param name="pattern">[a-zA-Z0-9_\.\+\-\\&amp;&quot;&apos;&lt;&gt;/%]+</param>
-    </data>
-  </define>
-  <define name="absFilePath">
-    <data type="string">
-      <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&amp;&quot;&apos;&lt;&gt;/%]+</param>
-    </data>
-  </define>
-  <define name="absDirPath">
-    <data type="string">
-      <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&amp;&quot;&apos;&lt;&gt;/%]*</param>
-    </data>
-  </define>
-  <define name="deviceName">
-    <data type="string">
-      <param name="pattern">[a-zA-Z0-9_\.\-\\:/]+</param>
-    </data>
-  </define>
   <define name="bridgeMode">
     <data type="string">
       <param name="pattern">(vepa|bridge|private|passthrough)</param>
     </data>
   </define>
-  <define name="addrMAC">
-    <data type="string">
-      <param name="pattern">([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}</param>
-    </data>
-  </define>
-  <define name="addrIP">
-    <data type="string">
-      <param name="pattern">([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9]</param>
-    </data>
-  </define>
   <define name="addrIPorName">
     <data type="string">
       <param name="pattern">(([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9])|(([0-9a-fA-F]+|:)+[0-9a-fA-F]+)|([a-zA-Z0-9_\.\+\-]*)</param>
@@ -2539,28 +2483,6 @@
       <param name="pattern">[a-zA-Z0-9_\.:]+</param>
     </data>
   </define>
-  <define name="uint8range">
-    <choice>
-      <data type="string">
-        <param name="pattern">0x[0-9a-fA-F]{1,2}</param>
-      </data>
-      <data type="int">
-        <param name="minInclusive">0</param>
-        <param name="maxInclusive">255</param>
-      </data>
-    </choice>
-  </define>
-  <define name="uint24range">
-    <choice>
-      <data type="string">
-        <param name="pattern">0x[0-9a-fA-F]{1,6}</param>
-      </data>
-      <data type="int">
-        <param name="minInclusive">0</param>
-        <param name="maxInclusive">16777215</param>
-      </data>
-    </choice>
-  </define>
   <define name="virtualPortProfileID">
     <data type="string">
       <param name="maxLength">39</param>
diff --git a/docs/schemas/interface.rng b/docs/schemas/interface.rng
index 4dd1bb4..53fa18a 100644
--- a/docs/schemas/interface.rng
+++ b/docs/schemas/interface.rng
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
 <!-- A Relax NG schema for network interfaces -->
 <grammar xmlns="http://relaxng.org/ns/structure/1.0";
          xmlns:v="http://netcf.org/xml/version/1.0";
@@ -16,6 +17,7 @@
     </choice>
   </start>
 
+  <include href='basictypes.rng'/>
   <!--
        FIXME: How do we handle VLAN's ? Should they be their own interface
        or should we treat them as an option on the base interface ?  For
@@ -36,7 +38,7 @@
          FIXME: What if device name and MAC don't specify the same NIC ? -->
     <optional>
       <element name="mac">
-        <attribute name="address"><ref name="mac-addr"/></attribute>
+        <attribute name="address"><ref name="macAddr"/></attribute>
       </element>
     </optional>
     <!-- FIXME: Allow (some) ethtool options -->
@@ -75,7 +77,7 @@
     <element name="vlan">
       <attribute name="tag"><ref name="vlan-id"/></attribute>
       <element name="interface">
-        <attribute name="name"><ref name="device-name"/></attribute>
+        <attribute name="name"><ref name="deviceName"/></attribute>
       </element>
     </element>
   </define>
@@ -202,7 +204,7 @@
           </element>
           <element name="arpmon">
             <attribute name="interval"><ref name="uint"/></attribute>
-            <attribute name="target"><ref name="ipv4-addr"/></attribute>
+            <attribute name="target"><ref name="ipv4Addr"/></attribute>
             <optional>
               <attribute name="validate">
                 <choice>
@@ -244,7 +246,7 @@
   <!-- Basic attributes for all interface types -->
   <define name="name-attr">
     <!-- The device name, like eth0 or br2 -->
-    <attribute name="name"><ref name="device-name"/></attribute>
+    <attribute name="name"><ref name="deviceName"/></attribute>
   </define>
 
   <define name="mtu">
@@ -303,14 +305,14 @@
         <ref name="dhcp-element"/>
         <group>
           <element name="ip">
-            <attribute name="address"><ref name="ipv4-addr"/></attribute>
+            <attribute name="address"><ref name="ipv4Addr"/></attribute>
             <optional>
-              <attribute name="prefix"><ref name="ipv4-prefix"/></attribute>
+              <attribute name="prefix"><ref name="ipv4Prefix"/></attribute>
             </optional>
           </element>
           <optional>
             <element name="route">
-              <attribute name="gateway"><ref name="ipv4-addr"/></attribute>
+              <attribute name="gateway"><ref name="ipv4Addr"/></attribute>
             </element>
           </optional>
         </group>
@@ -331,15 +333,15 @@
       </optional>
       <zeroOrMore>
         <element name="ip">
-          <attribute name="address"><ref name="ipv6-addr"/></attribute>
+          <attribute name="address"><ref name="ipv6Addr"/></attribute>
           <optional>
-            <attribute name="prefix"><ref name="ipv6-prefix"/></attribute>
+            <attribute name="prefix"><ref name="ipv6Prefix"/></attribute>
           </optional>
         </element>
       </zeroOrMore>
       <optional>
         <element name="route">
-          <attribute name="gateway"><ref name="ipv6-addr"/></attribute>
+          <attribute name="gateway"><ref name="ipv6Addr"/></attribute>
         </element>
       </optional>
     </element>
@@ -417,55 +419,6 @@
     </data>
   </define>
 
-  <define name='device-name'>
-    <data type='string'>
-      <param name="pattern">[a-zA-Z0-9_\.\-:/]+</param>
-    </data>
-  </define>
-
-  <define name='UUID'>
-    <choice>
-      <data type='string'>
-        <param name="pattern">[a-fA-F0-9]{32}</param>
-      </data>
-      <data type='string'>
-        <param name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param>
-      </data>
-    </choice>
-  </define>
-
-  <define name='mac-addr'>
-    <data type='string'>
-      <param name="pattern">([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}</param>
-    </data>
-  </define>
-
-  <define name='ipv4-addr'>
-    <data type='string'>
-      <param name="pattern">(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))</param>
-    </data>
-  </define>
-
-  <define name='ipv4-prefix'>
-    <data type='unsignedInt'>
-      <param name="maxInclusive">32</param>
-    </data>
-  </define>
-
-  <!-- Based on http://blog.mes-stats.fr/2008/10/09/regex-ipv4-et-ipv6 -->
-  <define name='ipv6-addr'>
-    <data type='string'>
-      <!-- To understand this better, take apart the toplevel '|'s -->
-      <param name="pattern">(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))))|(([0-9A-Fa-f]{1,4}:){0,5}:((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))))|(::([0-9A-Fa-f]{1,4}:){0,5}((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)</param>
-    </data>
-  </define>
-
-  <define name='ipv6-prefix'>
-    <data type='unsignedInt'>
-      <param name="maxInclusive">128</param>
-    </data>
-  </define>
-
   <define name='vlan-id'>
     <data type="unsignedInt">
       <param name="maxInclusive">4096</param>
diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng
index 05f45e5..6d9f06b 100644
--- a/docs/schemas/network.rng
+++ b/docs/schemas/network.rng
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
 <!-- A Relax NG schema for the libvirt network XML format -->
 <grammar xmlns="http://relaxng.org/ns/structure/1.0";
          datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
@@ -5,6 +6,8 @@
     <ref name="network"/>
   </start>
 
+  <include href='basictypes.rng'/>
+
   <define name="network">
 
     <element name="network">
@@ -18,7 +21,7 @@
 
         <!-- <uuid> element -->
         <optional>
-          <element name="uuid"><text/></element>
+          <element name="uuid"><ref name="UUID"/></element>
         </optional>
 
         <!-- <bridge> element -->
@@ -28,7 +31,7 @@
           <element name="bridge">
             <optional>
               <attribute name="name">
-                <text/>
+                <ref name="deviceName"/>
               </attribute>
             </optional>
 
@@ -53,7 +56,7 @@
         <!-- <mac> element -->
         <optional>
           <element name="mac">
-            <attribute name="address"><ref name="mac-addr"/></attribute>
+            <attribute name="address"><ref name="macAddr"/></attribute>
             <empty/>
           </element>
         </optional>
@@ -65,7 +68,7 @@
           <element name="forward">
             <optional>
               <attribute name="dev">
-                <text/>
+                <ref name="deviceName"/>
               </attribute>
             </optional>
 
@@ -83,7 +86,7 @@
         <!-- <domain> element -->
         <optional>
           <element name="domain">
-            <attribute name="name"><text/></attribute>
+            <attribute name="name"><ref name="dnsName"/></attribute>
           </element>
         </optional>
 
@@ -93,15 +96,15 @@
             <element name="dns">
               <zeroOrMore>
                 <element name="txt">
-                  <attribute name="name"><ref name="dns-name"/></attribute>
+                  <attribute name="name"><ref name="dnsName"/></attribute>
                   <attribute name="value"><text/></attribute>
                 </element>
               </zeroOrMore>
               <zeroOrMore>
                 <element name="host">
-                  <attribute name="ip"><ref name="ipv4-addr"/></attribute>
+                  <attribute name="ip"><ref name="ipv4Addr"/></attribute>
                   <oneOrMore>
-                    <element name="hostname"><text/></element>
+                    <element name="hostname"><ref name="dnsName"/></element>
                   </oneOrMore>
                 </element>
               </zeroOrMore>
@@ -114,12 +117,12 @@
                local to the host. -->
           <element name="ip">
             <optional>
-              <attribute name="address"><ref name="ip-addr"/></attribute>
+              <attribute name="address"><ref name="ipAddr"/></attribute>
             </optional>
             <optional>
               <choice>
-                <attribute name="netmask"><ref name="ipv4-addr"/></attribute>
-                <attribute name="prefix"><ref name="ip-prefix"/></attribute>
+                <attribute name="netmask"><ref name="ipv4Addr"/></attribute>
+                <attribute name="prefix"><ref name="ipPrefix"/></attribute>
               </choice>
             </optional>
             <optional>
@@ -136,22 +139,22 @@
               <element name="dhcp">
                 <zeroOrMore>
                   <element name="range">
-                    <attribute name="start"><ref name="ipv4-addr"/></attribute>
-                    <attribute name="end"><ref name="ipv4-addr"/></attribute>
+                    <attribute name="start"><ref name="ipv4Addr"/></attribute>
+                    <attribute name="end"><ref name="ipv4Addr"/></attribute>
                   </element>
                 </zeroOrMore>
                 <zeroOrMore>
                   <element name="host">
-                    <attribute name="mac"><ref name="mac-addr"/></attribute>
+                    <attribute name="mac"><ref name="macAddr"/></attribute>
                     <attribute name="name"><text/></attribute>
-                    <attribute name="ip"><ref name="ipv4-addr"/></attribute>
+                    <attribute name="ip"><ref name="ipv4Addr"/></attribute>
                   </element>
                 </zeroOrMore>
                 <optional>
                   <element name="bootp">
-                    <attribute name="file"><text/></attribute>
+                    <attribute name="file"><ref name="filePath"/></attribute>
                     <optional>
-                      <attribute name="server"><text/></attribute>
+                      <attribute name="server"><ref name="dnsName"/></attribute>
                     </optional>
                   </element>
                 </optional>
@@ -163,52 +166,10 @@
     </element>
   </define>
 
-  <!-- An ipv4 "dotted quad" address -->
-  <define name='ipv4-addr'>
-    <data type='string'>
-      <param name="pattern">(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))</param>
-    </data>
-  </define>
-
-  <!-- Based on http://blog.mes-stats.fr/2008/10/09/regex-ipv4-et-ipv6 -->
-  <define name='ipv6-addr'>
-    <data type='string'>
-      <!-- To understand this better, take apart the toplevel '|'s -->
-      <param name="pattern">(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9])))|(([0-9A-Fa-f]{1,4}:){0,5}:(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9])))|(::([0-9A-Fa-f]{1,4}:){0,5}(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9])))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)</param>
-    </data>
-  </define>
-
-  <define name='ip-addr'>
-    <choice>
-      <ref name='ipv4-addr'/>
-      <ref name='ipv6-addr'/>
-    </choice>
-  </define>
-
-  <define name='ip-prefix'>
-    <data type='unsignedInt'>
-      <param name="maxInclusive">128</param>
-    </data>
-  </define>
-
   <define name='addr-family'>
     <data type='string'>
       <param name="pattern">(ipv4)|(ipv6)</param>
     </data>
   </define>
 
-  <!-- a 6 byte MAC address in ASCII-hex format, eg "12:34:56:78:9A:BC" -->
-  <define name='mac-addr'>
-    <data type='string'>
-      <param name="pattern">([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}</param>
-    </data>
-  </define>
-
-  <!-- a valid DNS name -->
-  <define name='dns-name'>
-    <data type='string'>
-      <param name="pattern">([a-zA-Z\-]+)</param>
-    </data>
-  </define>
-
 </grammar>
diff --git a/libvirt.spec.in b/libvirt.spec.in
index feca5ad..bf220f3 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1065,6 +1065,7 @@ fi
 %{_datadir}/libvirt/schemas/secret.rng
 %{_datadir}/libvirt/schemas/storageencryption.rng
 %{_datadir}/libvirt/schemas/nwfilter.rng
+%{_datadir}/libvirt/schemas/basictypes.rng
 
 %{_datadir}/libvirt/cpu_map.xml
 
-- 
1.7.3.4


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