mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 03:21:44 +03:00
Avoid squashing errors during network startup cleanup path
When failing to start a virtual network, we have to cleanup, tearing down any iptables rules. If the iptables rules were not present yet though, this raises an error, which squashes the original error we were handling. * src/network/bridge_driver.c: When failing to start a virtual network, don't squash the original error in cleanup
This commit is contained in:
parent
d88a0496fd
commit
d68bb70a2d
@ -1171,6 +1171,7 @@ static int networkStartNetworkDaemon(struct network_driver *driver,
|
||||
virNetworkObjPtr network)
|
||||
{
|
||||
int err;
|
||||
virErrorPtr save_err;
|
||||
|
||||
if (virNetworkObjIsActive(network)) {
|
||||
networkReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
@ -1255,7 +1256,12 @@ static int networkStartNetworkDaemon(struct network_driver *driver,
|
||||
}
|
||||
|
||||
err_delbr2:
|
||||
save_err = virSaveLastError();
|
||||
networkRemoveIptablesRules(driver, network);
|
||||
if (save_err) {
|
||||
virSetError(save_err);
|
||||
virFreeError(save_err);
|
||||
}
|
||||
|
||||
err_delbr1:
|
||||
if ((err = brSetInterfaceUp(driver->brctl, network->def->bridge, 0))) {
|
||||
|
Loading…
Reference in New Issue
Block a user