mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu_migration.c: modernize qemuMigrationSrcConfirmPhase()
Use g_autoptr() and remove both 'error' and 'cleanup' labels. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
e056fdaed5
commit
3734dba02e
@ -2975,10 +2975,9 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
|
|||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
int retcode)
|
int retcode)
|
||||||
{
|
{
|
||||||
qemuMigrationCookiePtr mig;
|
g_autoptr(qemuMigrationCookie) mig = NULL;
|
||||||
virObjectEventPtr event;
|
virObjectEventPtr event;
|
||||||
int rv = -1;
|
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
qemuDomainJobInfoPtr jobInfo = NULL;
|
qemuDomainJobInfoPtr jobInfo = NULL;
|
||||||
|
|
||||||
@ -2997,7 +2996,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
|
|||||||
if (!(mig = qemuMigrationEatCookie(driver, vm->def, priv->origname, priv,
|
if (!(mig = qemuMigrationEatCookie(driver, vm->def, priv->origname, priv,
|
||||||
cookiein, cookieinlen,
|
cookiein, cookieinlen,
|
||||||
QEMU_MIGRATION_COOKIE_STATS)))
|
QEMU_MIGRATION_COOKIE_STATS)))
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (retcode == 0)
|
if (retcode == 0)
|
||||||
jobInfo = priv->job.completed;
|
jobInfo = priv->job.completed;
|
||||||
@ -3026,7 +3025,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & VIR_MIGRATE_OFFLINE)
|
if (flags & VIR_MIGRATE_OFFLINE)
|
||||||
goto done;
|
return 0;
|
||||||
|
|
||||||
/* Did the migration go as planned? If yes, kill off the domain object.
|
/* Did the migration go as planned? If yes, kill off the domain object.
|
||||||
* If something failed, resume CPUs, but only if we didn't use post-copy.
|
* If something failed, resume CPUs, but only if we didn't use post-copy.
|
||||||
@ -3071,13 +3070,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
|
|||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
return 0;
|
||||||
qemuMigrationCookieFree(mig);
|
|
||||||
rv = 0;
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
virObjectUnref(cfg);
|
|
||||||
return rv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user