[PATCH v2] system: improve -mon deprecation warning

Daniel P. Berrangé posted 1 patch 3 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260902104753.1756783-1-berrange@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>
system/vl.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
[PATCH v2] system: improve -mon deprecation warning
Posted by Daniel P. Berrangé 3 weeks, 3 days ago
Expand the text a bit to make the new syntax more explicit and point
users to the man page for further info.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 system/vl.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/system/vl.c b/system/vl.c
index eded498fa7..d1d9209038 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -3239,8 +3239,13 @@ void qemu_init(int argc, char **argv)
                 default_monitor = 0;
                 break;
             case QEMU_OPTION_mon:
-                warn_report_once("'-mon' is deprecated, use '-object' with "
-                                 "'monitor-hmp' or 'monitor-qmp' types instead");
+                warn_report_once(
+                    "'-mon' is deprecated. Switch to either "
+                    "'-object monitor-hmp,id=ID,chardev=CHR-ID' or "
+                    "'-object monitor-qmp,id=ID,chardev=CHR-ID' instead. "
+                    "See '-object' docs in the QEMU manual for further "
+                    "configuration guidance: "
+                    "https://www.qemu.org/docs/master/system/invocation.html");
                 if (!qemu_opts_parse_noisily(qemu_find_opts("mon"), optarg,
                                              true)) {
                     exit(1);
-- 
2.55.0


Re: [PATCH v2] system: improve -mon deprecation warning
Posted by Philippe Mathieu-Daudé 3 weeks, 2 days ago
On 2/9/26 12:47, Daniel P. Berrangé wrote:
> Expand the text a bit to make the new syntax more explicit and point
> users to the man page for further info.
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   system/vl.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)

Patch queued, thanks.

Re: [PATCH v2] system: improve -mon deprecation warning
Posted by Peter Maydell 3 weeks, 3 days ago
On Wed, 2 Sept 2026 at 11:48, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> Expand the text a bit to make the new syntax more explicit and point
> users to the man page for further info.
>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  system/vl.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/system/vl.c b/system/vl.c
> index eded498fa7..d1d9209038 100644
> --- a/system/vl.c
> +++ b/system/vl.c
> @@ -3239,8 +3239,13 @@ void qemu_init(int argc, char **argv)
>                  default_monitor = 0;
>                  break;
>              case QEMU_OPTION_mon:
> -                warn_report_once("'-mon' is deprecated, use '-object' with "
> -                                 "'monitor-hmp' or 'monitor-qmp' types instead");
> +                warn_report_once(
> +                    "'-mon' is deprecated. Switch to either "
> +                    "'-object monitor-hmp,id=ID,chardev=CHR-ID' or "
> +                    "'-object monitor-qmp,id=ID,chardev=CHR-ID' instead. "
> +                    "See '-object' docs in the QEMU manual for further "
> +                    "configuration guidance: "
> +                    "https://www.qemu.org/docs/master/system/invocation.html");
>                  if (!qemu_opts_parse_noisily(qemu_find_opts("mon"), optarg,
>                                               true)) {
>                      exit(1);
> --

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM