mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
qemuMigrationDstPersist: Avoid multi-line ternary operator in function call
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
a74fceb7d5
commit
b9fab14b81
@ -6393,6 +6393,7 @@ qemuMigrationDstPersist(virQEMUDriver *driver,
|
||||
g_autoptr(virDomainDef) oldDef = NULL;
|
||||
unsigned int oldPersist = vm->persistent;
|
||||
virObjectEvent *event;
|
||||
virDomainEventDefinedDetailType eventDetail = VIR_DOMAIN_EVENT_DEFINED_UPDATED;
|
||||
|
||||
vm->persistent = 1;
|
||||
oldDef = vm->newDef;
|
||||
@ -6402,18 +6403,19 @@ qemuMigrationDstPersist(virQEMUDriver *driver,
|
||||
priv->qemuCaps)))
|
||||
goto error;
|
||||
|
||||
if (!oldPersist && qemuDomainNamePathsCleanup(cfg, vmdef->name, false) < 0)
|
||||
goto error;
|
||||
if (!oldPersist) {
|
||||
eventDetail = VIR_DOMAIN_EVENT_DEFINED_ADDED;
|
||||
|
||||
if (qemuDomainNamePathsCleanup(cfg, vmdef->name, false) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0 &&
|
||||
!ignoreSaveError)
|
||||
goto error;
|
||||
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_DEFINED,
|
||||
oldPersist ?
|
||||
VIR_DOMAIN_EVENT_DEFINED_UPDATED :
|
||||
VIR_DOMAIN_EVENT_DEFINED_ADDED);
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFINED,
|
||||
eventDetail);
|
||||
virObjectEventStateQueue(driver->domainEventState, event);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user