From: Peter Krempa Date: Mon, 12 Nov 2018 06:46:49 +0000 (+0100) Subject: qemu: driver: Remove block job status reprobing from qemuDomainBlockPivot X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c1a4fb04f966ff23b55f60cfc97e2ff97db3e84a;p=libvirt.git qemu: driver: Remove block job status reprobing from qemuDomainBlockPivot Now that we reprobe the status of blockjobs when reconnecting in addition to handling job status events, the status reprobing can be removed as we always track the correct status internally. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1c8dfbc623..7948131010 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17138,9 +17138,8 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, const char *device, virDomainDiskDefPtr disk) { - int ret = -1, rc; + int ret = -1; qemuDomainObjPrivatePtr priv = vm->privateData; - qemuMonitorBlockJobInfo info; virStorageSourcePtr oldsrc = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); @@ -17151,23 +17150,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, goto cleanup; } - /* Probe the status, if needed. */ - if (!disk->mirrorState) { - qemuDomainObjEnterMonitor(driver, vm); - rc = qemuMonitorGetBlockJobInfo(priv->mon, disk->info.alias, &info); - if (qemuDomainObjExitMonitor(driver, vm) < 0) - goto cleanup; - if (rc < 0) - goto cleanup; - if (rc == 1 && - (info.ready == 1 || - (info.ready == -1 && - info.end == info.cur && - (info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY || - info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT)))) - disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY; - } - if (disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_READY) { virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, _("disk '%s' not ready for pivot yet"),