[libvirt] [PATCH] schema: Fix interface link state schema

Peter Krempa pkrempa at redhat.com
Mon Mar 2 16:40:44 UTC 2015


In commit edd1295e1da6bfe8e4e257e5fbfad71ac0bf7c87 I've introduced an
XML element that allows to configure state of the network interface
link. Somehow the RNG schema hunk ended up in a weird place in the
network schema definition. Move it to the right place and add a test
case.

Note that the link state is set up via the monitor at VM startup so I
originally didn't think of adding a test case.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1173468
---
 docs/schemas/domaincommon.rng                            | 12 ++++++++++++
 docs/schemas/network.rng                                 | 11 -----------
 tests/qemuxml2argvdata/qemuxml2argv-interface-driver.xml |  1 +
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 4e4fe9f..6c45b1c 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2314,10 +2314,22 @@
         - the name of the script used to set up the binding
         - the target device used
         - boot order
+        - link state
     -->
   <define name="interface-options">
     <interleave>
       <optional>
+        <element name="link">
+          <attribute name="state">
+            <choice>
+              <value>up</value>
+              <value>down</value>
+            </choice>
+          </attribute>
+          <empty/>
+        </element>
+      </optional>
+      <optional>
         <element name="target">
           <attribute name="dev">
             <ref name="deviceName"/>
diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng
index 56b6086..4edb6eb 100644
--- a/docs/schemas/network.rng
+++ b/docs/schemas/network.rng
@@ -299,17 +299,6 @@
         <optional>
          <ref name="vlan"/>
         </optional>
-        <optional>
-          <element name="link">
-            <attribute name="state">
-              <choice>
-                <value>up</value>
-                <value>down</value>
-              </choice>
-            </attribute>
-            <empty/>
-          </element>
-        </optional>

         <!-- <ip> element -->
         <zeroOrMore>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-interface-driver.xml b/tests/qemuxml2argvdata/qemuxml2argv-interface-driver.xml
index ec5ab61..d907b9b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-interface-driver.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-interface-driver.xml
@@ -39,6 +39,7 @@
       <mac address='52:54:00:e5:48:58'/>
       <model type='virtio'/>
       <driver ioeventfd='on' event_idx='on' queues='5'/>
+      <link state='up'/>
     </interface>
     <serial type='pty'>
       <target port='0'/>
-- 
2.2.2




More information about the libvir-list mailing list