Skip to content

Commit

Permalink
ui/vdagent: add clipboard support
Browse files Browse the repository at this point in the history
This patch adds support for clipboard messages to the qemu vdagent
implementation, which allows the guest exchange clipboard data with
qemu.  Clipboard support can be enabled/disabled using the new
'clipboard' parameter for the vdagent chardev.  Default is off.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20210519053940.1888907-1-kraxel@redhat.com
Message-Id: <20210519053940.1888907-7-kraxel@redhat.com>
  • Loading branch information
kraxel committed May 21, 2021
1 parent 5608191 commit f0349f4
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 1 deletion.
3 changes: 3 additions & 0 deletions chardev/char.c
Expand Up @@ -934,6 +934,9 @@ QemuOptsList qemu_chardev_opts = {
},{
.name = "mouse",
.type = QEMU_OPT_BOOL,
},{
.name = "clipboard",
.type = QEMU_OPT_BOOL,
#ifdef CONFIG_LINUX
},{
.name = "tight",
Expand Down
4 changes: 3 additions & 1 deletion qapi/char.json
Expand Up @@ -396,12 +396,14 @@
# Configuration info for qemu vdagent implementation.
#
# @mouse: enable/disable mouse, default is enabled.
# @clipboard: enable/disable clipboard, default is disabled.
#
# Since: 6.1
#
##
{ 'struct': 'ChardevQemuVDAgent',
'data': { '*mouse': 'bool' },
'data': { '*mouse': 'bool',
'*clipboard': 'bool' },
'base': 'ChardevCommon',
'if': 'defined(CONFIG_SPICE_PROTOCOL)' }

Expand Down
2 changes: 2 additions & 0 deletions ui/trace-events
Expand Up @@ -132,3 +132,5 @@ vdagent_send(const char *name) "msg %s"
vdagent_recv_chunk(uint32_t size) "size %d"
vdagent_recv_msg(const char *name, uint32_t size) "msg %s, size %d"
vdagent_peer_cap(const char *name) "cap %s"
vdagent_cb_grab_selection(const char *name) "selection %s"
vdagent_cb_grab_type(const char *name) "type %s"

0 comments on commit f0349f4

Please sign in to comment.