fixes for gtk, sdl and audio live migration.

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmESbpYACgkQTLbY7tPo
 cThQuQ//X5kLamLlPjM6GAukCty5/15rs3lrjQuIwTxxWX//82pmGUwVPGm3oiqj
 6wb2ps4Exb5dCxpVs/smnPt9P3bkbrrbfCLxmWZ3Uf0+MTpadeaiG2V4KS9QqZYR
 o6lnl9hStt8P48zhLmKpJcQpmo6qDNrOnPPz3GBFnB4lJ6DtVGHDf0+BQYFLDQ6p
 t+/F9jbXn8IFoMwiMJd1x1A3mezJQ5wyf8rhMQh+FO2bki1IuZDdY2XwwBABNMrp
 1PIgZVSq69/CAjWTQuw2DEEhtcD/z1cI6mx08zIXHBgybkhZk1xjHLlakRuIfjzP
 KSpS2Dg8O1Tgkr1X+zjoS2LrqiM9okw0mSwOfnOXuz1wNgNj/JggRTV9c7FFA7SO
 D1fRpXOx1pq8Mo3YYIN31oxt2PELipR/Jn1PK29ezB06qY7Yv+zOBw5Ep+InEuz+
 O4g2mBzv1iZsZ7X1wfr8Fu9KfeMmxNaKjL/J6vD0hbjufno6WmVaexwVXBTMGW9q
 3mXCPkGu4dWbSBXjomV9GYmcpk23bR7oH57c3PFXM7STX4Nc0leABW0HwZ6XHeDu
 l4Wb5HC6kR5KkhemZ7ifUO2ElfFBn6XUQY1q/UPV/gzYKiMyot0GBlHjd6O0/NiQ
 sxU6QxrBDv3MjhzUQpBCrNeQm/f8PUAEgfXmznjx24HPJWorLL8=
 =qZFO
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20210810-pull-request' into staging

fixes for gtk, sdl and audio live migration.

# gpg: Signature made Tue 10 Aug 2021 13:18:30 BST
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/fixes-20210810-pull-request:
  ui/sdl2: Check return value from g_setenv()
  audio: Never send migration section
  ui/gtk: retry sending VTE console input

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2021-08-10 14:00:39 +01:00
commit 02b8aeede2
3 changed files with 18 additions and 7 deletions

View File

@ -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()
}

View File

@ -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;
}
}

View File

@ -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)) {