[libvirt] [PATCH 07/10] network: Fix reading 'forwardDelay' attribute.

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

 



When reading network XML, we were looking for a 'delay' attribute, but this
value was being dumped as 'forwardDelay'. Support reading both names on
input, but continue to only dump 'forwardDelay'

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 src/conf/network_conf.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 14eb543..220f313 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -398,8 +398,14 @@ virNetworkDefParseXML(virConnectPtr conn,
     def->stp = (tmp && STREQ(tmp, "off")) ? 0 : 1;
     VIR_FREE(tmp);
 
-    if (virXPathULong(conn, "string(./bridge[1]/@delay)", ctxt, &def->delay) < 0)
-        def->delay = 0;
+    if (virXPathULong(conn, "string(./bridge[1]/@forwardDelay)",
+                      ctxt, &def->delay) < 0) {
+        /* We erroneously checked 'delay' before, so check it for back
+         * compat */
+        if (virXPathULong(conn, "string(./bridge[1]/@delay)",
+                          ctxt, &def->delay) < 0)
+            def->delay = 0;
+    }
 
     def->ipAddress = virXPathString(conn, "string(./ip[1]/@address)", ctxt);
     def->netmask = virXPathString(conn, "string(./ip[1]/@netmask)", ctxt);
-- 
1.6.5.rc2

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]