Now that this function can be called regardless of interface type (and
whether or not we have a conn for the network driver), let's actually
call it for all interface types. This will assure that we re-connect
any disconnected bridge devices for <interface type='bridge'> as
mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=
1730084#c26
(until now we've only been reconnecting bridge devices for <interface
type='network'>)
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_DIRECT)
virNetDevReserveName(net->ifname);
- if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
- if (!conn && !(conn = virGetConnectNetwork()))
- continue;
- virDomainNetNotifyActualDevice(conn, def, net);
- }
+ if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK && !conn)
+ conn = virGetConnectNetwork();
+
+ virDomainNetNotifyActualDevice(conn, def, net);
}
virObjectUnref(conn);
break;
}
- if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
- if (!conn && !(conn = virGetConnectNetwork()))
- continue;
- virDomainNetNotifyActualDevice(conn, def, net);
- }
+ if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK && !conn)
+ conn = virGetConnectNetwork();
+
+ virDomainNetNotifyActualDevice(conn, def, net);
}
virObjectUnref(conn);
break;
}
- if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
- if (!conn && !(conn = virGetConnectNetwork()))
- continue;
- virDomainNetNotifyActualDevice(conn, def, net);
- }
+ if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK && !conn)
+ conn = virGetConnectNetwork();
+
+ virDomainNetNotifyActualDevice(conn, def, net);
}
}