* [PATCH] ui/dbus: forward guest clipboard grabs that lack a serial
@ 2026-09-07 21:12 Rick Vernam
2026-09-08 7:00 ` Marc-André Lureau
0 siblings, 1 reply; 2+ messages in thread
From: Rick Vernam @ 2026-09-07 21:12 UTC (permalink / raw)
To: marcandre.lureau; +Cc: qemu-devel, rtvernam
dbus_clipboard_update_info() drops any incoming grab whose
QemuClipboardInfo has no serial number:
if (self_update || !info->has_serial) {
return;
}
For grabs coming from ui/vdagent.c, has_serial is only set when the
guest's vdagent client has negotiated VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL
(see vdagent_clipboard_recv_grab()). When the guest doesn't negotiate
it, the grab is silently dropped here and never forwarded to the
D-Bus display client via Clipboard.Grab.
It seems other protocols (ui/gtk-clipboard.c, ui/vnc-clipboard.c) do not
incorporate a validation on has_serial, so this patch matches their
behavior.
Signed-off-by: Rick Vernam <rtvernam@gmail.com>
---
ui/dbus-clipboard.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/dbus-clipboard.c b/ui/dbus-clipboard.c
index 90318384ee..1389ec0edc 100644
--- a/ui/dbus-clipboard.c
+++ b/ui/dbus-clipboard.c
@@ -72,7 +72,7 @@ dbus_clipboard_update_info(DBusDisplay *dpy, QemuClipboardInfo *info)
return;
}
- if (self_update || !info->has_serial) {
+ if (self_update) {
return;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ui/dbus: forward guest clipboard grabs that lack a serial
2026-09-07 21:12 [PATCH] ui/dbus: forward guest clipboard grabs that lack a serial Rick Vernam
@ 2026-09-08 7:00 ` Marc-André Lureau
0 siblings, 0 replies; 2+ messages in thread
From: Marc-André Lureau @ 2026-09-08 7:00 UTC (permalink / raw)
To: Rick Vernam; +Cc: qemu-devel
Hi
On Tue, Sep 8, 2026 at 1:13 AM Rick Vernam <rtvernam@gmail.com> wrote:
>
> dbus_clipboard_update_info() drops any incoming grab whose
> QemuClipboardInfo has no serial number:
>
> if (self_update || !info->has_serial) {
> return;
> }
>
> For grabs coming from ui/vdagent.c, has_serial is only set when the
> guest's vdagent client has negotiated VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL
> (see vdagent_clipboard_recv_grab()). When the guest doesn't negotiate
> it, the grab is silently dropped here and never forwarded to the
> D-Bus display client via Clipboard.Grab.
>
> It seems other protocols (ui/gtk-clipboard.c, ui/vnc-clipboard.c) do not
> incorporate a validation on has_serial, so this patch matches their
> behavior.
But dbus display relies on "serial" being valid. The client has no way
to check !info->serial. Iow, the agent must support
VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL. When not supported, the clipboard
state get out of sync due to races.
>
> Signed-off-by: Rick Vernam <rtvernam@gmail.com>
> ---
> ui/dbus-clipboard.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ui/dbus-clipboard.c b/ui/dbus-clipboard.c
> index 90318384ee..1389ec0edc 100644
> --- a/ui/dbus-clipboard.c
> +++ b/ui/dbus-clipboard.c
> @@ -72,7 +72,7 @@ dbus_clipboard_update_info(DBusDisplay *dpy, QemuClipboardInfo *info)
> return;
> }
>
> - if (self_update || !info->has_serial) {
> + if (self_update) {
> return;
> }
>
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-08 7:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 21:12 [PATCH] ui/dbus: forward guest clipboard grabs that lack a serial Rick Vernam
2026-09-08 7:00 ` Marc-André Lureau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.