mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-10-23 23:34:16 +03:00
network: better log message when network is inactive during reconnect
If the network isn't active during networkNotifyActualDevice(), we
would log an error message stating that the bridge device didn't
exist. This patch adds a check to see if the network is active, making
the logs more useful in the case that it isn't.
Partially resolves: https://bugzilla.redhat.com/1442700
(cherry picked from commit 7949de960e)
This commit is contained in:
committed by
Cole Robinson
parent
29b57a2f15
commit
de3d12a4b3
@@ -4682,6 +4682,13 @@ networkNotifyActualDevice(virDomainDefPtr dom,
|
||||
}
|
||||
netdef = network->def;
|
||||
|
||||
if (!virNetworkObjIsActive(network)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("network '%s' is not active"),
|
||||
netdef->name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* if we're restarting libvirtd after an upgrade from a version
|
||||
* that didn't save bridge name in actualNetDef for
|
||||
* actualType==network, we need to copy it in so that it will be
|
||||
|
||||
Reference in New Issue
Block a user