[PATCH v2 6/6] qemu: Allow mixing active internal and external active disk snapshots

ORO@il.ibm.com oro at oro.sl.cloud9.ibm.com
Sun Jan 29 11:15:59 UTC 2023


From: Or Ozeri <oro at il.ibm.com>

Previous commit added support for active RBD disk snapshots,
using the same qmp_transaction used also for external snapshots.
The same transaction can be used to mix internal and external snapshots.
To allow this, this commit simply removes the check that disallows mixing
for active snapshots.
Note that previous commits added validation disallowing deletion
and reverting of RBD disks. The same validation applies to the mixed
type of snapshots introduced by this commit.

Signed-off-by: Or Ozeri <oro at il.ibm.com>
---
 src/qemu/qemu_snapshot.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index c72bdb4723..81b3e94988 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -746,10 +746,9 @@ qemuSnapshotPrepare(virDomainObj *vm,
         return -1;
     }
 
-    /* For now, we don't allow mixing internal and external disks.
-     * XXX technically, we could mix internal and external disks for
+    /* For now, we don't allow mixing internal and external disks for
      * offline snapshots */
-    if ((found_internal && external) ||
+    if ((found_internal && external && !active) ||
          (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && external) ||
          (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL && found_internal)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-- 
2.25.1



More information about the libvir-list mailing list