[libvirt] [PATCH RESEND] qemu_driver: unlink new domain cfg file when rollback

Martin Kletzander mkletzan at redhat.com
Mon Oct 31 10:43:55 UTC 2016


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 at 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 at 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 =)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161031/a48de5d1/attachment-0001.sig>


More information about the libvir-list mailing list