]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: snapshot: Allow snapshots of read-only disks when we can create them
authorPeter Krempa <pkrempa@redhat.com>
Wed, 6 May 2020 15:41:12 +0000 (17:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 May 2020 04:56:09 +0000 (06:56 +0200)
With -blockdev or when reusing externally created images and thus
without the need for formatting the image we actually can support
snapshots of read-only disks. Arguably it's not very useful so they are
not done by default but users of libvirt such as oVirt are actually
using this.

https://bugzilla.redhat.com/show_bug.cgi?id=1832204

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c

index 63b4a49c3c6ea32030500b253fd04c994d577670..a98a2986f56a7ab133b2660648904aa3c0f0ca44 100644 (file)
@@ -14687,7 +14687,7 @@ qemuDomainSnapshotPrepareDiskExternal(virDomainObjPtr vm,
     int err;
     int rc;
 
-    if (disk->src->readonly) {
+    if (disk->src->readonly && !(reuse || blockdev)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("external snapshot for readonly disk %s "
                          "is not supported"), disk->dst);