提交 eec2f659 编写于 作者: J Jiri Denemark

Recheck disk backing chains after snapshot

When a snapshot operation finishes we have to recheck the backing chain
of all disks involved in the snapshot. And we need to do that even if
the operation failed because some of the disks might have changed if
QEMU did not support transactions.
上级 34cc3b2f
......@@ -12949,6 +12949,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
bool persist = false;
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virErrorPtr orig_err = NULL;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
......@@ -13040,6 +13041,17 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
}
cleanup:
/* recheck backing chains of all disks involved in the snapshot */
orig_err = virSaveLastError();
for (i = 0; i < snap->def->ndisks; i++) {
if (snap->def->disks[i].snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
continue;
qemuDomainDetermineDiskChain(driver, vm, vm->def->disks[i], true);
}
if (orig_err) {
virSetError(orig_err);
virFreeError(orig_err);
}
if (ret == 0 || !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) {
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0 ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册