In case when the snapshot target is of VIR_STORAGE_TYPE_BLOCK type and
doesn't exist libvirt won't be able to create it. Reject such a config
sooner.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_snapshot.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 81085bf4bd..f06d0ada38 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -589,6 +589,13 @@ qemuSnapshotPrepareDiskExternal(virDomainObj *vm,
_("missing existing file for disk %s:
%s"),
snapdisk->name, snapdisk->src->path);
return -1;
+ } else {
+ if (snapdisk->src->type == VIR_STORAGE_TYPE_BLOCK) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("block device snapshot target '%s'
doesn't exist"),
+ snapdisk->src->path);
+ return -1;
+ }
}
} else {
if (!S_ISBLK(st.st_mode) && st.st_size && !reuse) {
--
2.31.1