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);
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"),