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

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

On 03/02/2015 09:40 AM, Peter Krempa wrote:
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.
Even when the command line is not impacted, testing the xml2xml path is a good thing to add :)
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(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Mon, Mar 02, 2015 at 10:37:06 -0700, Eric Blake wrote:
On 03/02/2015 09:40 AM, Peter Krempa wrote:
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.
Even when the command line is not impacted, testing the xml2xml path is a good thing to add :)
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(-)
ACK
Pushed; Thanks. Peter
participants (2)
-
Eric Blake
-
Peter Krempa