On 12/16/2016 11:24 AM, Peter Krempa wrote:
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.
---
src/qemu/qemu_driver.c | 14 --------------
1 file changed, 14 deletions(-)
Fewer callers to the metadata format probing the better!
ACK -
John
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 30d947b3e..8477ed0dd 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14324,7 +14324,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,
@@ -14409,19 +14408,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));
Irony is the code asked for reporting broken, but then threw it away -
ok sure it got logged somewhere
- }
- 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,