From: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
Later patches will implement sharing of the backing file, so we'll need
to be able to discriminate the overlays per VM.
Signed-off-by: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_process.c | 2 +-
src/qemu/qemu_snapshot.c | 6 ++++--
src/qemu/qemu_snapshot.h | 3 ++-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 9222f16caa..d743a581b3 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6961,7 +6961,7 @@ qemuProcessSetupDisksTransientSnapshot(virDomainObj *vm,
/* validation code makes sure that we do this only for local disks
* with a file source */
- snapdisk = qemuSnapshotGetTransientDiskDef(domdisk);
+ snapdisk = qemuSnapshotGetTransientDiskDef(domdisk, vm->def->name);
if (qemuSnapshotDiskPrepareOne(snapctxt, domdisk, snapdisk,
blockNamedNodeData,
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 928b7af287..29e86342d6 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1169,7 +1169,8 @@ qemuSnapshotDiskPrepareActiveExternal(virDomainObj *vm,
virDomainSnapshotDiskDef *
-qemuSnapshotGetTransientDiskDef(virDomainDiskDef *domdisk)
+qemuSnapshotGetTransientDiskDef(virDomainDiskDef *domdisk,
+ const char *suffix)
{
g_autoptr(virDomainSnapshotDiskDef) snapdisk = g_new0(virDomainSnapshotDiskDef, 1);
@@ -1178,7 +1179,8 @@ qemuSnapshotGetTransientDiskDef(virDomainDiskDef *domdisk)
snapdisk->src = virStorageSourceNew();
snapdisk->src->type = VIR_STORAGE_TYPE_FILE;
snapdisk->src->format = VIR_STORAGE_FILE_QCOW2;
- snapdisk->src->path = g_strdup_printf("%s.TRANSIENT",
domdisk->src->path);
+ snapdisk->src->path = g_strdup_printf("%s.TRANSIENT-%s",
+ domdisk->src->path, suffix);
if (virFileExists(snapdisk->src->path)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
diff --git a/src/qemu/qemu_snapshot.h b/src/qemu/qemu_snapshot.h
index 4fba7e4e24..ad2bdb1114 100644
--- a/src/qemu/qemu_snapshot.h
+++ b/src/qemu/qemu_snapshot.h
@@ -79,4 +79,5 @@ int
qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapctxt);
virDomainSnapshotDiskDef *
-qemuSnapshotGetTransientDiskDef(virDomainDiskDef *domdisk);
+qemuSnapshotGetTransientDiskDef(virDomainDiskDef *domdisk,
+ const char *suffix);
--
2.31.1