From nobody Tue May 14 22:05:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647982039; cv=none; d=zohomail.com; s=zohoarc; b=ntHm+bmTxF1PvWqyDWMkWX3zOyFY+tvqgUYPgZ6c8HY1tr2gAUjqnR53P8B1LokwDUpZLWUUd6xbqgIh8RUOqV3+Q3THfZx1F2ukdNXPbdmMhSZmqxUXKWAf3+Xn1VV2+R1U9DhRy1Pm3ri7nAPFhFjvYh+RFQZQ8L4kFWDmq34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647982039; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=flJ9rQWR9p2ceXvdNEWIA4Cy0stIlgo8Q8tFGiH6V9g=; b=N2ndeI1WNdybpcP0qkc9zYoNRFszhuqk+/uBKAiGY/1XTdk1s/bKgeQ7ROOc+2vZ16qWEFVTsK+OqxbGJnUxMnA0OwIaUaLGcDcMLV6O8d3kR6M5LEriiyz8naEaG3IK5CodWaXbPrIf5Cd8h9yPubCvvv1MjES3vHTRUxN+FYA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1647982039175590.9060336758439; Tue, 22 Mar 2022 13:47:19 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-322-9h7fh2z4M4yYJr1k5FvbOA-1; Tue, 22 Mar 2022 16:47:16 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08B65899ED3; Tue, 22 Mar 2022 20:47:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E30E42166B2D; Tue, 22 Mar 2022 20:47:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5695C1940368; Tue, 22 Mar 2022 20:47:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9D40E1940340 for ; Tue, 22 Mar 2022 20:47:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 84A4C40D2820; Tue, 22 Mar 2022 20:47:07 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.18.107]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 58F014010A1C; Tue, 22 Mar 2022 20:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647982038; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=flJ9rQWR9p2ceXvdNEWIA4Cy0stIlgo8Q8tFGiH6V9g=; b=cU/9Aej+CPLvqTcR1mXBCX+F75EDUac8WUtjj5grb9IF6bArr8wRlArQWPSsoc8j7u+EJx /gQrk1s5MuQ2uE7afwsCFTPwTZ3+PMPOoUSZrZcA1K5JXHHr7wiaF8y5rFZvywU4jqXjjX toQ8QDPJxDsPtLZfOAsrnkftOhuwBU0= X-MC-Unique: 9h7fh2z4M4yYJr1k5FvbOA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] qemu: add capability for qemu-vdagent chardev Date: Tue, 22 Mar 2022 15:47:04 -0500 Message-Id: <20220322204706.1739412-2-jjongsma@redhat.com> In-Reply-To: <20220322204706.1739412-1-jjongsma@redhat.com> References: <20220322204706.1739412-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1647982039642100001 Content-Type: text/plain; charset="utf-8" Detect whether qemu supports the qemu-vdagent character device. This enables support for copy/paste with VNC graphics. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml | 1 + 6 files changed, 7 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 32980e7330..550463a8e8 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -668,6 +668,7 @@ VIR_ENUM_IMPL(virQEMUCaps, =20 /* 425 */ "blockdev.nbd.tls-hostname", /* QEMU_CAPS_BLOCKDEV_NBD_TLS_H= OSTNAME */ + "chardev.qemu-vdagent", /* QEMU_CAPS_CHARDEV_QEMU_VDAGENT */ ); =20 =20 @@ -1628,6 +1629,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSc= hemaQueries[] =3D { { "set-numa-node/arg-type/+hmat-lb", QEMU_CAPS_NUMA_HMAT }, { "object-add/arg-type/+sev-guest/kernel-hashes", QEMU_CAPS_SEV_GUEST_= KERNEL_HASHES }, { "calc-dirty-rate/arg-type/mode", QEMU_CAPS_DIRTYRATE_MODE }, + { "chardev-add/arg-type/backend/+qemu-vdagent", QEMU_CAPS_CHARDEV_QEMU= _VDAGENT }, }; =20 typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 0a215a11d5..cf2ba9d18d 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -643,6 +643,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ =20 /* 425 */ QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME, /* tls hostname can be overriden = for NBD clients */ + QEMU_CAPS_CHARDEV_QEMU_VDAGENT, /* -chardev qemu-vdagent */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.1.0.x86_64.xml index ba1aecc37e..b15352f5d1 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml @@ -239,6 +239,7 @@ + 6001000 0 43100243 diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml b/tests/qemu= capabilitiesdata/caps_6.2.0.aarch64.xml index 17d563eb5b..0604f975a3 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml @@ -203,6 +203,7 @@ + 6001050 0 61700244 diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.2.0.x86_64.xml index d77907af55..a6c66e091d 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml @@ -241,6 +241,7 @@ + 6002000 0 43100244 diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_7.0.0.x86_64.xml index 0f34a341af..7ec33e8496 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml @@ -244,6 +244,7 @@ + 6002050 0 43100243 --=20 2.35.1 From nobody Tue May 14 22:05:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647982037; cv=none; d=zohomail.com; s=zohoarc; b=ee+N+2ebkqocWDa73KGXvl+Mo92o2LG80ikfMMnSTzNJ4tQ/Obshi44sSEQnerJlCj/jTQeKWlrrW+Fmt2xaZL64otWunyp9Bmy4g+7UNNh0tGZOQ27exWEfiWspHWKwDZ9qUyJ33iG//6W54rClUvbJBEf4kaDUCtYucuSXwCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647982037; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IaoRpxIHiayDNK0HySFFB53gNaq8oqBl8eY26tyO/d8=; b=d/Y+FeaqHMfvM63rL11A0STgURUyF2a/2TgxoOSF8RSt+wlO82qVb6pKln2KfYgEq//zeDTjesG3ccDcHh0zlgqJALsEyER3Wha4uape/t8iiI4mAcXP7iLt+bed1pneZXP2H658bBIJiUumt7vQLZVpwpg6SfWbUylAKoEtjUs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1647982037804115.8487928693387; Tue, 22 Mar 2022 13:47:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-146-VwCMQdmDP3u4yGf6mI0pSg-1; Tue, 22 Mar 2022 16:47:16 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 61E7B1066562; Tue, 22 Mar 2022 20:47:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9F247AC8; Tue, 22 Mar 2022 20:47:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A541B1940340; Tue, 22 Mar 2022 20:47:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D84751949762 for ; Tue, 22 Mar 2022 20:47:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CD21D400E130; Tue, 22 Mar 2022 20:47:07 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.18.107]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9857640D2822; Tue, 22 Mar 2022 20:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647982038; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=IaoRpxIHiayDNK0HySFFB53gNaq8oqBl8eY26tyO/d8=; b=DMagoux5ev4KKfvyZ/WOiZBFAmeULTD60YEmlhrT46OGemxaOKDK55y54e2etkvN+3G84m P1O0VDlm1UBc7xTBIx8DOELBeSGUAvjU+G8CGPY9OXVaJeltTSodRigcP+VJowwH/EcQU+ yr18EEOqn1tDs4MSbgeRqnr43wmRcfk= X-MC-Unique: VwCMQdmDP3u4yGf6mI0pSg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] conf: add qemu-vdagent channel Date: Tue, 22 Mar 2022 15:47:05 -0500 Message-Id: <20220322204706.1739412-3-jjongsma@redhat.com> In-Reply-To: <20220322204706.1739412-1-jjongsma@redhat.com> References: <20220322204706.1739412-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: fail (Signature date is -1 seconds in the future.) X-ZM-MESSAGEID: 1647982054837100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Add the ability to configure a qemu-vdagent in guest domains. This device is similar to the spice vdagent channel except that qemu handles the spice-vdagent protocol messages itself rather than routing them over a spice protocol channel. The qemu-vdagent device has two notable configuration options which determine whether qemu will handle particular vdagent features: 'clipboard' and 'mouse'. The 'clipboard' option allows qemu to synchronize its internal clipboard manager with the guest clipboard, which enables client<->guest clipboard synchronization for non-spice guests such as vnc. The 'mouse' option allows absolute mouse positioning to be sent over the vdagent channel rather than using a usb or virtio tablet device. These features are configured with element. Signed-off-by: Jonathon Jongsma --- docs/formatdomain.rst | 17 +++++++++++ src/conf/domain_conf.c | 49 +++++++++++++++++++++++++++++-- src/conf/domain_conf.h | 7 +++++ src/conf/domain_validate.c | 1 + src/conf/schemas/domaincommon.rng | 11 +++++++ 5 files changed, 83 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d188de4858..e00015d93e 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6660,6 +6660,23 @@ types have different ``target`` attributes. ``name=3D'com.redhat.spice.0'``. The optional ``address`` element can t= ie the channel to a particular ``type=3D'virtio-serial'`` controller. :since:`= Since 0.8.8` +``qemu-vdagent`` + Paravirtualized qemu vdagent channel. This channel implements the SPICE + vdagent protocol, but is handled internally by qemu and therefore does = not + require a SPICE graphics device. Like the spicevmc channel, the ``targe= t`` + element must be present, with attribute ``type=3D'virtio'``; an optional + attribute ``name`` controls how the guest will have access to the chann= el, + and defaults to ``name=3D'com.redhat.spice.0'``. The optional ``address= `` + element can tie the channel to a particular ``type=3D'virtio-serial'`` + controller. Certain vdagent protocol features can by enabled or disabled + using the ``source`` element. The ``mouse`` attribute allows absolute m= ouse + events to go through the vdagent rather than using a usb or virito tabl= et + device. The ``clipboard`` attribute allows the guest's clipboard to be + synchronized with the qemu clipboard manager. This can enable copy and = paste + between a guest and a client when using a VNC `graphics device + <#elementsGraphics>`__ (when using a VNC client that supports the copy/= paste + feature) or other graphics types that support the qemu clipboard manage= r. + :since:`Since 8.2.0` =20 :anchor:`` =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 153954a0b0..3b09b0389f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -713,6 +713,7 @@ VIR_ENUM_IMPL(virDomainChr, "spicevmc", "spiceport", "nmdm", + "qemu-vdagent", ); =20 VIR_ENUM_IMPL(virDomainChrTcpProtocol, @@ -2698,6 +2699,7 @@ virDomainChrSourceDefGetPath(virDomainChrSourceDef *c= hr) case VIR_DOMAIN_CHR_TYPE_STDIO: case VIR_DOMAIN_CHR_TYPE_SPICEVMC: case VIR_DOMAIN_CHR_TYPE_SPICEPORT: + case VIR_DOMAIN_CHR_TYPE_QEMU_VDAGENT: case VIR_DOMAIN_CHR_TYPE_LAST: return NULL; } @@ -2807,6 +2809,11 @@ virDomainChrSourceDefCopy(virDomainChrSourceDef *des= t, dest->data.spiceport.channel =3D g_strdup(src->data.spiceport.chan= nel); break; =20 + case VIR_DOMAIN_CHR_TYPE_QEMU_VDAGENT: + dest->data.qemuVdagent.clipboard =3D src->data.qemuVdagent.clipboa= rd; + dest->data.qemuVdagent.mouse =3D src->data.qemuVdagent.mouse; + break; + case VIR_DOMAIN_CHR_TYPE_NULL: case VIR_DOMAIN_CHR_TYPE_VC: case VIR_DOMAIN_CHR_TYPE_STDIO: @@ -2888,6 +2895,10 @@ virDomainChrSourceDefIsEqual(const virDomainChrSourc= eDef *src, case VIR_DOMAIN_CHR_TYPE_SPICEVMC: return src->data.spicevmc =3D=3D tgt->data.spicevmc; =20 + case VIR_DOMAIN_CHR_TYPE_QEMU_VDAGENT: + return src->data.qemuVdagent.clipboard =3D=3D tgt->data.qemuVdagen= t.clipboard && + src->data.qemuVdagent.mouse =3D=3D tgt->data.qemuVdagent.mouse; + case VIR_DOMAIN_CHR_TYPE_NULL: case VIR_DOMAIN_CHR_TYPE_VC: case VIR_DOMAIN_CHR_TYPE_STDIO: @@ -11325,6 +11336,16 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDe= f *def, def->data.nmdm.slave =3D virXMLPropString(sources[0], "slave"); break; =20 + case VIR_DOMAIN_CHR_TYPE_QEMU_VDAGENT: + if (virXMLPropTristateSwitch(sources[0], "mouse", VIR_XML_PROP= _NONE, + &def->data.qemuVdagent.mouse) < 0) + goto error; + + if (virXMLPropTristateSwitch(sources[0], "clipboard", VIR_XML_= PROP_NONE, + &def->data.qemuVdagent.clipboard)= < 0) + goto error; + break; + case VIR_DOMAIN_CHR_TYPE_LAST: case VIR_DOMAIN_CHR_TYPE_NULL: case VIR_DOMAIN_CHR_TYPE_VC: @@ -12418,6 +12439,7 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDe= f *def, g_autofree char *websocketGenerated =3D virXMLPropString(node, "websoc= ketGenerated"); g_autofree char *autoport =3D virXMLPropString(node, "autoport"); xmlNodePtr audioNode; + xmlNodePtr clipboardNode; VIR_XPATH_NODE_AUTORESTORE(ctxt) =20 if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0) @@ -12479,6 +12501,13 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsD= ef *def, def->type) < 0) return -1; =20 + if ((clipboardNode =3D virXPathNode("./clipboard", ctxt))) { + if (virXMLPropTristateBool(clipboardNode, "copypaste", + VIR_XML_PROP_REQUIRED, + &def->data.vnc.copypaste) < 0) + return -1; + } + return 0; } =20 @@ -24989,6 +25018,20 @@ virDomainChrSourceDefFormat(virBuffer *buf, /* nada */ break; =20 + case VIR_DOMAIN_CHR_TYPE_QEMU_VDAGENT: + if (def->data.qemuVdagent.mouse !=3D VIR_TRISTATE_SWITCH_ABSENT || + def->data.qemuVdagent.clipboard !=3D VIR_TRISTATE_SWITCH_ABSEN= T) { + virBufferAddLit(buf, "data.qemuVdagent.clipboard !=3D VIR_TRISTATE_SWITCH_A= BSENT) + virBufferEscapeString(buf, " clipboard=3D'%s'", + virTristateSwitchTypeToString(def->d= ata.qemuVdagent.clipboard)); + if (def->data.qemuVdagent.mouse !=3D VIR_TRISTATE_SWITCH_ABSEN= T) + virBufferEscapeString(buf, " mouse=3D'%s'", + virTristateSwitchTypeToString(def->d= ata.qemuVdagent.mouse)); + virBufferAddLit(buf, "/>\n"); + } + break; + case VIR_DOMAIN_CHR_TYPE_PTY: case VIR_DOMAIN_CHR_TYPE_DEV: case VIR_DOMAIN_CHR_TYPE_FILE: @@ -25074,7 +25117,6 @@ virDomainChrSourceDefFormat(virBuffer *buf, virBufferEscapeString(buf, "\n", def->data.spiceport.channel); break; - } =20 if (def->logfile) { @@ -25204,7 +25246,6 @@ virDomainChrTargetDefFormat(virBuffer *buf, return 0; } =20 - static int virDomainChrDefFormat(virBuffer *buf, virDomainChrDef *def, @@ -26630,6 +26671,10 @@ virDomainGraphicsDefFormat(virBuffer *buf, if (def->data.vnc.audioId > 0) virBufferAsprintf(buf, "