call virDomainNetNotifyActualDevice() for all interface types

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>
This commit is contained in:
Laine Stump 2021-01-08 00:36:31 -05:00
parent dad50cf855
commit c2b2cdf746
3 changed files with 12 additions and 15 deletions

View File

@ -367,11 +367,10 @@ libxlReconnectNotifyNets(virDomainDefPtr def)
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);

View File

@ -1663,11 +1663,10 @@ virLXCProcessReconnectNotifyNets(virDomainDefPtr def)
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);

View File

@ -3411,11 +3411,10 @@ qemuProcessNotifyNets(virDomainDefPtr def)
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);
}
}