From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
"Michael S. Tsirkin" <mst@redhat.com>,
libvir-list@redhat.com,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Gerd Hoffmann" <kraxel@redhat.com>,
qemu-block@nongnu.org, "Juan Quintela" <quintela@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Greg Kurz" <groug@kaod.org>, "Cleber Rosa" <crosa@redhat.com>,
"John Snow" <jsnow@redhat.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Kevin Wolf" <kwolf@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@virtuozzo.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Max Reitz" <mreitz@redhat.com>,
qemu-ppc@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PATCH v2 13/13] block: remove support for using "file" driver with block/char devices
Date: Mon, 15 Mar 2021 17:45:23 +0000 [thread overview]
Message-ID: <20210315174523.979666-14-berrange@redhat.com> (raw)
In-Reply-To: <20210315174523.979666-1-berrange@redhat.com>
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>
---
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(-)
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;
}
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index f6d0b16579..176b837a42 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -30,13 +30,6 @@ would automatically enable USB support on the machine type.
If using the new syntax, USB support must be explicitly
enabled via the ``-machine usb=on`` argument.
-``-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
-for these file types is 'host_cdrom' or 'host_device' as appropriate.
-
``QEMU_AUDIO_`` environment variables and ``-audio-help`` (since 4.0)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index eb4b71750c..7b7bf7214e 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -50,6 +50,13 @@ by the ``tls-authz`` and ``sasl-authz`` options.
The ``pretty=on|off`` switch has no effect for HMP monitors and
its use is rejected.
+``-drive file=json:{...{'driver':'file'}}`` (removed 6.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
+for these file types is 'host_cdrom' or 'host_device' as appropriate.
+
QEMU Machine Protocol (QMP) commands
------------------------------------
diff --git a/tests/qemu-iotests/226.out b/tests/qemu-iotests/226.out
index 42be973ff2..55504d29c4 100644
--- a/tests/qemu-iotests/226.out
+++ b/tests/qemu-iotests/226.out
@@ -3,23 +3,23 @@ QA output created by 226
=== Testing with driver:file ===
== Testing RO ==
-qemu-io: can't open: A regular file was expected by the 'file' driver, but something else was given
-qemu-io: warning: Opening a character device as a file using the 'file' driver is deprecated
+qemu-io: can't open: 'file' driver requires 'TEST_DIR/t.IMGFMT' to be a regular file
+qemu-io: can't open: 'file' driver requires '/dev/null' to be a regular file
== Testing RW ==
qemu-io: can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory
-qemu-io: warning: Opening a character device as a file using the 'file' driver is deprecated
+qemu-io: can't open: 'file' driver requires '/dev/null' to be a regular file
=== Testing with driver:host_device ===
== Testing RO ==
-qemu-io: can't open: 'host_device' driver expects either a character or block device
+qemu-io: can't open: 'host_device' driver requires 'TEST_DIR/t.IMGFMT' to be either a character or block device
== Testing RW ==
qemu-io: can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory
=== Testing with driver:host_cdrom ===
== Testing RO ==
-qemu-io: can't open: 'host_cdrom' driver expects either a character or block device
+qemu-io: can't open: 'host_cdrom' driver requires 'TEST_DIR/t.IMGFMT' to be either a character or block device
== Testing RW ==
qemu-io: can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory
--
2.30.2
prev parent reply other threads:[~2021-03-15 18:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 17:45 [PATCH v2 00/13] deprecations: remove many old deprecations Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 01/13] ui, monitor: remove deprecated VNC ACL option and HMP commands Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 02/13] monitor: raise error when 'pretty' option is used with HMP Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 03/13] monitor: remove 'query-events' QMP command Daniel P. Berrangé
2021-03-15 18:34 ` Eric Blake
2021-03-15 17:45 ` [PATCH v2 04/13] migrate: remove QMP/HMP commands for speed, downtime and cache size Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 05/13] machine: remove 'query-cpus' QMP command Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 06/13] machine: remove 'arch' field from 'query-cpus-fast' " Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 07/13] chardev: reject use of 'wait' flag for socket client chardevs Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 08/13] hw/ide: remove 'ide-drive' device Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 09/13] hw/scsi: remove 'scsi-disk' device Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 10/13] block: remove 'encryption_key_missing' flag from QAPI Daniel P. Berrangé
2021-03-15 18:36 ` Eric Blake
2021-03-15 17:45 ` [PATCH v2 11/13] block: remove dirty bitmaps 'status' field Daniel P. Berrangé
2021-03-15 17:45 ` [PATCH v2 12/13] block: remove 'dirty-bitmaps' field from 'BlockInfo' struct Daniel P. Berrangé
2021-03-15 17:45 ` Daniel P. Berrangé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210315174523.979666-14-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=atar4qemu@gmail.com \
--cc=crosa@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=fam@euphon.net \
--cc=groug@kaod.org \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=libvir-list@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=quintela@redhat.com \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=vsementsov@virtuozzo.com \
--cc=wainersm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.