mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
network: Don't remove transient network if creating of config file fails
On the off-chance that creation of persistent configuration file would fail when defining a network that is already started as transient, the code would remove the transient data structure and thus the network. This patch changes the code so that in such case, the network is again marked as transient and left behind.
This commit is contained in:
parent
811143c0b6
commit
8e91890015
@ -3160,8 +3160,14 @@ static virNetworkPtr networkDefineXML(virConnectPtr conn, const char *xml) {
|
||||
freeDef = false;
|
||||
|
||||
if (virNetworkSaveConfig(driver->networkConfigDir, def) < 0) {
|
||||
virNetworkRemoveInactive(&driver->networks, network);
|
||||
network = NULL;
|
||||
if (!virNetworkObjIsActive(network)) {
|
||||
virNetworkRemoveInactive(&driver->networks, network);
|
||||
network = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
network->persistent = 0;
|
||||
virNetworkDefFree(network->newDef);
|
||||
network->newDef = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user