mbox series

[v4,0/9] ui: add vdagent implementation and clipboard support.

Message ID 20210423083351.2096734-1-kraxel@redhat.com (mailing list archive)
Headers show
Series ui: add vdagent implementation and clipboard support. | expand

Message

Gerd Hoffmann April 23, 2021, 8:33 a.m. UTC
Fist sketch of cut+paste support for vnc.  On the guest side we are
going to reuse the spice vdagent, so things should work out-of-the-box
with guests in the wild.  So this patch set brings a qemu implemenation
of the vdagent protocol.

Beside that there is the clipboard infrastructure of course.  For now
only text support is there.  The design allows adding more data types,
so we can add image support and maybe more later on.  So far vdagent,
vnc server and gtk ui are hooked up.

Usage: qemu \
  -chardev vdagent,id=vdagent,clipboard=on \
  -device virtio-serial-pci \
  -device virtserialport,chardev=vdagent,name=com.redhat.spice.0

v3:
 - rebase to latest master.
 - make spice-protocol a separate build dependency.
 - update qapi version annotation.
 - add documentatin for qemu clipboard.
 - misc little tweaks.
v2:
 - add a bunch of sanity checks.
 - add proper chunking.
 - use autofree.
v3:
 - support agents without VD_AGENT_CAP_CLIPBOARD_SELECTION.
 - properly parse chunked messages.
 - test with windows guests, minor fixes.
 - set display_id for agent mouse events.

Gerd Hoffmann (9):
  build: add separate spice-protocol config option
  ui: add clipboard infrastructure
  ui: add clipboard documentation
  ui/vdagent: core infrastructure
  ui/vdagent: add mouse support
  ui/vdagent: add clipboard support
  ui/vnc: clipboard support
  ui/gtk: move struct GtkDisplayState to ui/gtk.h
  ui/gtk: add clipboard support

 configure              |  36 +-
 include/ui/clipboard.h | 193 +++++++++++
 include/ui/gtk.h       |  67 ++++
 ui/vnc.h               |  24 ++
 chardev/char.c         |   6 +
 ui/clipboard.c         |  92 +++++
 ui/gtk-clipboard.c     | 192 +++++++++++
 ui/gtk.c               |  56 +--
 ui/vdagent.c           | 756 +++++++++++++++++++++++++++++++++++++++++
 ui/vnc-clipboard.c     | 323 ++++++++++++++++++
 ui/vnc.c               |  20 +-
 docs/devel/index.rst   |   1 +
 docs/devel/ui.rst      |   8 +
 meson.build            |   4 +
 qapi/char.json         |  21 +-
 ui/meson.build         |   5 +-
 ui/trace-events        |  10 +
 17 files changed, 1747 insertions(+), 67 deletions(-)
 create mode 100644 include/ui/clipboard.h
 create mode 100644 ui/clipboard.c
 create mode 100644 ui/gtk-clipboard.c
 create mode 100644 ui/vdagent.c
 create mode 100644 ui/vnc-clipboard.c
 create mode 100644 docs/devel/ui.rst

Comments

no-reply@patchew.org April 23, 2021, 8:48 a.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20210423083351.2096734-1-kraxel@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210423083351.2096734-1-kraxel@redhat.com
Subject: [PATCH v4 0/9] ui: add vdagent implementation and clipboard support.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/20210423031803.1479-1-jasowang@redhat.com -> patchew/20210423031803.1479-1-jasowang@redhat.com
 * [new tag]         patchew/20210423083351.2096734-1-kraxel@redhat.com -> patchew/20210423083351.2096734-1-kraxel@redhat.com
Switched to a new branch 'test'
fa88f63 ui/gtk: add clipboard support
97d4171 ui/gtk: move struct GtkDisplayState to ui/gtk.h
2ec125e ui/vnc: clipboard support
2da458b ui/vdagent: add clipboard support
714a6aa ui/vdagent: add mouse support
b6861fc ui/vdagent: core infrastructure
c55afaf ui: add clipboard documentation
5bbff44 ui: add clipboard infrastructure
6e4ea38 build: add separate spice-protocol config option

=== OUTPUT BEGIN ===
1/9 Checking commit 6e4ea38d4a20 (build: add separate spice-protocol config option)
2/9 Checking commit 5bbff442c1b6 (ui: add clipboard infrastructure)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#18: 
new file mode 100644

total: 0 errors, 1 warnings, 161 lines checked

Patch 2/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/9 Checking commit c55afaf200fa (ui: add clipboard documentation)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#30: 
new file mode 100644

WARNING: line over 80 characters
#89: FILE: include/ui/clipboard.h:43:
+ * @QEMU_CLIPBOARD_SELECTION_PRIMARY: primary selection (select + middle mouse button).

total: 0 errors, 2 warnings, 194 lines checked

Patch 3/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/9 Checking commit b6861fc13784 (ui/vdagent: core infrastructure)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#101: 
new file mode 100644

ERROR: if this code is redundant consider removing it
#153: FILE: ui/vdagent.c:48:
+#if 0

WARNING: line over 80 characters
#155: FILE: ui/vdagent.c:50:
+    [VD_AGENT_CAP_CLIPBOARD_NO_RELEASE_ON_REGRAB] = "clipboard-no-release-on-regrab",

ERROR: if this code is redundant consider removing it
#176: FILE: ui/vdagent.c:71:
+#if 0

WARNING: line over 80 characters
#228: FILE: ui/vdagent.c:123:
+                                               sizeof(VDAgentAnnounceCapabilities) +

total: 2 errors, 3 warnings, 365 lines checked

Patch 4/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

5/9 Checking commit 714a6aae9e45 (ui/vdagent: add mouse support)
ERROR: if this code is redundant consider removing it
#147: FILE: ui/vdagent.c:189:
+#if 0

total: 1 errors, 0 warnings, 238 lines checked

Patch 5/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

6/9 Checking commit 2da458ba5b38 (ui/vdagent: add clipboard support)
ERROR: if this code is redundant consider removing it
#121: FILE: ui/vdagent.c:115:
+#if 0

ERROR: line over 90 characters
#171: FILE: ui/vdagent.c:308:
+                                               sizeof(uint32_t) * (QEMU_CLIPBOARD_TYPE__COUNT + 1));

WARNING: line over 80 characters
#440: FILE: ui/vdagent.c:729:
+    cfg->clipboard = qemu_opt_get_bool(opts, "clipboard", VDAGENT_CLIPBOARD_DEFAULT);

total: 2 errors, 1 warnings, 393 lines checked

Patch 6/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/9 Checking commit 2ec125e1a889 (ui/vnc: clipboard support)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#33: 
new file mode 100644

WARNING: line over 80 characters
#280: FILE: ui/vnc-clipboard.c:243:
+void vnc_client_cut_text_ext(VncState *vs, int32_t len, uint32_t flags, uint8_t *data)

WARNING: line over 80 characters
#289: FILE: ui/vnc-clipboard.c:252:
+            qemu_clipboard_info_new(&vs->cbpeer, QEMU_CLIPBOARD_SELECTION_CLIPBOARD);

WARNING: line over 80 characters
#333: FILE: ui/vnc-clipboard.c:296:
+        qemu_clipboard_info_new(&vs->cbpeer, QEMU_CLIPBOARD_SELECTION_CLIPBOARD);

ERROR: line over 90 characters
#420: FILE: ui/vnc.c:2458:
+            vnc_client_cut_text_ext(vs, abs(read_s32(data, 4)), read_u32(data, 8), data + 12);

WARNING: line over 80 characters
#499: FILE: ui/vnc.h:643:
+void vnc_client_cut_text_ext(VncState *vs, int32_t len, uint32_t flags, uint8_t *data);

total: 1 errors, 5 warnings, 450 lines checked

Patch 7/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

8/9 Checking commit 97d4171f2b66 (ui/gtk: move struct GtkDisplayState to ui/gtk.h)
9/9 Checking commit fa88f6351407 (ui/gtk: add clipboard support)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#52: 
new file mode 100644

WARNING: line over 80 characters
#135: FILE: ui/gtk-clipboard.c:79:
+    GtkDisplayState *gd = container_of(notifier, GtkDisplayState, cbpeer.update);

total: 0 errors, 2 warnings, 233 lines checked

Patch 9/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210423083351.2096734-1-kraxel@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com