qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] Audio 20190828 patches
@ 2019-08-28 11:53 Gerd Hoffmann
  2019-08-28 11:53 ` [Qemu-devel] [PULL 1/2] audio: fix invalid malloc size in audio_create_pdos Gerd Hoffmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2019-08-28 11:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: libvir-list, Gerd Hoffmann

The following changes since commit 23919ddfd56135cad3cb468a8f54d5a595f024f4:

  Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190827' into staging (2019-08-27 15:52:36 +0100)

are available in the Git repository at:

  git://git.kraxel.org/qemu tags/audio-20190828-pull-request

for you to fetch changes up to 4b3b7793e18e1e3edb90bbc21112e875f9ff826d:

  audio: omitting audiodev= parameter is only deprecated (2019-08-28 11:57:45 +0200)

----------------------------------------------------------------
audio: two little fixes.

----------------------------------------------------------------

Kővágó, Zoltán (2):
  audio: fix invalid malloc size in audio_create_pdos
  audio: omitting audiodev= parameter is only deprecated

 audio/audio.c        | 10 +++++-----
 qemu-deprecated.texi |  7 +++++++
 2 files changed, 12 insertions(+), 5 deletions(-)

-- 
2.18.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/2] audio: fix invalid malloc size in audio_create_pdos
  2019-08-28 11:53 [Qemu-devel] [PULL 0/2] Audio 20190828 patches Gerd Hoffmann
@ 2019-08-28 11:53 ` Gerd Hoffmann
  2019-08-28 11:53 ` [Qemu-devel] [PULL 2/2] audio: omitting audiodev= parameter is only deprecated Gerd Hoffmann
  2019-09-03 14:32 ` [Qemu-devel] [PULL 0/2] Audio 20190828 patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2019-08-28 11:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: libvir-list, Kővágó, Gerd Hoffmann, Zoltán

From: Kővágó, Zoltán <dirty.ice.hu@gmail.com>

The code used sizeof(AudiodevAlsaPerDirectionOptions) instead of the
appropriate per direction options for the audio backend.  If the size of
the actual audiodev's per direction options are larger than alsa's, it
could cause a buffer overflow.

However, alsa has three fields in per direction options: a string, an
uint32 and a bool.  Oss has the same fields, coreaudio has a single
uint32, paaudio has a string and an uint32, all other backends only use
the common options, so currently no per direction options struct should
be larger than alsa's.

Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
Message-Id: <7808bc816ba7da8b8de8a214713444d85f7af3c6.1566847960.git.DirtY.iCE.hu@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/audio/audio.c b/audio/audio.c
index 7d715332c993..ae335dbebb1e 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1685,7 +1685,7 @@ void audio_create_pdos(Audiodev *dev)
         }                                                           \
         if (!dev->u.driver.has_out) {                               \
             dev->u.driver.out = g_malloc0(                          \
-                sizeof(AudiodevAlsaPerDirectionOptions));           \
+                sizeof(Audiodev##pdo_name##PerDirectionOptions));   \
             dev->u.driver.has_out = true;                           \
         }                                                           \
         break
-- 
2.18.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] audio: omitting audiodev= parameter is only deprecated
  2019-08-28 11:53 [Qemu-devel] [PULL 0/2] Audio 20190828 patches Gerd Hoffmann
  2019-08-28 11:53 ` [Qemu-devel] [PULL 1/2] audio: fix invalid malloc size in audio_create_pdos Gerd Hoffmann
@ 2019-08-28 11:53 ` Gerd Hoffmann
  2019-09-03 14:32 ` [Qemu-devel] [PULL 0/2] Audio 20190828 patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2019-08-28 11:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: libvir-list, Kővágó, Gerd Hoffmann, Zoltán

From: Kővágó, Zoltán <dirty.ice.hu@gmail.com>

Unfortunately, changes introduced in af2041ed2d "audio: audiodev=
parameters no longer optional when -audiodev present" breaks backward
compatibility.  This patch changes the error into a deprecation warning.

Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
Message-id: 02d4328c33455742d01e0b62395013e95293c3ba.1566847960.git.DirtY.iCE.hu@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/audio.c        | 8 ++++----
 qemu-deprecated.texi | 7 +++++++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/audio/audio.c b/audio/audio.c
index ae335dbebb1e..e99fcd0694e9 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1412,8 +1412,9 @@ static AudioState *audio_init(Audiodev *dev, const char *name)
         drvname = AudiodevDriver_str(dev->driver);
     } else if (!QTAILQ_EMPTY(&audio_states)) {
         if (!legacy_config) {
-            dolog("You must specify an audiodev= for the device %s\n", name);
-            exit(1);
+            dolog("Device %s: audiodev default parameter is deprecated, please "
+                  "specify audiodev=%s\n", name,
+                  QTAILQ_FIRST(&audio_states)->dev->id);
         }
         return QTAILQ_FIRST(&audio_states);
     } else {
@@ -1548,8 +1549,7 @@ CaptureVoiceOut *AUD_add_capture(
 
     if (!s) {
         if (!legacy_config) {
-            dolog("You must specify audiodev when trying to capture\n");
-            return NULL;
+            dolog("Capturing without setting an audiodev is deprecated\n");
         }
         s = audio_init(NULL, NULL);
     }
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 00a4b6f35042..9d74a1cfc017 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -72,6 +72,13 @@ backend settings instead of environment variables.  To ease migration to
 the new format, the ``-audiodev-help'' option can be used to convert
 the current values of the environment variables to ``-audiodev'' options.
 
+@subsection Creating sound card devices and vnc without audiodev= property (since 4.2)
+
+When not using the deprecated legacy audio config, each sound card
+should specify an @code{audiodev=} property.  Additionally, when using
+vnc, you should specify an @code{audiodev=} propery if you plan to
+transmit audio through the VNC protocol.
+
 @subsection -mon ...,control=readline,pretty=on|off (since 4.1)
 
 The @code{pretty=on|off} switch has no effect for HMP monitors, but is
-- 
2.18.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/2] Audio 20190828 patches
  2019-08-28 11:53 [Qemu-devel] [PULL 0/2] Audio 20190828 patches Gerd Hoffmann
  2019-08-28 11:53 ` [Qemu-devel] [PULL 1/2] audio: fix invalid malloc size in audio_create_pdos Gerd Hoffmann
  2019-08-28 11:53 ` [Qemu-devel] [PULL 2/2] audio: omitting audiodev= parameter is only deprecated Gerd Hoffmann
@ 2019-09-03 14:32 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2019-09-03 14:32 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Libvirt, QEMU Developers

On Wed, 28 Aug 2019 at 12:55, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> The following changes since commit 23919ddfd56135cad3cb468a8f54d5a595f024f4:
>
>   Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190827' into staging (2019-08-27 15:52:36 +0100)
>
> are available in the Git repository at:
>
>   git://git.kraxel.org/qemu tags/audio-20190828-pull-request
>
> for you to fetch changes up to 4b3b7793e18e1e3edb90bbc21112e875f9ff826d:
>
>   audio: omitting audiodev= parameter is only deprecated (2019-08-28 11:57:45 +0200)
>
> ----------------------------------------------------------------
> audio: two little fixes.
>
> ----------------------------------------------------------------
>
> Kővágó, Zoltán (2):
>   audio: fix invalid malloc size in audio_create_pdos
>   audio: omitting audiodev= parameter is only deprecated


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-03 14:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28 11:53 [Qemu-devel] [PULL 0/2] Audio 20190828 patches Gerd Hoffmann
2019-08-28 11:53 ` [Qemu-devel] [PULL 1/2] audio: fix invalid malloc size in audio_create_pdos Gerd Hoffmann
2019-08-28 11:53 ` [Qemu-devel] [PULL 2/2] audio: omitting audiodev= parameter is only deprecated Gerd Hoffmann
2019-09-03 14:32 ` [Qemu-devel] [PULL 0/2] Audio 20190828 patches Peter Maydell

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).