mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-24 04:12:20 +00:00
nwfilter: Move save of config until after successful assign
Only save the config when using a generated UUID if we were able to create an object for the def. There could have been "other reasons" for the assignment to fail, so saving the config could be incorrect. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
245f1d8521
commit
b3e71a8830
@ -500,14 +500,14 @@ virNWFilterObjListLoadConfig(virNWFilterObjListPtr nwfilters,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!(obj = virNWFilterObjListAssignDef(nwfilters, def)))
|
||||
goto error;
|
||||
|
||||
/* We generated a UUID, make it permanent by saving the config to disk */
|
||||
if (!def->uuid_specified &&
|
||||
virNWFilterSaveConfig(configDir, def) < 0)
|
||||
goto error;
|
||||
|
||||
if (!(obj = virNWFilterObjListAssignDef(nwfilters, def)))
|
||||
goto error;
|
||||
|
||||
VIR_FREE(configFile);
|
||||
return obj;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user