We don't have an async job when reconnecting to existing domains after
libvirtd restart.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Notes:
Version 2:
- no changes
src/qemu/qemu_migration.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 61b3e34..fedadd7 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1837,7 +1837,8 @@ static int
qemuMigrationCancelOneDriveMirror(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk,
- bool failNoJob)
+ bool failNoJob,
+ qemuDomainAsyncJob asyncJob)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
char *diskAlias = NULL;
@@ -1865,8 +1866,7 @@ qemuMigrationCancelOneDriveMirror(virQEMUDriverPtr driver,
QEMU_DRIVE_HOST_PREFIX, disk->info.alias) < 0)
return -1;
- if (qemuDomainObjEnterMonitorAsync(driver, vm,
- QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto cleanup;
rv = qemuMonitorBlockJobCancel(priv->mon, diskAlias, true);
@@ -1897,7 +1897,8 @@ qemuMigrationCancelOneDriveMirror(virQEMUDriverPtr driver,
static int
qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- bool check)
+ bool check,
+ qemuDomainAsyncJob asyncJob)
{
virErrorPtr err = NULL;
int ret = -1;
@@ -1915,7 +1916,8 @@ qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver,
if (!diskPriv->migrating)
continue;
- rv = qemuMigrationCancelOneDriveMirror(driver, vm, disk, check);
+ rv = qemuMigrationCancelOneDriveMirror(driver, vm, disk,
+ check, asyncJob);
if (rv != 0) {
if (rv < 0) {
if (!err)
@@ -3594,7 +3596,8 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
virErrorPtr orig_err = virSaveLastError();
/* cancel any outstanding NBD jobs */
- qemuMigrationCancelDriveMirror(driver, vm, false);
+ qemuMigrationCancelDriveMirror(driver, vm, false,
+ QEMU_ASYNC_JOB_MIGRATION_OUT);
virSetError(orig_err);
virFreeError(orig_err);
@@ -4165,7 +4168,8 @@ qemuMigrationRun(virQEMUDriverPtr driver,
/* cancel any outstanding NBD jobs */
if (mig && mig->nbd) {
- if (qemuMigrationCancelDriveMirror(driver, vm, ret == 0) < 0)
+ if (qemuMigrationCancelDriveMirror(driver, vm, ret == 0,
+ QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
ret = -1;
}
--
2.4.1