[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 019/100] blockdev: Print a warning for legacy drive o
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 019/100] blockdev: Print a warning for legacy drive options that belong to -device |
Date: |
Fri, 7 Jul 2017 19:07:34 +0200 |
From: Thomas Huth <address@hidden>
We likely do not want to carry these legacy -drive options along forever.
Let's emit a deprecation warning for the -drive options that have a
replacement with the -device option, so that the (hopefully few) remaining
users are aware of this and can adapt their scripts / behaviour accordingly.
Signed-off-by: Thomas Huth <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
blockdev.c | 14 ++++++++++++++
qemu-options.hx | 9 +++++++--
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index f92dcf2..e2016b6 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -50,6 +50,7 @@
#include "qmp-commands.h"
#include "block/trace.h"
#include "sysemu/arch_init.h"
+#include "sysemu/qtest.h"
#include "qemu/cutils.h"
#include "qemu/help_option.h"
#include "qemu/throttle-options.h"
@@ -798,6 +799,9 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType
block_default_type)
const char *filename;
Error *local_err = NULL;
int i;
+ const char *deprecated[] = {
+ "serial", "trans", "secs", "heads", "cyls", "addr"
+ };
/* Change legacy command line options into QMP ones */
static const struct {
@@ -881,6 +885,16 @@ DriveInfo *drive_new(QemuOpts *all_opts,
BlockInterfaceType block_default_type)
"update your scripts.\n");
}
+ /* Other deprecated options */
+ if (!qtest_enabled()) {
+ for (i = 0; i < ARRAY_SIZE(deprecated); i++) {
+ if (qemu_opt_get(legacy_opts, deprecated[i]) != NULL) {
+ error_report("'%s' is deprecated, please use the corresponding
"
+ "option of '-device' instead", deprecated[i]);
+ }
+ }
+ }
+
/* Media type */
value = qemu_opt_get(legacy_opts, "media");
if (value) {
diff --git a/qemu-options.hx b/qemu-options.hx
index 297bd8a..ddab656 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -818,6 +818,8 @@ of available connectors of a given interface type.
This option defines the type of the media: disk or cdrom.
@item address@hidden,address@hidden,address@hidden,address@hidden
These options have the same definition as they have in @option{-hdachs}.
+These parameters are deprecated, use the corresponding parameters
+of @code{-device} instead.
@item address@hidden
@var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
(see @option{-snapshot}).
@@ -852,9 +854,12 @@ Specify which disk @var{format} will be used rather than
detecting
the format. Can be used to specify format=raw to avoid interpreting
an untrusted format header.
@item address@hidden
-This option specifies the serial number to assign to the device.
+This option specifies the serial number to assign to the device. This
+parameter is deprecated, use the corresponding parameter of @code{-device}
+instead.
@item address@hidden
-Specify the controller's PCI address (if=virtio only).
+Specify the controller's PCI address (if=virtio only). This parameter is
+deprecated, use the corresponding parameter of @code{-device} instead.
@item address@hidden,address@hidden
Specify which @var{action} to take on write and read errors. Valid actions are:
"ignore" (ignore the error and try to continue), "stop" (pause QEMU),
--
1.8.3.1
- [Qemu-block] [PULL 012/100] vvfat: correctly create long names for non-ASCII filenames, (continued)
- [Qemu-block] [PULL 012/100] vvfat: correctly create long names for non-ASCII filenames, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 009/100] vvfat: introduce offset_to_bootsector, offset_to_fat and offset_to_root_dir, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 013/100] vvfat: correctly create base short names for non-ASCII filenames, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 014/100] vvfat: correctly generate numeric-tail of short file names, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 015/100] vvfat: limit number of entries in root directory in FAT12/FAT16, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 016/100] vvfat: handle KANJI lead byte 0xe5, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 006/100] vvfat: replace tabs by 8 spaces, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 018/100] qemu-img: drop -e and -6 options from the 'create' & 'convert' commands, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 020/100] blockjob: Track job ratelimits via bytes, not sectors, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 017/100] vvfat: change OEM name to 'MSWIN4.1', Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 019/100] blockdev: Print a warning for legacy drive options that belong to -device,
Kevin Wolf <=
- [Qemu-block] [PULL 022/100] stream: Switch stream_populate() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 021/100] trace: Show blockjob actions via bytes, not sectors, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 023/100] stream: Drop reached_end for stream_complete(), Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 024/100] stream: Switch stream_run() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 025/100] commit: Switch commit_populate() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 028/100] mirror: Switch mirror_do_zero_or_discard() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 026/100] commit: Switch commit_run() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 029/100] mirror: Update signature of mirror_clip_sectors(), Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 027/100] mirror: Switch MirrorBlockJob to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 030/100] mirror: Switch mirror_cow_align() to byte-based, Kevin Wolf, 2017/07/07