qemuDomainBlockPivot and qemuDomainBlockJobAbort need the job name for cancelling or pivoting but were generating it locally instead of accessing the existing copy in the job data structure. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_driver.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c80d126276..f790ffdf36 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17119,7 +17119,7 @@ qemuDomainOpenChannel(virDomainPtr dom, static int qemuDomainBlockPivot(virQEMUDriverPtr driver, virDomainObjPtr vm, - const char *device, + qemuBlockJobDataPtr job, virDomainDiskDefPtr disk) { int ret = -1; @@ -17151,7 +17151,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, * overall return value. */ disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT; qemuDomainObjEnterMonitor(driver, vm); - ret = qemuMonitorDrivePivot(priv->mon, device); + ret = qemuMonitorDrivePivot(priv->mon, job->name); if (qemuDomainObjExitMonitor(driver, vm) < 0) { ret = -1; goto cleanup; @@ -17296,7 +17296,6 @@ qemuDomainBlockJobAbort(virDomainPtr dom, unsigned int flags) { virQEMUDriverPtr driver = dom->conn->privateData; - char *device = NULL; virDomainDiskDefPtr disk = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); bool pivot = !!(flags & VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT); @@ -17326,9 +17325,6 @@ qemuDomainBlockJobAbort(virDomainPtr dom, if (!(disk = qemuDomainDiskByName(vm->def, path))) goto endjob; - if (!(device = qemuAliasDiskDriveFromDisk(disk))) - goto endjob; - if (!(job = qemuBlockJobDiskGetJob(disk))) { virReportError(VIR_ERR_INVALID_ARG, _("disk %s does not have an active block job"), disk->dst); @@ -17347,14 +17343,14 @@ qemuDomainBlockJobAbort(virDomainPtr dom, qemuBlockJobSyncBegin(job); if (pivot) { - if ((ret = qemuDomainBlockPivot(driver, vm, device, disk)) < 0) + if ((ret = qemuDomainBlockPivot(driver, vm, job, disk)) < 0) goto endjob; } else { if (disk->mirror) disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_ABORT; qemuDomainObjEnterMonitor(driver, vm); - ret = qemuMonitorBlockJobCancel(qemuDomainGetMonitor(vm), device); + ret = qemuMonitorBlockJobCancel(qemuDomainGetMonitor(vm), job->name); if (qemuDomainObjExitMonitor(driver, vm) < 0) { ret = -1; goto endjob; @@ -17394,7 +17390,6 @@ qemuDomainBlockJobAbort(virDomainPtr dom, cleanup: virObjectUnref(job); virObjectUnref(cfg); - VIR_FREE(device); virDomainObjEndAPI(&vm); return ret; } -- 2.20.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list