On Fri, Oct 28, 2016 at 04:29:30AM -0700, Michal Privoznik wrote:
On 27.10.2016 17:45, Chen Hanxiao wrote:
> From: Chen Hanxiao <chenhanxiao(a)gmail.com>
>
> If we failed to unlink old dom cfg file, we goto rollback.
> But inside rollback, we fogot to unlink the new dom cfg file.
> This patch fixes this issue.
>
> Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
> ---
> src/qemu/qemu_driver.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index e6f845d..3f4a2fb 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -19882,6 +19883,11 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
> goto cleanup;
> }
>
> + if (!(new_dom_cfg_file = virDomainConfigFile(cfg->configDir,
> + new_dom_name))) {
> + goto cleanup;
> + }
> +
Whoa, I'm really surprised that our syntax-check does not catch this. It
has a one line body therefore there shouldn't be any curly braces around
it. Also, this could be joined with previous condition.
Actually! =D We have that so "precisely defined" that in this precise
case, it "is optional (not enforced either way)" -- Just to note how
specific we can be =)