]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix bug with loading bridge name for active domain during libvirtd start
authorPavel Hrdina <phrdina@redhat.com>
Thu, 18 Sep 2014 13:06:44 +0000 (15:06 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 24 Sep 2014 09:34:00 +0000 (11:34 +0200)
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

index 9cc118c02e5fb4495616e737678efe0771b04b83..0a7d0b804bf1f767525cec02f5c8e1f2e9190873 100644 (file)
@@ -6850,6 +6850,15 @@ 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) {
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("Missing <source> element with bridge name in "
+                             "interface's <actual> element"));
+            goto error;
+        }
+        actual->data.bridge.brname = brname;
     }
 
     bandwidth_node = virXPathNode("./bandwidth", ctxt);