1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-26 03:21:44 +03:00

qemu: snapshot: Don't redetect backing chain after snapshot

Libvirt is able to properly model what happens to the backing chain
after a snapshot so there's no real need to redetect the data.
Additionally with the _REUSE_EXT flag this might end up in redetecting
wrong data if the user puts wrong backing chain reference into the
snapshot image.
This commit is contained in:
Peter Krempa 2016-12-16 07:10:46 +01:00
parent a05e2570c9
commit 7456c4f5f0

View File

@ -14359,7 +14359,6 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
bool persist = false;
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
virQEMUDriverConfigPtr cfg = NULL;
virErrorPtr orig_err = NULL;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
@ -14444,19 +14443,6 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
}
}
/* 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;
ignore_value(qemuDomainDetermineDiskChain(driver, vm, vm->def->disks[i],
true, 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, driver->caps) < 0 ||
(persist && virDomainSaveConfig(cfg->configDir, driver->caps,