* [PATCH] util: remove support -chardev tty and -chardev parport
@ 2022-12-18 0:06 Paolo Bonzini
2022-12-18 6:05 ` Marc-André Lureau
2022-12-18 13:45 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-12-18 0:06 UTC (permalink / raw)
To: qemu-devel
These were deprecated in 6.0 and can now be removed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
chardev/char.c | 33 ++-------------------------------
docs/about/deprecated.rst | 6 ------
docs/about/removed-features.rst | 5 +++++
docs/qdev-device-use.txt | 4 ++--
qemu-options.hx | 11 +----------
5 files changed, 10 insertions(+), 49 deletions(-)
diff --git a/chardev/char.c b/chardev/char.c
index 4c5de164025d..87ab6efbcca0 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -530,19 +530,6 @@ static const ChardevClass *char_get_class(const char *driver, Error **errp)
return cc;
}
-static struct ChardevAlias {
- const char *typename;
- const char *alias;
- bool deprecation_warning_printed;
-} chardev_alias_table[] = {
-#ifdef HAVE_CHARDEV_PARPORT
- { "parallel", "parport" },
-#endif
-#ifdef HAVE_CHARDEV_SERIAL
- { "serial", "tty" },
-#endif
-};
-
typedef struct ChadevClassFE {
void (*fn)(const char *name, void *opaque);
void *opaque;
@@ -578,28 +565,12 @@ help_string_append(const char *name, void *opaque)
g_string_append_printf(str, "\n %s", name);
}
-static const char *chardev_alias_translate(const char *name)
-{
- int i;
- for (i = 0; i < (int)ARRAY_SIZE(chardev_alias_table); i++) {
- if (g_strcmp0(chardev_alias_table[i].alias, name) == 0) {
- if (!chardev_alias_table[i].deprecation_warning_printed) {
- warn_report("The alias '%s' is deprecated, use '%s' instead",
- name, chardev_alias_table[i].typename);
- chardev_alias_table[i].deprecation_warning_printed = true;
- }
- return chardev_alias_table[i].typename;
- }
- }
- return name;
-}
-
ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts, Error **errp)
{
Error *local_err = NULL;
const ChardevClass *cc;
ChardevBackend *backend = NULL;
- const char *name = chardev_alias_translate(qemu_opt_get(opts, "backend"));
+ const char *name = qemu_opt_get(opts, "backend");
if (name == NULL) {
error_setg(errp, "chardev: \"%s\" missing backend",
@@ -637,7 +608,7 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts, GMainContext *context,
const ChardevClass *cc;
Chardev *chr = NULL;
ChardevBackend *backend = NULL;
- const char *name = chardev_alias_translate(qemu_opt_get(opts, "backend"));
+ const char *name = qemu_opt_get(opts, "backend");
const char *id = qemu_opts_id(opts);
char *bid = NULL;
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index f3cb309cb8e1..e5d7d29f7f02 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -39,12 +39,6 @@ should specify an ``audiodev=`` property. Additionally, when using
vnc, you should specify an ``audiodev=`` property if you plan to
transmit audio through the VNC protocol.
-``-chardev`` backend aliases ``tty`` and ``parport`` (since 6.0)
-''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-``tty`` and ``parport`` are aliases that will be removed. Instead, the
-actual backend names ``serial`` and ``parallel`` should be used.
-
Short-form boolean options (since 6.0)
''''''''''''''''''''''''''''''''''''''
diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst
index 68ac80d37a40..f2a5785d3176 100644
--- a/docs/about/removed-features.rst
+++ b/docs/about/removed-features.rst
@@ -416,6 +416,11 @@ Input parameters that take a size value should only use a size suffix
the value is hexadecimal. That is, '0x20M' should be written either as
'32M' or as '0x2000000'.
+``-chardev`` backend aliases ``tty`` and ``parport`` (removed in 8.0)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+``tty`` and ``parport`` used to be aliases for ``serial`` and ``parallel``
+respectively. The actual backend names should be used instead.
QEMU Machine Protocol (QMP) commands
------------------------------------
diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt
index 240888933482..c98c86d82802 100644
--- a/docs/qdev-device-use.txt
+++ b/docs/qdev-device-use.txt
@@ -216,11 +216,11 @@ LEGACY-CHARDEV translates to -chardev HOST-OPTS... as follows:
* unix:FNAME becomes -chardev socket,path=FNAME
-* /dev/parportN becomes -chardev parport,file=/dev/parportN
+* /dev/parportN becomes -chardev parallel,file=/dev/parportN
* /dev/ppiN likewise
-* Any other /dev/FNAME becomes -chardev tty,path=/dev/FNAME
+* Any other /dev/FNAME becomes -chardev serial,path=/dev/FNAME
* mon:LEGACY-CHARDEV is special: it multiplexes the monitor onto the
character device defined by LEGACY-CHARDEV. -chardev provides more
diff --git a/qemu-options.hx b/qemu-options.hx
index 7f99d15b231f..f3d5e1313ca1 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3379,11 +3379,9 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
|| defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
"-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
- "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
#endif
#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
"-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
- "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
#endif
#if defined(CONFIG_SPICE)
"-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
@@ -3398,7 +3396,7 @@ The general form of a character device option is:
``-chardev backend,id=id[,mux=on|off][,options]``
Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``,
``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``,
- ``pty``, ``stdio``, ``braille``, ``tty``, ``parallel``, ``parport``,
+ ``pty``, ``stdio``, ``braille``, ``parallel``,
``spicevmc``, ``spiceport``. The specific backend will determine the
applicable options.
@@ -3622,15 +3620,8 @@ The available backends are:
Connect to a local BrlAPI server. ``braille`` does not take any
options.
-``-chardev tty,id=id,path=path``
- ``tty`` is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD
- and DragonFlyBSD hosts. It is an alias for ``serial``.
-
- ``path`` specifies the path to the tty. ``path`` is required.
-
``-chardev parallel,id=id,path=path``
\
-``-chardev parport,id=id,path=path``
``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD
hosts.
--
2.38.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] util: remove support -chardev tty and -chardev parport
2022-12-18 0:06 [PATCH] util: remove support -chardev tty and -chardev parport Paolo Bonzini
@ 2022-12-18 6:05 ` Marc-André Lureau
2022-12-18 13:45 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Marc-André Lureau @ 2022-12-18 6:05 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Sun, Dec 18, 2022 at 4:08 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> These were deprecated in 6.0 and can now be removed.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> chardev/char.c | 33 ++-------------------------------
> docs/about/deprecated.rst | 6 ------
> docs/about/removed-features.rst | 5 +++++
> docs/qdev-device-use.txt | 4 ++--
> qemu-options.hx | 11 +----------
> 5 files changed, 10 insertions(+), 49 deletions(-)
>
> diff --git a/chardev/char.c b/chardev/char.c
> index 4c5de164025d..87ab6efbcca0 100644
> --- a/chardev/char.c
> +++ b/chardev/char.c
> @@ -530,19 +530,6 @@ static const ChardevClass *char_get_class(const char *driver, Error **errp)
> return cc;
> }
>
> -static struct ChardevAlias {
> - const char *typename;
> - const char *alias;
> - bool deprecation_warning_printed;
> -} chardev_alias_table[] = {
> -#ifdef HAVE_CHARDEV_PARPORT
> - { "parallel", "parport" },
> -#endif
> -#ifdef HAVE_CHARDEV_SERIAL
> - { "serial", "tty" },
> -#endif
> -};
> -
> typedef struct ChadevClassFE {
> void (*fn)(const char *name, void *opaque);
> void *opaque;
> @@ -578,28 +565,12 @@ help_string_append(const char *name, void *opaque)
> g_string_append_printf(str, "\n %s", name);
> }
>
> -static const char *chardev_alias_translate(const char *name)
> -{
> - int i;
> - for (i = 0; i < (int)ARRAY_SIZE(chardev_alias_table); i++) {
> - if (g_strcmp0(chardev_alias_table[i].alias, name) == 0) {
> - if (!chardev_alias_table[i].deprecation_warning_printed) {
> - warn_report("The alias '%s' is deprecated, use '%s' instead",
> - name, chardev_alias_table[i].typename);
> - chardev_alias_table[i].deprecation_warning_printed = true;
> - }
> - return chardev_alias_table[i].typename;
> - }
> - }
> - return name;
> -}
> -
> ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts, Error **errp)
> {
> Error *local_err = NULL;
> const ChardevClass *cc;
> ChardevBackend *backend = NULL;
> - const char *name = chardev_alias_translate(qemu_opt_get(opts, "backend"));
> + const char *name = qemu_opt_get(opts, "backend");
>
> if (name == NULL) {
> error_setg(errp, "chardev: \"%s\" missing backend",
> @@ -637,7 +608,7 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts, GMainContext *context,
> const ChardevClass *cc;
> Chardev *chr = NULL;
> ChardevBackend *backend = NULL;
> - const char *name = chardev_alias_translate(qemu_opt_get(opts, "backend"));
> + const char *name = qemu_opt_get(opts, "backend");
> const char *id = qemu_opts_id(opts);
> char *bid = NULL;
>
> diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
> index f3cb309cb8e1..e5d7d29f7f02 100644
> --- a/docs/about/deprecated.rst
> +++ b/docs/about/deprecated.rst
> @@ -39,12 +39,6 @@ should specify an ``audiodev=`` property. Additionally, when using
> vnc, you should specify an ``audiodev=`` property if you plan to
> transmit audio through the VNC protocol.
>
> -``-chardev`` backend aliases ``tty`` and ``parport`` (since 6.0)
> -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> -
> -``tty`` and ``parport`` are aliases that will be removed. Instead, the
> -actual backend names ``serial`` and ``parallel`` should be used.
> -
> Short-form boolean options (since 6.0)
> ''''''''''''''''''''''''''''''''''''''
>
> diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst
> index 68ac80d37a40..f2a5785d3176 100644
> --- a/docs/about/removed-features.rst
> +++ b/docs/about/removed-features.rst
> @@ -416,6 +416,11 @@ Input parameters that take a size value should only use a size suffix
> the value is hexadecimal. That is, '0x20M' should be written either as
> '32M' or as '0x2000000'.
>
> +``-chardev`` backend aliases ``tty`` and ``parport`` (removed in 8.0)
> +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> +
> +``tty`` and ``parport`` used to be aliases for ``serial`` and ``parallel``
> +respectively. The actual backend names should be used instead.
>
> QEMU Machine Protocol (QMP) commands
> ------------------------------------
> diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt
> index 240888933482..c98c86d82802 100644
> --- a/docs/qdev-device-use.txt
> +++ b/docs/qdev-device-use.txt
> @@ -216,11 +216,11 @@ LEGACY-CHARDEV translates to -chardev HOST-OPTS... as follows:
>
> * unix:FNAME becomes -chardev socket,path=FNAME
>
> -* /dev/parportN becomes -chardev parport,file=/dev/parportN
> +* /dev/parportN becomes -chardev parallel,file=/dev/parportN
>
> * /dev/ppiN likewise
>
> -* Any other /dev/FNAME becomes -chardev tty,path=/dev/FNAME
> +* Any other /dev/FNAME becomes -chardev serial,path=/dev/FNAME
>
> * mon:LEGACY-CHARDEV is special: it multiplexes the monitor onto the
> character device defined by LEGACY-CHARDEV. -chardev provides more
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 7f99d15b231f..f3d5e1313ca1 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -3379,11 +3379,9 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
> #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
> || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
> "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> - "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> #endif
> #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
> "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> - "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> #endif
> #if defined(CONFIG_SPICE)
> "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
> @@ -3398,7 +3396,7 @@ The general form of a character device option is:
> ``-chardev backend,id=id[,mux=on|off][,options]``
> Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``,
> ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``,
> - ``pty``, ``stdio``, ``braille``, ``tty``, ``parallel``, ``parport``,
> + ``pty``, ``stdio``, ``braille``, ``parallel``,
> ``spicevmc``, ``spiceport``. The specific backend will determine the
> applicable options.
>
> @@ -3622,15 +3620,8 @@ The available backends are:
> Connect to a local BrlAPI server. ``braille`` does not take any
> options.
>
> -``-chardev tty,id=id,path=path``
> - ``tty`` is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD
> - and DragonFlyBSD hosts. It is an alias for ``serial``.
> -
> - ``path`` specifies the path to the tty. ``path`` is required.
> -
> ``-chardev parallel,id=id,path=path``
> \
> -``-chardev parport,id=id,path=path``
> ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD
> hosts.
>
> --
> 2.38.1
>
>
--
Marc-André Lureau
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] util: remove support -chardev tty and -chardev parport
2022-12-18 0:06 [PATCH] util: remove support -chardev tty and -chardev parport Paolo Bonzini
2022-12-18 6:05 ` Marc-André Lureau
@ 2022-12-18 13:45 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-18 13:45 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel
On 18/12/22 01:06, Paolo Bonzini wrote:
> These were deprecated in 6.0 and can now be removed.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> chardev/char.c | 33 ++-------------------------------
> docs/about/deprecated.rst | 6 ------
> docs/about/removed-features.rst | 5 +++++
> docs/qdev-device-use.txt | 4 ++--
> qemu-options.hx | 11 +----------
> 5 files changed, 10 insertions(+), 49 deletions(-)
If you don't mind, please squash a renaming of
HAVE_CHARDEV_PARPORT -> HAVE_CHARDEV_PARALLEL.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-18 13:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-18 0:06 [PATCH] util: remove support -chardev tty and -chardev parport Paolo Bonzini
2022-12-18 6:05 ` Marc-André Lureau
2022-12-18 13:45 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).