All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dave@treblig.org>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, berrange@redhat.com,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"reviewer:Incompatible changes" <devel@lists.libvirt.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v2] RFC: audio: deprecate HMP audio commands
Date: Wed, 15 Oct 2025 13:24:20 +0000	[thread overview]
Message-ID: <aO-ghGojbKm8wrFS@gallifrey> (raw)
In-Reply-To: <20251015092851.2850617-1-marcandre.lureau@redhat.com>

* marcandre.lureau@redhat.com (marcandre.lureau@redhat.com) wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> The command is niche and better served by the host audio system.
> There is no QMP equivalent, fortunately. You can capture the audio
> stream via remote desktop protocols too (dbus, vnc, spice).
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

From the HMP side I'm happy with the deprecation, you're right
it's pretty obscure and it's easy enough to do from the host.

Acked-by: Dr. David Alan Gilbert <dave@treblig.org>

Dave

> ---
>  docs/about/deprecated.rst | 20 ++++++++++++++++++++
>  meson.build               |  4 ++++
>  audio/audio-hmp-cmds.c    |  7 +++++++
>  audio/meson.build         |  5 +++--
>  hmp-commands-info.hx      |  2 ++
>  hmp-commands.hx           |  2 ++
>  6 files changed, 38 insertions(+), 2 deletions(-)
> 
> diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
> index 98361f5832..a357f207cf 100644
> --- a/docs/about/deprecated.rst
> +++ b/docs/about/deprecated.rst
> @@ -169,6 +169,26 @@ Use ``job-finalize`` instead.
>  
>  This argument has always been ignored.
>  
> +Human Machine Protocol (HMP) commands
> +-------------------------------------
> +
> +``wavcapture`` (since 10.2)
> +''''''''''''''''''''''''''''
> +
> +The ``wavcapture`` command is deprecated and will be removed in a future release.
> +
> +Use ``-audiodev wav`` or your host audio system to capture audio.
> +
> +``stopcapture`` (since 10.2)
> +''''''''''''''''''''''''''''
> +
> +The ``stopcapture`` command is deprecated and will be removed in a future release.
> +
> +``info`` argument ``capture`` (since 10.2)
> +''''''''''''''''''''''''''''''''''''''''''
> +
> +The ``info capture`` command is deprecated and will be removed in a future release.
> +
>  Host Architectures
>  ------------------
>  
> diff --git a/meson.build b/meson.build
> index afaefa0172..a4d8e33132 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2354,6 +2354,10 @@ endif
>  config_host_data = configuration_data()
>  
>  config_host_data.set('CONFIG_HAVE_RUST', have_rust)
> +
> +# HMP code deprecated since v10.2, to be removed
> +config_host_data.set('CONFIG_AUDIO_HMP', true)
> +
>  audio_drivers_selected = []
>  if have_system
>    audio_drivers_available = {
> diff --git a/audio/audio-hmp-cmds.c b/audio/audio-hmp-cmds.c
> index 8774c09f18..9129a02331 100644
> --- a/audio/audio-hmp-cmds.c
> +++ b/audio/audio-hmp-cmds.c
> @@ -28,6 +28,7 @@
>  #include "monitor/monitor.h"
>  #include "qapi/error.h"
>  #include "qobject/qdict.h"
> +#include "qemu/error-report.h"
>  
>  static QLIST_HEAD (capture_list_head, CaptureState) capture_head;
>  
> @@ -36,6 +37,8 @@ void hmp_info_capture(Monitor *mon, const QDict *qdict)
>      int i;
>      CaptureState *s;
>  
> +    warn_report_once("'info capture' is deprecated since v10.2, to be removed");
> +
>      for (s = capture_head.lh_first, i = 0; s; s = s->entries.le_next, ++i) {
>          monitor_printf(mon, "[%d]: ", i);
>          s->ops.info (s->opaque);
> @@ -48,6 +51,8 @@ void hmp_stopcapture(Monitor *mon, const QDict *qdict)
>      int n = qdict_get_int(qdict, "n");
>      CaptureState *s;
>  
> +    warn_report_once("'stopcapture' is deprecated since v10.2, to be removed");
> +
>      for (s = capture_head.lh_first, i = 0; s; s = s->entries.le_next, ++i) {
>          if (i == n) {
>              s->ops.destroy (s->opaque);
> @@ -69,6 +74,8 @@ void hmp_wavcapture(Monitor *mon, const QDict *qdict)
>      Error *local_err = NULL;
>      AudioState *as = audio_state_by_name(audiodev, &local_err);
>  
> +    warn_report_once("'wavcapture' is deprecated since v10.2, to be removed");
> +
>      if (!as) {
>          error_report_err(local_err);
>          return;
> diff --git a/audio/meson.build b/audio/meson.build
> index 59f0a431d5..f0c97e5223 100644
> --- a/audio/meson.build
> +++ b/audio/meson.build
> @@ -1,12 +1,13 @@
>  system_ss.add([spice_headers, files('audio.c')])
>  system_ss.add(files(
> -  'audio-hmp-cmds.c',
>    'mixeng.c',
>    'noaudio.c',
>    'wavaudio.c',
> -  'wavcapture.c',
>  ))
>  
> +# deprecated since v10.2, to be removed
> +system_ss.add(files('audio-hmp-cmds.c', 'wavcapture.c'))
> +
>  system_ss.add(when: coreaudio, if_true: files('coreaudio.m'))
>  system_ss.add(when: dsound, if_true: files('dsoundaudio.c', 'audio_win_int.c'))
>  
> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
> index 25b4aed51f..59f3446224 100644
> --- a/hmp-commands-info.hx
> +++ b/hmp-commands-info.hx
> @@ -363,6 +363,7 @@ SRST
>      Show host USB devices.
>  ERST
>  
> +#ifdef CONFIG_AUDIO_HMP
>      {
>          .name       = "capture",
>          .args_type  = "",
> @@ -375,6 +376,7 @@ SRST
>    ``info capture``
>      Show capture information.
>  ERST
> +#endif
>  
>      {
>          .name       = "snapshots",
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index 15f6082596..6d59bc8f18 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -764,6 +764,7 @@ SRST
>  
>  ERST
>  
> +#ifdef CONFIG_AUDIO_HMP
>      {
>          .name       = "wavcapture",
>          .args_type  = "path:F,audiodev:s,freq:i?,bits:i?,nchannels:i?",
> @@ -798,6 +799,7 @@ SRST
>      info capture
>  
>  ERST
> +#endif
>  
>      {
>          .name       = "memsave",
> -- 
> 2.51.0
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/


      parent reply	other threads:[~2025-10-15 13:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15  9:28 [PATCH v2] RFC: audio: deprecate HMP audio commands marcandre.lureau
2025-10-15  9:33 ` Daniel P. Berrangé
2025-10-15  9:43   ` Marc-André Lureau
2025-10-15  9:46     ` Daniel P. Berrangé
2025-10-15 13:24 ` Dr. David Alan Gilbert [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=aO-ghGojbKm8wrFS@gallifrey \
    --to=dave@treblig.org \
    --cc=berrange@redhat.com \
    --cc=devel@lists.libvirt.org \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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.