提交 c1a4fb04 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 9ed9124d
......@@ -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"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册