qemu: Pass qemuDomainJobObj to qemuMigrationDstComplete

When reconnecting to an active domain we need to use a different job
structure than the one referenced from the VM object.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Jiri Denemark 2022-05-10 15:20:25 +02:00
parent dbfcbe0896
commit cc9f385a1d
2 changed files with 8 additions and 6 deletions

View File

@ -5773,10 +5773,11 @@ void
qemuMigrationDstComplete(virQEMUDriver *driver,
virDomainObj *vm,
bool inPostCopy,
virDomainAsyncJob asyncJob)
virDomainAsyncJob asyncJob,
qemuDomainJobObj *job)
{
qemuDomainObjPrivate *priv = vm->privateData;
qemuDomainJobPrivate *jobPriv = priv->job.privateData;
qemuDomainJobPrivate *jobPriv = job->privateData;
virObjectEvent *event;
if (inPostCopy) {
@ -5817,10 +5818,10 @@ qemuMigrationDstComplete(virQEMUDriver *driver,
* is obsolete anyway.
*/
if (inPostCopy)
g_clear_pointer(&priv->job.completed, virDomainJobDataFree);
g_clear_pointer(&job->completed, virDomainJobDataFree);
qemuMigrationParamsReset(driver, vm, asyncJob, jobPriv->migParams,
priv->job.apiFlags);
job->apiFlags);
virPortAllocatorRelease(priv->migrationPort);
priv->migrationPort = 0;
@ -6052,7 +6053,7 @@ qemuMigrationDstFinishActive(virQEMUDriver *driver,
VIR_WARN("Unable to encode migration cookie");
qemuMigrationDstComplete(driver, vm, inPostCopy,
VIR_ASYNC_JOB_MIGRATION_IN);
VIR_ASYNC_JOB_MIGRATION_IN, &priv->job);
return dom;

View File

@ -195,7 +195,8 @@ void
qemuMigrationDstComplete(virQEMUDriver *driver,
virDomainObj *vm,
bool inPostCopy,
virDomainAsyncJob asyncJob);
virDomainAsyncJob asyncJob,
qemuDomainJobObj *job);
int
qemuMigrationSrcConfirm(virQEMUDriver *driver,