This would allow creating new branch in the external snapshot history
which we currently don't support.
The issue with branching the external snapshot history is that deleting
some snapshot would require calling block-stream instead of
block-commit which is currently not implemented.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_snapshot.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 513bcb5a86..95297cfe6a 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -665,6 +665,8 @@ qemuSnapshotPrepare(virDomainObj *vm,
bool found_internal = false;
bool forbid_internal = false;
int external = 0;
+ virDomainMomentObj *curSnap = NULL;
+ virDomainSnapshotDef *curDef = NULL;
for (i = 0; i < def->ndisks; i++) {
virDomainSnapshotDiskDef *disk = &def->disks[i];
@@ -801,6 +803,16 @@ qemuSnapshotPrepare(virDomainObj *vm,
return -1;
}
+ curSnap = virDomainSnapshotGetCurrent(vm->snapshots);
+ if (curSnap)
+ curDef = virDomainSnapshotObjGetDef(curSnap);
+
+ if (curDef && curDef->revertdisks) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("creating external snapshot after reverting to not last
snapshot is not supported"));
+ return -1;
+ }
+
/* Alter flags to let later users know what we learned. */
if (external && !active)
*flags |= VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY;
--
2.39.2