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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
_("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) {