mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
8afbd34ba9
commit
9a5ac61c4e
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue