From 067aad26befafb446e8a0d5c83d1a4d3b7f704d9 Mon Sep 17 00:00:00 2001 From: Nikolay Shirokovskiy Date: Fri, 9 Nov 2018 10:50:47 +0300 Subject: [PATCH] qemu: disable external snapshot of readonly disk Disable external snapshot of a readonly disk for domains as this operation is not very useful. Such a snapshot is not possible for active domains but the error message from QEMU is more cryptic: error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied This error at least makes the error more understandable for active domains and disallows for inactive domains as well. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: John Ferlan --- src/qemu/qemu_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index acba485309..d0cf2c115a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14755,6 +14755,13 @@ qemuDomainSnapshotPrepareDiskExternal(virDomainDiskDefPtr disk, int ret = -1; struct stat st; + if (disk->src->readonly) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("external snapshot for readonly disk %s " + "is not supported"), disk->dst); + return -1; + } + if (qemuTranslateSnapshotDiskSourcePool(snapdisk) < 0) return -1; -- GitLab