qemu: rename: send events only on success

We can simplify cleanup section by moving sending events to success path only
because only on sucess path events are not NULL.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Nikolay Shirokovskiy 2020-11-03 10:53:57 +03:00
parent 8afbd34ba9
commit 9a5ac61c4e
1 changed files with 2 additions and 2 deletions

View File

@ -19179,11 +19179,11 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
event_new = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_DEFINED,
VIR_DOMAIN_EVENT_DEFINED_RENAMED);
virObjectEventStateQueue(driver->domainEventState, event_old);
virObjectEventStateQueue(driver->domainEventState, event_new);
ret = 0;
cleanup:
virObjectEventStateQueue(driver->domainEventState, event_old);
virObjectEventStateQueue(driver->domainEventState, event_new);
return ret;
rollback: