[libvirt] [PATCH] Fix bug with loading bridge name for active domain during libvirtd start

If you have a bridge network in running domain and libvirtd is restarted the information about host bridge interface is lost from live xml. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140085 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/conf/domain_conf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3ccec1c..fa4166c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6837,6 +6837,10 @@ virDomainActualNetDefParseXML(xmlNodePtr node, goto error; } VIR_FREE(class_id); + } else if (actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE) { + char *brname = virXPathString("string(./source/@bridge)", ctxt); + if (brname) + actual->data.bridge.brname = brname; } bandwidth_node = virXPathNode("./bandwidth", ctxt); -- 1.8.5.5

On 09/18/14 15:31, Pavel Hrdina wrote:
If you have a bridge network in running domain and libvirtd is restarted the information about host bridge interface is lost from live xml.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140085
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/conf/domain_conf.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3ccec1c..fa4166c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6837,6 +6837,10 @@ virDomainActualNetDefParseXML(xmlNodePtr node, goto error; } VIR_FREE(class_id); + } else if (actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE) { + char *brname = virXPathString("string(./source/@bridge)", ctxt); + if (brname) + actual->data.bridge.brname = brname; }
bandwidth_node = virXPathNode("./bandwidth", ctxt);
Parsers for other network types error out if the requested field is not present. Also the intermediate variable shouldn't be necessary. I'd like to see a version with the error before I ACK it, although the idea is ok. Peter
participants (2)
-
Pavel Hrdina
-
Peter Krempa