]> xenbits.xensource.com Git - libvirt.git/commitdiff
schema: Let elements in /network/ip be specified in any order
authorJiri Denemark <jdenemar@redhat.com>
Tue, 13 Dec 2016 13:45:21 +0000 (14:45 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 14 Dec 2016 15:20:23 +0000 (16:20 +0100)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
docs/schemas/network.rng
tests/networkxml2confdata/dhcp6-nat-network.xml
tests/networkxml2confdata/netboot-network.xml

index 9d8c803ff5945793b4bffdfe5adb6bcd91028e8b..98611959660c37ab9eb1c673dfb63a196dd39a82 100644 (file)
             <optional>
               <attribute name="family"><ref name="addr-family"/></attribute>
             </optional>
-            <optional>
-              <element name="tftp">
-                <attribute name="root"><text/></attribute>
-              </element>
-            </optional>
-            <optional>
-              <!-- Define the range(s) of IP addresses that the DHCP
-                   server should hand out -->
-              <element name="dhcp">
-                <zeroOrMore>
-                  <element name="range">
-                    <attribute name="start"><ref name="ipAddr"/></attribute>
-                    <attribute name="end"><ref name="ipAddr"/></attribute>
-                  </element>
-                </zeroOrMore>
-                <zeroOrMore>
-                  <element name="host">
-                    <choice>
-                      <group>
+            <interleave>
+              <optional>
+                <element name="tftp">
+                  <attribute name="root"><text/></attribute>
+                </element>
+              </optional>
+              <optional>
+                <!-- Define the range(s) of IP addresses that the DHCP
+                     server should hand out -->
+                <element name="dhcp">
+                  <interleave>
+                    <zeroOrMore>
+                      <element name="range">
+                        <attribute name="start"><ref name="ipAddr"/></attribute>
+                        <attribute name="end"><ref name="ipAddr"/></attribute>
+                      </element>
+                    </zeroOrMore>
+                    <zeroOrMore>
+                      <element name="host">
                         <choice>
-                          <attribute name="mac"><ref name="uniMacAddr"/></attribute>
-                          <attribute name="id"><ref name="DUID"/></attribute>
+                          <group>
+                            <choice>
+                              <attribute name="mac"><ref name="uniMacAddr"/></attribute>
+                              <attribute name="id"><ref name="DUID"/></attribute>
+                            </choice>
+                            <optional>
+                              <attribute name="name"><text/></attribute>
+                            </optional>
+                          </group>
+                          <attribute name="name"><text/></attribute>
                         </choice>
+                        <attribute name="ip"><ref name="ipAddr"/></attribute>
+                      </element>
+                    </zeroOrMore>
+                    <optional>
+                      <element name="bootp">
+                        <attribute name="file"><ref name="filePath"/></attribute>
                         <optional>
-                          <attribute name="name"><text/></attribute>
+                          <attribute name="server"><ref name="dnsName"/></attribute>
                         </optional>
-                      </group>
-                      <attribute name="name"><text/></attribute>
-                    </choice>
-                    <attribute name="ip"><ref name="ipAddr"/></attribute>
-                  </element>
-                </zeroOrMore>
-                <optional>
-                  <element name="bootp">
-                    <attribute name="file"><ref name="filePath"/></attribute>
-                    <optional>
-                      <attribute name="server"><ref name="dnsName"/></attribute>
+                      </element>
                     </optional>
-                  </element>
-                </optional>
-              </element>
-            </optional>
+                  </interleave>
+                </element>
+              </optional>
+            </interleave>
           </element>
         </zeroOrMore>
         <!-- <route> element -->
index a67bde8f39e06ec5529b8fe61e61b2b0e4d9f896..cab0700f2bfa72180a5cba75b5593c290b4d2a0c 100644 (file)
@@ -5,9 +5,9 @@
   <bridge name='virbr0' stp='on' delay='0'/>
   <ip address='192.168.122.1' netmask='255.255.255.0'>
     <dhcp>
-      <range start='192.168.122.2' end='192.168.122.254'/>
       <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/>
       <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/>
+      <range start='192.168.122.2' end='192.168.122.254'/>
     </dhcp>
   </ip>
   <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'>
index 8d5ad31a0092e71afb712877d7c01f12147c8975..ec06c30050a572448a0c6ca397d19f4aaf7e549d 100644 (file)
@@ -5,10 +5,10 @@
   <bridge name='virbr1' stp='off' delay='1'/>
   <domain name='example.com'/>
   <ip address='192.168.122.1' netmask='255.255.255.0'>
-    <tftp root='/var/lib/tftproot'/>
     <dhcp>
       <range start='192.168.122.2' end='192.168.122.254'/>
       <bootp file='pxeboot.img'/>
     </dhcp>
+    <tftp root='/var/lib/tftproot'/>
   </ip>
 </network>