If there's a offline config definition save it unconditionally even if
it was not modified.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 40ba50c8c0..40182c84e5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15157,13 +15157,11 @@ qemuDomainSnapshotUpdateDiskSourcesRenumber(virStorageSourcePtr
src)
/**
* qemuDomainSnapshotUpdateDiskSources:
* @dd: snapshot disk data object
- * @persist: set to true if persistent config of the VM was changed
*
* Updates disk definition after a successful snapshot.
*/
static void
-qemuDomainSnapshotUpdateDiskSources(qemuDomainSnapshotDiskDataPtr dd,
- bool *persist)
+qemuDomainSnapshotUpdateDiskSources(qemuDomainSnapshotDiskDataPtr dd)
{
if (!dd->src)
return;
@@ -15185,7 +15183,6 @@ qemuDomainSnapshotUpdateDiskSources(qemuDomainSnapshotDiskDataPtr
dd,
if (dd->persistdisk) {
VIR_STEAL_PTR(dd->persistsrc->backingStore, dd->persistdisk->src);
VIR_STEAL_PTR(dd->persistdisk->src, dd->persistsrc);
- *persist = true;
}
}
@@ -15234,7 +15231,6 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
bool do_transaction = false;
int ret = 0;
size_t i;
- bool persist = false;
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
qemuDomainSnapshotDiskDataPtr diskdata = NULL;
virErrorPtr orig_err = NULL;
@@ -15287,7 +15283,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
virDomainAuditDisk(vm, dd->disk->src, dd->src, "snapshot",
ret >= 0);
if (ret == 0)
- qemuDomainSnapshotUpdateDiskSources(dd, &persist);
+ qemuDomainSnapshotUpdateDiskSources(dd);
}
if (ret < 0)
@@ -15328,8 +15324,8 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
}
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps)
< 0 ||
- (persist && virDomainSaveConfig(cfg->configDir, driver->caps,
- vm->newDef) < 0))
+ (vm->newDef && virDomainSaveConfig(cfg->configDir,
driver->caps,
+ vm->newDef) < 0))
ret = -1;
cleanup:
--
2.21.0