]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ui/vdagent: always reset the clipboard serial on caps
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 12 Sep 2022 10:24:53 +0000 (14:24 +0400)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 23 Sep 2022 12:38:27 +0000 (14:38 +0200)
The guest agent doesn't know what is the current serial state. Reset the
serial value whenever a new agent connection is established.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=2124446

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220912102455.111765-4-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/vdagent.c

index 58ce7507fddc2f3daf5d83c586dc0100613816aa..819e0dc1435b64c17ae70cc2149cd24f22290dad 100644 (file)
@@ -719,8 +719,10 @@ static void vdagent_chr_recv_caps(VDAgentChardev *vd, VDAgentMessage *msg)
     if (have_mouse(vd) && vd->mouse_hs) {
         qemu_input_handler_activate(vd->mouse_hs);
     }
+
+    memset(vd->last_serial, 0, sizeof(vd->last_serial));
+
     if (have_clipboard(vd) && vd->cbpeer.notifier.notify == NULL) {
-        memset(vd->last_serial, 0, sizeof(vd->last_serial));
         vd->cbpeer.name = "vdagent";
         vd->cbpeer.notifier.notify = vdagent_clipboard_notify;
         vd->cbpeer.request = vdagent_clipboard_request;