]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: reattach interface taps to correct bridge on restart
authorLaine Stump <laine@redhat.com>
Tue, 17 Sep 2019 00:08:00 +0000 (20:08 -0400)
committerLaine Stump <laine@redhat.com>
Fri, 20 Sep 2019 15:42:25 +0000 (11:42 -0400)
When the bridge re-attach handling was moved out of the network driver
and into the hypervisor driver (commit b806a60e) as a part of the
refactor to split the network driver into a separate daemon, the check
was accidentally changed to only check for type='bridge'. The check for
type in this case needs to check for type='network' as well.

(at the time we thought that the two types could be conflated for
interface actual type, but this turned out to be too problematic to
do).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/domain_conf.c

index 35573c0aaf785c9122486862f116050607f07454..76aaa63f57a9f175dcab5fba15d379cc5014c5b5 100644 (file)
@@ -30942,13 +30942,16 @@ virDomainNetNotifyActualDevice(virConnectPtr conn,
                                virDomainDefPtr dom,
                                virDomainNetDefPtr iface)
 {
+    virDomainNetType actualType = virDomainNetGetActualType(iface);
+
     if (!virUUIDIsValid(iface->data.network.portid)) {
         if (virDomainNetCreatePort(conn, dom, iface,
                                    VIR_NETWORK_PORT_CREATE_RECLAIM) < 0)
             return;
     }
 
-    if (virDomainNetGetActualType(iface) == VIR_DOMAIN_NET_TYPE_BRIDGE) {
+    if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
+        actualType == VIR_DOMAIN_NET_TYPE_BRIDGE) {
         /*
          * NB: we can't notify the guest of any MTU change anyway,
          * so there is no point in trying to learn the actualMTU