提交 b3e71a88 编写于 作者: J John Ferlan

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: NJohn Ferlan <jferlan@redhat.com>
上级 245f1d85
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册