qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/3] Fixes 20210810 patches
@ 2021-08-10 12:18 Gerd Hoffmann
  2021-08-10 12:18 ` [PULL 1/3] ui/gtk: retry sending VTE console input Gerd Hoffmann
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2021-08-10 12:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

The following changes since commit bccabb3a5d60182645c7749e89f21a9ff307a9eb:

  Update version for v6.1.0-rc2 release (2021-08-04 16:56:14 +0100)

are available in the Git repository at:

  git://git.kraxel.org/qemu tags/fixes-20210810-pull-request

for you to fetch changes up to 6ff5b5d6d521001135d1bd5c609e8834099f01d8:

  ui/sdl2: Check return value from g_setenv() (2021-08-10 10:56:39 +0200)

----------------------------------------------------------------
fixes for gtk, sdl and audio live migration.

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

Dr. David Alan Gilbert (1):
  audio: Never send migration section

Peter Maydell (1):
  ui/sdl2: Check return value from g_setenv()

Volker Rümelin (1):
  ui/gtk: retry sending VTE console input

 audio/audio.c | 10 ++++++++++
 ui/gtk.c      | 10 ++++------
 ui/sdl2.c     |  5 ++++-
 3 files changed, 18 insertions(+), 7 deletions(-)

-- 
2.31.1




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

* [PULL 1/3] ui/gtk: retry sending VTE console input
  2021-08-10 12:18 [PULL 0/3] Fixes 20210810 patches Gerd Hoffmann
@ 2021-08-10 12:18 ` Gerd Hoffmann
  2021-08-10 12:18 ` [PULL 2/3] audio: Never send migration section Gerd Hoffmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2021-08-10 12:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Volker Rümelin, Gerd Hoffmann

From: Volker Rümelin <vr_qemu@t-online.de>

Commit 584af1f1d9 ("ui/gtk: add a keyboard fifo to the VTE
consoles") changed the VTE chardev backend code to rely on the
chr_accept_input() callback function. The code expects a
chr_accept_input() call whenever qemu_chr_be_can_write() bytes
were written. It turns out this is wrong. Some chardev
frontends only call this callback after can_write was 0.

Change the code to send data until the keyboard fifo is empty
or qemu_chr_be_can_write() returns 0.

Fixes: 584af1f1d9 ("ui/gtk: add a keyboard fifo to the VTE consoles")
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210810063257.17411-1-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/gtk.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 974e4dfc0b5b..cfb0728d1fb4 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1646,16 +1646,14 @@ static void gd_vc_send_chars(VirtualConsole *vc)
 
     len = qemu_chr_be_can_write(vc->vte.chr);
     avail = fifo8_num_used(&vc->vte.out_fifo);
-    if (len > avail) {
-        len = avail;
-    }
-    while (len > 0) {
+    while (len > 0 && avail > 0) {
         const uint8_t *buf;
         uint32_t size;
 
-        buf = fifo8_pop_buf(&vc->vte.out_fifo, len, &size);
+        buf = fifo8_pop_buf(&vc->vte.out_fifo, MIN(len, avail), &size);
         qemu_chr_be_write(vc->vte.chr, (uint8_t *)buf, size);
-        len -= size;
+        len = qemu_chr_be_can_write(vc->vte.chr);
+        avail -= size;
     }
 }
 
-- 
2.31.1



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

* [PULL 2/3] audio: Never send migration section
  2021-08-10 12:18 [PULL 0/3] Fixes 20210810 patches Gerd Hoffmann
  2021-08-10 12:18 ` [PULL 1/3] ui/gtk: retry sending VTE console input Gerd Hoffmann
@ 2021-08-10 12:18 ` Gerd Hoffmann
  2021-08-10 12:18 ` [PULL 3/3] ui/sdl2: Check return value from g_setenv() Gerd Hoffmann
  2021-08-10 14:12 ` [PULL 0/3] Fixes 20210810 patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2021-08-10 12:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P . Berrangé, Gerd Hoffmann, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

The audio migration vmstate is empty, and always has been; we can't
just remove it though because an old qemu might send it us.
Changes with -audiodev now mean it's sometimes created when it didn't
used to be, and can confuse migration to old qemu.

Change it so that vmstate_audio is never sent; if it's received it
should still be accepted, and old qemu's shouldn't be too upset if it's
missing.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210809170956.78536-1-dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/audio.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/audio/audio.c b/audio/audio.c
index 59453ef85673..54a153c0ef07 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1622,10 +1622,20 @@ void audio_cleanup(void)
     }
 }
 
+static bool vmstate_audio_needed(void *opaque)
+{
+    /*
+     * Never needed, this vmstate only exists in case
+     * an old qemu sends it to us.
+     */
+    return false;
+}
+
 static const VMStateDescription vmstate_audio = {
     .name = "audio",
     .version_id = 1,
     .minimum_version_id = 1,
+    .needed = vmstate_audio_needed,
     .fields = (VMStateField[]) {
         VMSTATE_END_OF_LIST()
     }
-- 
2.31.1



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

* [PULL 3/3] ui/sdl2: Check return value from g_setenv()
  2021-08-10 12:18 [PULL 0/3] Fixes 20210810 patches Gerd Hoffmann
  2021-08-10 12:18 ` [PULL 1/3] ui/gtk: retry sending VTE console input Gerd Hoffmann
  2021-08-10 12:18 ` [PULL 2/3] audio: Never send migration section Gerd Hoffmann
@ 2021-08-10 12:18 ` Gerd Hoffmann
  2021-08-10 14:12 ` [PULL 0/3] Fixes 20210810 patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2021-08-10 12:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Gerd Hoffmann

From: Peter Maydell <peter.maydell@linaro.org>

Setting environment variables can fail; check the return value
from g_setenv() and bail out if we couldn't set SDL_VIDEODRIVER.

Fixes: Coverity 1458798
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210809161424.32355-1-peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/sdl2.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 36d9010cb6c1..17c0ec30ebff 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -817,7 +817,10 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
      * This is a bit hackish but saves us from bigger problem.
      * Maybe it's a good idea to fix this in SDL instead.
      */
-    g_setenv("SDL_VIDEODRIVER", "x11", 0);
+    if (!g_setenv("SDL_VIDEODRIVER", "x11", 0)) {
+        fprintf(stderr, "Could not set SDL_VIDEODRIVER environment variable\n");
+        exit(1);
+    }
 #endif
 
     if (SDL_Init(SDL_INIT_VIDEO)) {
-- 
2.31.1



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

* Re: [PULL 0/3] Fixes 20210810 patches
  2021-08-10 12:18 [PULL 0/3] Fixes 20210810 patches Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2021-08-10 12:18 ` [PULL 3/3] ui/sdl2: Check return value from g_setenv() Gerd Hoffmann
@ 2021-08-10 14:12 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2021-08-10 14:12 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On Tue, 10 Aug 2021 at 13:20, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> The following changes since commit bccabb3a5d60182645c7749e89f21a9ff307a9eb:
>
>   Update version for v6.1.0-rc2 release (2021-08-04 16:56:14 +0100)
>
> are available in the Git repository at:
>
>   git://git.kraxel.org/qemu tags/fixes-20210810-pull-request
>
> for you to fetch changes up to 6ff5b5d6d521001135d1bd5c609e8834099f01d8:
>
>   ui/sdl2: Check return value from g_setenv() (2021-08-10 10:56:39 +0200)
>
> ----------------------------------------------------------------
> fixes for gtk, sdl and audio live migration.
>

Applied, thanks.

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

-- PMM


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

end of thread, other threads:[~2021-08-10 14:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-10 12:18 [PULL 0/3] Fixes 20210810 patches Gerd Hoffmann
2021-08-10 12:18 ` [PULL 1/3] ui/gtk: retry sending VTE console input Gerd Hoffmann
2021-08-10 12:18 ` [PULL 2/3] audio: Never send migration section Gerd Hoffmann
2021-08-10 12:18 ` [PULL 3/3] ui/sdl2: Check return value from g_setenv() Gerd Hoffmann
2021-08-10 14:12 ` [PULL 0/3] Fixes 20210810 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).