aboutsummaryrefslogtreecommitdiff
path: root/block/file-posix.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2021-02-22 11:16:32 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2021-03-18 09:22:55 +0000
commit8d17adf34f501ded65a106572740760f0a75577c (patch)
tree34e18f45b5cb26145faa6ea53745141b658c3ecc /block/file-posix.c
parente67d8e2928200e24ecb47c7be3ea8270077f2996 (diff)
block: remove support for using "file" driver with block/char devices
The 'host_device' and 'host_cdrom' drivers must be used instead. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'block/file-posix.c')
-rw-r--r--block/file-posix.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/block/file-posix.c b/block/file-posix.c
index 05079b40ca..20e14f8e96 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -719,15 +719,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
}
if (!device) {
- if (S_ISBLK(st.st_mode)) {
- warn_report("Opening a block device as a file using the '%s' "
- "driver is deprecated", bs->drv->format_name);
- } else if (S_ISCHR(st.st_mode)) {
- warn_report("Opening a character device as a file using the '%s' "
- "driver is deprecated", bs->drv->format_name);
- } else if (!S_ISREG(st.st_mode)) {
- error_setg(errp, "A regular file was expected by the '%s' driver, "
- "but something else was given", bs->drv->format_name);
+ if (!S_ISREG(st.st_mode)) {
+ error_setg(errp, "'%s' driver requires '%s' to be a regular file",
+ bs->drv->format_name, bs->filename);
ret = -EINVAL;
goto fail;
} else {
@@ -736,8 +730,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
}
} else {
if (!(S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))) {
- error_setg(errp, "'%s' driver expects either "
- "a character or block device", bs->drv->format_name);
+ error_setg(errp, "'%s' driver requires '%s' to be either "
+ "a character or block device",
+ bs->drv->format_name, bs->filename);
ret = -EINVAL;
goto fail;
}