[libvirt] [PATCH 07/10] network: Fix reading 'forwardDelay' attribute.
Cole Robinson
crobinso at redhat.com
Mon Oct 12 14:46:51 UTC 2009
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 at redhat.com>
---
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
More information about the libvir-list
mailing list