render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
b971b8
From a229c76e2a5008dbdbcad996ae4f75a3d51b709f Mon Sep 17 00:00:00 2001
b971b8
Message-Id: <a229c76e2a5008dbdbcad996ae4f75a3d51b709f@dist-git>
b971b8
From: Peter Krempa <pkrempa@redhat.com>
b971b8
Date: Tue, 12 May 2020 17:24:10 +0200
b971b8
Subject: [PATCH] qemu: snapshot: Allow snapshots of read-only disks when we
b971b8
 can create them
b971b8
MIME-Version: 1.0
b971b8
Content-Type: text/plain; charset=UTF-8
b971b8
Content-Transfer-Encoding: 8bit
b971b8
b971b8
With -blockdev or when reusing externally created images and thus
b971b8
without the need for formatting the image we actually can support
b971b8
snapshots of read-only disks. Arguably it's not very useful so they are
b971b8
not done by default but users of libvirt such as oVirt are actually
b971b8
using this.
b971b8
b971b8
https://bugzilla.redhat.com/show_bug.cgi?id=1832204
b971b8
b971b8
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
b971b8
Reviewed-by: Ján Tomko <jtomko@redhat.com>
b971b8
(cherry picked from commit fe574ea1f52daebddfdc91dd27234059c375e4bf)
b971b8
Message-Id: <2f8f6e53de334a6e3c2d91711fe4dbd81d8b3ee8.1589296861.git.pkrempa@redhat.com>
b971b8
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
b971b8
---
b971b8
 src/qemu/qemu_driver.c | 2 +-
b971b8
 1 file changed, 1 insertion(+), 1 deletion(-)
b971b8
b971b8
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
b971b8
index 26215f8d6a..7ae8641577 100644
b971b8
--- a/src/qemu/qemu_driver.c
b971b8
+++ b/src/qemu/qemu_driver.c
b971b8
@@ -14968,7 +14968,7 @@ qemuDomainSnapshotPrepareDiskExternal(virDomainDiskDefPtr disk,
b971b8
     int err;
b971b8
     int rc;
b971b8
 
b971b8
-    if (disk->src->readonly) {
b971b8
+    if (disk->src->readonly && !(reuse || blockdev)) {
b971b8
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
b971b8
                        _("external snapshot for readonly disk %s "
b971b8
                          "is not supported"), disk->dst);
b971b8
-- 
b971b8
2.26.2
b971b8