mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemuSnapshotPrepareDiskExternal: Reject creation of block devices sooner
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>
This commit is contained in:
parent
a96cc845d7
commit
66adff17a8
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user