mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 23:55:23 +00: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:
parent
a05e2570c9
commit
7456c4f5f0
@ -14359,7 +14359,6 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
|
|||||||
bool persist = false;
|
bool persist = false;
|
||||||
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
|
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
|
||||||
virQEMUDriverConfigPtr cfg = NULL;
|
virQEMUDriverConfigPtr cfg = NULL;
|
||||||
virErrorPtr orig_err = NULL;
|
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
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 (ret == 0 || !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) {
|
||||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0 ||
|
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0 ||
|
||||||
(persist && virDomainSaveConfig(cfg->configDir, driver->caps,
|
(persist && virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||||
|
Loading…
Reference in New Issue
Block a user