mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
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 <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9ed9124d0d
commit
c1a4fb04f9
@ -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"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user