[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/25] ui/vdagent: fix serial reset of guest agent
From: |
Gerd Hoffmann |
Subject: |
[PULL 09/25] ui/vdagent: fix serial reset of guest agent |
Date: |
Mon, 26 Sep 2022 11:54:53 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
In order to reset the guest agent, we send CLOSED & OPENED events.
They are correctly received by the guest kernel. However, they might not
be noticed by the guest agent process, as the IO task (poll() for
example) might be wake up after both CLOSED & OPENED have been
processed.
Wait until the guest agent is disconnected to re-open our side.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220912102455.111765-6-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/vdagent.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ui/vdagent.c b/ui/vdagent.c
index 819e0dc1435b..4bf50f0c4d88 100644
--- a/ui/vdagent.c
+++ b/ui/vdagent.c
@@ -471,7 +471,7 @@ static void vdagent_clipboard_reset_serial(VDAgentChardev
*vd)
/* reopen the agent connection to reset the serial state */
qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
- qemu_chr_be_event(chr, CHR_EVENT_OPENED);
+ /* OPENED again after the guest disconnected, see set_fe_open */
}
static void vdagent_clipboard_notify(Notifier *notifier, void *data)
@@ -875,6 +875,9 @@ static void vdagent_chr_set_fe_open(struct Chardev *chr,
int fe_open)
{
if (!fe_open) {
trace_vdagent_close();
+ /* To reset_serial, we CLOSED our side. Make sure the other end knows
we
+ * are ready again. */
+ qemu_chr_be_event(chr, CHR_EVENT_OPENED);
return;
}
--
2.37.3
- [PULL 04/25] meson: Allow to enable gtk and sdl while cocoa is enabled, (continued)
- [PULL 04/25] meson: Allow to enable gtk and sdl while cocoa is enabled, Gerd Hoffmann, 2022/09/26
- [PULL 02/25] ui/cocoa: Run qemu_init in the main thread, Gerd Hoffmann, 2022/09/26
- [PULL 05/25] ui: add some vdagent related traces, Gerd Hoffmann, 2022/09/26
- [PULL 07/25] ui/vdagent: always reset the clipboard serial on caps, Gerd Hoffmann, 2022/09/26
- [PULL 08/25] ui/clipboard: reset the serial state on reset, Gerd Hoffmann, 2022/09/26
- [PULL 11/25] hw/usb/hcd-xhci: Check whether DMA accesses fail, Gerd Hoffmann, 2022/09/26
- [PULL 10/25] ui/console: fix three double frees in png_save(), Gerd Hoffmann, 2022/09/26
- [PULL 13/25] hcd-ohci: Fix inconsistency when resetting ohci root hubs, Gerd Hoffmann, 2022/09/26
- [PULL 12/25] hcd-ohci: Drop ohci_service_iso_td() if ed->head & OHCI_DPTR_MASK is zero, Gerd Hoffmann, 2022/09/26
- [PULL 15/25] usb/msd: add usb_msd_fatal_error() and fix guest-triggerable assert, Gerd Hoffmann, 2022/09/26
- [PULL 09/25] ui/vdagent: fix serial reset of guest agent,
Gerd Hoffmann <=
- [PULL 16/25] hcd-xhci: drop operation with secondary stream arrays enabled, Gerd Hoffmann, 2022/09/26
- [PULL 19/25] usbnet: Detect short packets as sent by the xHCI controller, Gerd Hoffmann, 2022/09/26
- [PULL 14/25] usb/msd: move usb_msd_packet_complete(), Gerd Hoffmann, 2022/09/26
- [PULL 17/25] usbnet: Add missing usb_wakeup() call in usbnet_receive(), Gerd Hoffmann, 2022/09/26
- [PULL 18/25] usbnet: Accept mandatory USB_CDC_SET_ETHERNET_PACKET_FILTER request, Gerd Hoffmann, 2022/09/26
- [PULL 25/25] virtio-gpu: update scanout if there is any area covered by the rect, Gerd Hoffmann, 2022/09/26
- [PULL 23/25] audio: remove abort() in audio_bug(), Gerd Hoffmann, 2022/09/26
- [PULL 20/25] usbnet: Report link-up via interrupt endpoint in CDC-ECM mode, Gerd Hoffmann, 2022/09/26
- [PULL 24/25] hw/display/ati_2d: Fix buffer overflow in ati_2d_blt (CVE-2021-3638), Gerd Hoffmann, 2022/09/26
- [PULL 21/25] audio: Add sndio backend, Gerd Hoffmann, 2022/09/26