qemu: migration: Access job name from job struct

qemuMigrationSrcNBDCopyCancelOne uses the block job data structure but
generated it's own job name rather than taking it from the block job
data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Peter Krempa 2019-12-06 17:22:53 +01:00
parent 5339f57a0b
commit 37e801340a

View File

@ -649,7 +649,6 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriverPtr driver,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
char *diskAlias = NULL;
int ret = -1; int ret = -1;
int status; int status;
int rv; int rv;
@ -668,13 +667,10 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriverPtr driver,
goto cleanup; goto cleanup;
} }
if (!(diskAlias = qemuAliasDiskDriveFromDisk(disk)))
return -1;
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto cleanup; goto cleanup;
rv = qemuMonitorBlockJobCancel(priv->mon, diskAlias); rv = qemuMonitorBlockJobCancel(priv->mon, job->name);
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0) if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
goto cleanup; goto cleanup;
@ -682,7 +678,6 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriverPtr driver,
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(diskAlias);
return ret; return ret;
} }