All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Bandan Das" <bsd@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Darren Kenny" <darren.kenny@oracle.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	libvir-list@redhat.com, "Qiuhao Li" <Qiuhao.Li@outlook.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Alexander Bulekov" <alxndr@bu.edu>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH 7/9] ui/vnc: don't accept VNC_ENCODING_AUDIO without audiodev
Date: Fri, 13 Jan 2023 11:21:58 -0500	[thread overview]
Message-ID: <20230113162200.3010804-8-berrange@redhat.com> (raw)
In-Reply-To: <20230113162200.3010804-1-berrange@redhat.com>

If we have no audio state configured, then we don't want to
advertize the VNC_ENCODING_AUDIO feature. If a client attempts
to use it despite being disabled, we should also reject it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 docs/about/deprecated.rst       |  6 ------
 docs/about/removed-features.rst |  6 ++++++
 ui/vnc.c                        | 10 +++++++++-
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index f8b4e19a4c..09269f55e6 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -37,12 +37,6 @@ Creating sound card devices without ``audiodev=`` property (since 4.2)
 When not using the deprecated legacy audio config, each sound card
 should specify an ``audiodev=`` property.
 
-Supporting audio transfer over vnc without ``audiodev=`` property (since 4.2)
-'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-When using vnc, you should specify an ``audiodev=`` property if you
-intend to allow clients to request audio transfer through the VNC protocol.
-
 Short-form boolean options (since 6.0)
 ''''''''''''''''''''''''''''''''''''''
 
diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst
index c918cabd1a..8a8e0faff0 100644
--- a/docs/about/removed-features.rst
+++ b/docs/about/removed-features.rst
@@ -422,6 +422,12 @@ the value is hexadecimal.  That is, '0x20M' should be written either as
 ``tty`` and ``parport`` used to be aliases for ``serial`` and ``parallel``
 respectively. The actual backend names should be used instead.
 
+Supporting audio transfer over vnc without ``audiodev=`` property (removed in 8.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+When using vnc, you should specify an ``audiodev=`` property if you
+intend to allow clients to request audio transfer through the VNC protocol.
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
diff --git a/ui/vnc.c b/ui/vnc.c
index d9eacad759..6b3cbf365e 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2199,7 +2199,9 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
             send_ext_key_event_ack(vs);
             break;
         case VNC_ENCODING_AUDIO:
-            send_ext_audio_ack(vs);
+            if (vs->vd->audio_state != NULL) {
+                send_ext_audio_ack(vs);
+            }
             break;
         case VNC_ENCODING_WMVi:
             vs->features |= VNC_FEATURE_WMVI_MASK;
@@ -2506,6 +2508,12 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
                           read_u32(data, 4), read_u32(data, 8));
             break;
         case VNC_MSG_CLIENT_QEMU_AUDIO:
+            if (vs->vd->audio_state == NULL) {
+                error_report("vnc: QEMU audio client message while disabled");
+                vnc_client_error(vs);
+                break;
+            }
+
             if (len == 2)
                 return 4;
 
-- 
2.38.1



  parent reply	other threads:[~2023-01-13 17:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 16:21 [PATCH 0/9] audio: remove deprecated QEMU_AUDIO env support Daniel P. Berrangé
2023-01-13 16:21 ` [PATCH 1/9] audio: don't check qemu_add_vm_change_state_handler failure Daniel P. Berrangé
2023-01-15 15:44   ` Volker Rümelin
2023-01-13 16:21 ` [PATCH 2/9] audio: remove special audio_calloc function Daniel P. Berrangé
2023-01-15 14:03   ` Volker Rümelin
2023-01-16  9:23     ` Daniel P. Berrangé
2023-01-13 16:21 ` [PATCH 3/9] audio: remove unused 'name' in QEMUSoundCard struct Daniel P. Berrangé
2023-01-13 16:21 ` [PATCH 4/9] audio: remove QEMUSoundCard linked list Daniel P. Berrangé
2023-01-13 16:21 ` [PATCH 5/9] audio: remove empty AUD_remove_card method Daniel P. Berrangé
2023-01-13 16:21 ` [PATCH 6/9] docs: split the deprecation warning for soundcards vs VNC Daniel P. Berrangé
2023-01-13 16:21 ` Daniel P. Berrangé [this message]
2023-01-13 16:21 ` [PATCH 8/9] audio: audio state is now mandatory for capture Daniel P. Berrangé
2023-01-13 16:22 ` [PATCH 9/9] audio: remove support for QEMU_AUDIO_ env variables Daniel P. Berrangé

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=20230113162200.3010804-8-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=Qiuhao.Li@outlook.com \
    --cc=alxndr@bu.edu \
    --cc=bsd@redhat.com \
    --cc=darren.kenny@oracle.com \
    --cc=kraxel@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    --cc=stefanha@redhat.com \
    --cc=thuth@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.