From d3c6c80c79eba3125eb2af0f187c8018c124c640 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 23 Nov 2020 10:30:31 +0100 Subject: [PATCH] qemuDomainSnapshotForEachQcow2Raw: Lock out operation on unsupported storage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't try to manipulate snapshots on network or unresolved volume backed storage. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_domain.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c8f721b00d..c782810839 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6507,6 +6507,13 @@ qemuDomainSnapshotForEachQcow2Raw(virQEMUDriverPtr driver, if (def->disks[i]->device != VIR_DOMAIN_DISK_DEVICE_DISK) continue; + if (!virStorageSourceIsLocalStorage(def->disks[i]->src)) { + virReportError(VIR_ERR_OPERATION_INVALID, + _("can't manipulate inactive snapshots of disk '%s'"), + def->disks[i]->dst); + return -1; + } + if (format > 0 && format != VIR_STORAGE_FILE_QCOW2) { if (try_all) { /* Continue on even in the face of error, since other