[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 14/14] block: remove support for using "file" driver with blo
From: |
Eric Blake |
Subject: |
Re: [PATCH 14/14] block: remove support for using "file" driver with block/char devices |
Date: |
Mon, 15 Mar 2021 07:04:47 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 |
On 2/24/21 7:11 AM, Daniel P. Berrangé wrote:
> The 'host_device' and 'host_cdrom' drivers must be used instead.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> block/file-posix.c | 17 ++++++-----------
> docs/system/deprecated.rst | 7 -------
> docs/system/removed-features.rst | 7 +++++++
> tests/qemu-iotests/226.out | 10 +++++-----
> 4 files changed, 18 insertions(+), 23 deletions(-)
>
> 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)) {
We're testing with S_ISREG()...
> +++ b/docs/system/deprecated.rst
> @@ -21,13 +21,6 @@ deprecated.
> System emulator command line arguments
> --------------------------------------
>
> -``-drive file=json:{...{'driver':'file'}}`` (since 3.0)
> -'''''''''''''''''''''''''''''''''''''''''''''''''''''''
> -
> -The 'file' driver for drives is no longer appropriate for character or host
> -devices and will only accept regular files (S_IFREG). The correct driver
but documented with S_IFREG(). Thankfully, the two have semantically
equivalent purposes, so the difference doesn't invalidate the docs.
Reviewed-by: Eric Blake <eblake@redhat.com>
but I wouldn't mind if at least one other block maintainer chimes in.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org