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(a)redhat.com>
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>
Reviewed-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Notes:
Version 2:
- fixed a typo in the commit message
src/qemu/qemu_migration.c | 11 ++++++-----
src/qemu/qemu_migration.h | 3 ++-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 53801a29ef..95b69108dc 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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;
diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
index 1d6051859b..c099cf99cf 100644
--- a/src/qemu/qemu_migration.h
+++ b/src/qemu/qemu_migration.h
@@ -195,7 +195,8 @@ void
qemuMigrationDstComplete(virQEMUDriver *driver,
virDomainObj *vm,
bool inPostCopy,
- virDomainAsyncJob asyncJob);
+ virDomainAsyncJob asyncJob,
+ qemuDomainJobObj *job);
int
qemuMigrationSrcConfirm(virQEMUDriver *driver,
--
2.35.1