From patchwork Wed May 19 05:39:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1480675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=D/sNu9YP; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FlMGw6Fkcz9sRN for ; Wed, 19 May 2021 15:43:20 +1000 (AEST) Received: from localhost ([::1]:38316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljEzG-0004s1-TZ for incoming@patchwork.ozlabs.org; Wed, 19 May 2021 01:43:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljEw2-00008G-P1 for qemu-devel@nongnu.org; Wed, 19 May 2021 01:40:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljEvy-0001dm-Up for qemu-devel@nongnu.org; Wed, 19 May 2021 01:39:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621402793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=82hgjANDsf7s7PB++Gzt8lZA61h7dq2fz6qO3r2Rmgg=; b=D/sNu9YPXq5Vu3vyfHZOlpiIWfDehmWjARubyAOQOGDogjaPHtJTql6gmdx28Xq0JTkIyi 1z9If5iT4s0c3QmcWSrHdEloUaYP52oHguD0QjLDh7yWBhUpGWmRakP8Xo86SmwbSAYPET gZZhCFEdhRQPOhtuSg9y3ooclaKJHQk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-3SEP5WnjNt6fsWPDHmayjQ-1; Wed, 19 May 2021 01:39:49 -0400 X-MC-Unique: 3SEP5WnjNt6fsWPDHmayjQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BEDA010082E4 for ; Wed, 19 May 2021 05:39:48 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-0.ams2.redhat.com [10.36.114.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D86C85D749; Wed, 19 May 2021 05:39:41 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 56C8F18007A2; Wed, 19 May 2021 07:39:40 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v6 0/9] ui: add vdagent implementation and clipboard support. Date: Wed, 19 May 2021 07:39:31 +0200 Message-Id: <20210519053940.1888907-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 v6: - rebase to latest master - avoid busy-loop when writing to chardev. v5: - use error_report. - error out on bigendian hosts. - rename chardev to 'qemu-vdagent'. - misc minor tweaks. v4: - rebase to latest master. - make spice-protocol a separate build dependency. - update qapi version annotation. - add documentatin for qemu clipboard. - misc little tweaks. 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. v2: - add a bunch of sanity checks. - add proper chunking. - use autofree. 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 | 803 +++++++++++++++++++++++++++++++++++++++++ ui/vnc-clipboard.c | 323 +++++++++++++++++ ui/vnc.c | 21 +- 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, 1795 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