diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 4a53cf9545..09202a382f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6960,7 +6960,7 @@ qemuProcessSetupDisksTransientSnapshot(virDomainObj *vm, /* validation code makes sure that we do this only for local disks * with a file source */ - if (!(snapdisk = qemuSnapshotGetTransientDiskDef(domdisk))) + if (!(snapdisk = qemuSnapshotGetTransientDiskDef(domdisk, vm->def->name))) return -1; if (qemuSnapshotDiskPrepareOne(snapctxt, domdisk, snapdisk, 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);