From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741711381; cv=none; d=zohomail.com; s=zohoarc; b=ik79rAVio8fXeBeswKSli3qKW8sJNZi6VdboX9u4UmcyiFP68Pzpp7lCO7Sgze4zNtPQ5K1VVEr/OULo3bvD41qT8Au8pBfGm1KN6jAnrX44ZkxhwrWuNrit/I8JD8VVDH8eIQxVYx2etbBLjUVrSv0DV1epE03l5Ch32iSeknY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741711381; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JDvthftYImZvUatd7YB84HSv4G5oqXk+FsQdavEoRq0=; b=QNXVjcOGYLKuQCRjWdRfuQiqCg+GuRkuRm6IZPijpflOvCeVm2yd9Ew9wyWUKC7jU3SvjxFIPaA08ju9AcjzFAj/NbTZtoySujUGSxuCC9Dww/0j/o/C18CiB0JiTsVhkHCrbw5oSPbeLDo83K0QO1P8OzAqq8Lwl4/jS5Kk0OQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741711381866785.0699404211621; Tue, 11 Mar 2025 09:43:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts21l-0003cS-71; Tue, 11 Mar 2025 12:00:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21T-0003Fj-JH for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21K-0005KW-UQ for qemu-devel@nongnu.org; Tue, 11 Mar 2025 11:59:59 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-510-WgD34DIuOvaxoA0j1rHUdg-1; Tue, 11 Mar 2025 11:59:50 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4ABAB1955F67 for ; Tue, 11 Mar 2025 15:59:49 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 05B6C195608F; Tue, 11 Mar 2025 15:59:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708792; 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: in-reply-to:in-reply-to:references:references; bh=JDvthftYImZvUatd7YB84HSv4G5oqXk+FsQdavEoRq0=; b=gy4GOSVLgIvBufw8HNwLlUhYgw6ov729RmmcbQQfmkfjUP5a1rx+nX9jb0W0EiWPM85rFn wM26qHZ0loqMopeOcic4EE+oedMiXOYtXQCVFP6NrsJYIMk0Pd2Z9XwYCYCSf7I5K9UW9e LxR8lfcgzt0m3EIApZpZ6faWUMzp/hM= X-MC-Unique: WgD34DIuOvaxoA0j1rHUdg-1 X-Mimecast-MFC-AGG-ID: WgD34DIuOvaxoA0j1rHUdg_1741708789 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 01/10] ui/gtk: warn if setting the clipboard failed Date: Tue, 11 Mar 2025 19:59:23 +0400 Message-ID: <20250311155932.1472092-2-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741711384099019000 From: Marc-Andr=C3=A9 Lureau Just in case. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/gtk-clipboard.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/gtk-clipboard.c b/ui/gtk-clipboard.c index 8d8a636fd1..65d89ec601 100644 --- a/ui/gtk-clipboard.c +++ b/ui/gtk-clipboard.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/main-loop.h" =20 #include "ui/gtk.h" @@ -95,11 +96,13 @@ static void gd_clipboard_update_info(GtkDisplayState *g= d, gtk_clipboard_clear(gd->gtkcb[s]); if (targets) { gd->cbowner[s] =3D true; - gtk_clipboard_set_with_data(gd->gtkcb[s], - targets, n_targets, - gd_clipboard_get_data, - gd_clipboard_clear, - gd); + if (!gtk_clipboard_set_with_data(gd->gtkcb[s], + targets, n_targets, + gd_clipboard_get_data, + gd_clipboard_clear, + gd)) { + warn_report("Failed to set GTK clipboard"); + } =20 gtk_target_table_free(targets, n_targets); } --=20 2.47.0 From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741711536; cv=none; d=zohomail.com; s=zohoarc; b=k8pkQiopReIKE4d/r/vUt6eyky3SSlPRAHxpHH7k8tqwI9v6t57hw1Fl7DhNmBSXI4vg5Pu/QiBm+8WjM48HDxv6B6od9b2ZFijJ82ScM6A/uG3JYNeVcMRSNVGcysZZfBN6k5EH1bPgvZjbz6PLagb87AchCDShj8o/1ecOe9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741711536; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=d70VeyWE0KUag6YtYRbbTqQtQhZMWjZwKgRT9dpWuug=; b=B9OW5NIElDANHkxqTXkV3vNW8kIsbrfBlFjFnvqI8DuzwzGdONCoQo9FJRhgBd0HIrO0HCf0MeqxH3PTF28q67weIZjx1tzwSHojH+LY7dhi+JAu1naqWI3ylLguFNMMwiPvmENmwOogR7e0g4XRIRTYTlS++6Q9+ILl7kVPKlQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741711536081825.9170043667142; Tue, 11 Mar 2025 09:45:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts21y-0003rY-Jn; Tue, 11 Mar 2025 12:00:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21U-0003GY-Qs for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21R-0005Lu-AJ for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:03 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-kkF1bIXGOImGVPePgpIKCQ-1; Tue, 11 Mar 2025 11:59:58 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 89EAD180025E for ; Tue, 11 Mar 2025 15:59:57 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7F1A51800373; Tue, 11 Mar 2025 15:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708799; 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: in-reply-to:in-reply-to:references:references; bh=d70VeyWE0KUag6YtYRbbTqQtQhZMWjZwKgRT9dpWuug=; b=PH9mNzOndhPQwsq6crhUyM7ywm0zMP39BI6Jrb39fR4AsiuHKpewblPKwVOkz+zEPmPdjZ hTSwoGr1yM32W4Z0IbyAG0YI6zwKmehkRvqgoYApXvxglY7vU9E+xVDEMQWvd3rPixmFWt cYHQhYGsduP82GfqVqPHNqWr/Fey/dg= X-MC-Unique: kkF1bIXGOImGVPePgpIKCQ-1 X-Mimecast-MFC-AGG-ID: kkF1bIXGOImGVPePgpIKCQ_1741708797 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 02/10] ui/clipboard: use int for selection field Date: Tue, 11 Mar 2025 19:59:24 +0400 Message-ID: <20250311155932.1472092-3-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741711537297019100 From: Marc-Andr=C3=A9 Lureau This allows to use a VMSTATE_INT32 field for migration purposes. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/clipboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ui/clipboard.h b/include/ui/clipboard.h index ab6acdbd8a..14b6099e73 100644 --- a/include/ui/clipboard.h +++ b/include/ui/clipboard.h @@ -112,7 +112,7 @@ struct QemuClipboardNotify { struct QemuClipboardInfo { uint32_t refcount; QemuClipboardPeer *owner; - QemuClipboardSelection selection; + int selection; /* QemuClipboardSelection */ bool has_serial; uint32_t serial; struct { --=20 2.47.0 From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741711701; cv=none; d=zohomail.com; s=zohoarc; b=jFbl+c5yForMWG+3I4zj2Oi5cAdcJs0FqZjJOh/V7Qqfa9dblFRJZXEeTG2Tu7hzYNzGbAUCgjGy7UPvm6NRXoN8R/6381cGjL7P0HUedoxBSQcQFvI2RKqJMczS7tMBeSuTdaJpFBeqfsMmFsT7TOH+vm+EQBUmuR4nuJf/C24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741711701; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LGNnlMv41hT3Kd3yKEMsx9Cgz6Xb69s2bh36zUad/hU=; b=VJnSJ6RLysFqmuqLqtB3bXHw+YDFphxJo2MobWQ6hxlBFElhS6FYVxWzA0yLWwAMR9HNRYVVKMHkZW5lX1il6aRMANPi72397pD7Enjzc6cssEIU2kroCJcJCmwMuMX5hlhvZCy4H/V5sKRtSEtORBz1ulUXY9NA/b6jm/bpNbs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741711701816356.1343767033435; Tue, 11 Mar 2025 09:48:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts231-0004ZY-2b; Tue, 11 Mar 2025 12:01:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21e-0003S5-Gn for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21b-0005aF-2M for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:12 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-82-FHBKeHQ3ODmQH9H6gACc3g-1; Tue, 11 Mar 2025 12:00:06 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B9040195608F for ; Tue, 11 Mar 2025 16:00:05 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8A7A11801747; Tue, 11 Mar 2025 16:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708809; 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: in-reply-to:in-reply-to:references:references; bh=LGNnlMv41hT3Kd3yKEMsx9Cgz6Xb69s2bh36zUad/hU=; b=HISSYq4drQIH/+7FOq//0FNDwPmOiaVU9eN1Cq7tUIcco7RdRTjsSlDnZhLemKMYq20MB2 ekTGqwDPsEmTbghoVuPgNq4FFm4VfFUmJoO0d8Rh9sv2+viPgW0QtNHo3/4flmU6QxUbZJ YDtgAVYM5Op0YAHOeMcdGmAieFOZkow= X-MC-Unique: FHBKeHQ3ODmQH9H6gACc3g-1 X-Mimecast-MFC-AGG-ID: FHBKeHQ3ODmQH9H6gACc3g_1741708805 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 03/10] ui/clipboard: split out QemuClipboardContent Date: Tue, 11 Mar 2025 19:59:25 +0400 Message-ID: <20250311155932.1472092-4-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741711703677019100 From: Marc-Andr=C3=A9 Lureau Allows to use VMSTATE STRUCT in following migration support patch. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/clipboard.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/include/ui/clipboard.h b/include/ui/clipboard.h index 14b6099e73..88cfff91ef 100644 --- a/include/ui/clipboard.h +++ b/include/ui/clipboard.h @@ -25,6 +25,7 @@ typedef enum QemuClipboardSelection QemuClipboardSelectio= n; typedef struct QemuClipboardPeer QemuClipboardPeer; typedef struct QemuClipboardNotify QemuClipboardNotify; typedef struct QemuClipboardInfo QemuClipboardInfo; +typedef struct QemuClipboardContent QemuClipboardContent; =20 /** * enum QemuClipboardType @@ -97,6 +98,24 @@ struct QemuClipboardNotify { }; }; =20 + +/** + * struct QemuClipboardContent + * + * @available: whether the data is available + * @requested: whether the data was requested + * @size: the size of the @data + * @data: the clipboard data + * + * Clipboard content. + */ +struct QemuClipboardContent { + bool available; + bool requested; + uint32_t size; + void *data; +}; + /** * struct QemuClipboardInfo * @@ -115,12 +134,7 @@ struct QemuClipboardInfo { int selection; /* QemuClipboardSelection */ bool has_serial; uint32_t serial; - struct { - bool available; - bool requested; - size_t size; - void *data; - } types[QEMU_CLIPBOARD_TYPE__COUNT]; + QemuClipboardContent types[QEMU_CLIPBOARD_TYPE__COUNT]; }; =20 /** --=20 2.47.0 From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741711448; cv=none; d=zohomail.com; s=zohoarc; b=QzWzXoB24uANPTrQAGiqL3rUPNcvweKV12JTY1NVheZPiyHuxcOsazRbb8C73vtfMCPdEQ/nOJIUada2SCc6bgN/6H1N0xosu6uhX/6EZLsaUR5b29h/JUfrEJAUKAwy02o3kta+bv0vhfoXzvQ3UnI0DQDuLKEnCVFl0wXBhqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741711448; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v6uonVcLAUMyD9lvZqKLE1g4T6gzLIaowPGxjxg0WN8=; b=Q3LTW1qijDSRJJvKbDsFHVpDMzeLobchSLbCrLKi+BE5IyzfUyYxba7AdgQO6UZs2rjgHie3zr7HqcxH1q3Yy0LhKud2bd5d2EW0J67U21cHA4+7cKUoDSzgVG1ZvWVNLfn1v6IiW344ZznLfQFr1uN+E1xi+KEw5v137AICb4E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741711448415370.0776103404311; Tue, 11 Mar 2025 09:44:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts22p-0004GZ-7D; Tue, 11 Mar 2025 12:01:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21l-0003de-Dg for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21i-0005bp-Rk for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:21 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-49-ANgxlS43PsOFKqL_UFTaBg-1; Tue, 11 Mar 2025 12:00:15 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B67C7195608D for ; Tue, 11 Mar 2025 16:00:13 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C2F1F1828A95; Tue, 11 Mar 2025 16:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708816; 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: in-reply-to:in-reply-to:references:references; bh=v6uonVcLAUMyD9lvZqKLE1g4T6gzLIaowPGxjxg0WN8=; b=VqUQLkBb2CD0uke0pAWTy6TwZy+Snmwdf2HoEkbfktMMh7F7lY/PZ0Cp08QZpB2XuP7Ahr DVfaz6v2eI8oKOQWg7mX+ZleF/4XQcU9VIsNKjyCPlUJQOyY6o8GC3ZwsNQfihMm+cGgKl 8oQfLCf0IL1rdK5aI2dFFGnupv6eY4M= X-MC-Unique: ANgxlS43PsOFKqL_UFTaBg-1 X-Mimecast-MFC-AGG-ID: ANgxlS43PsOFKqL_UFTaBg_1741708814 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 04/10] ui/clipboard: add vmstate_cbinfo Date: Tue, 11 Mar 2025 19:59:26 +0400 Message-ID: <20250311155932.1472092-5-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741711450241019000 From: Marc-Andr=C3=A9 Lureau Add a VMStateDescriptor for QemuClipboardInfo. Each clipboard owner will have to save its QemuClipboardInfo and reregister its owned clipboard after loading. (the global cbinfo has only pointers to owners, so it can't restore the relation with its owner if it was to handle migration) Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/clipboard.h | 3 +++ ui/clipboard.c | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/include/ui/clipboard.h b/include/ui/clipboard.h index 88cfff91ef..62a96ce9ff 100644 --- a/include/ui/clipboard.h +++ b/include/ui/clipboard.h @@ -2,6 +2,7 @@ #define QEMU_CLIPBOARD_H =20 #include "qemu/notify.h" +#include "migration/vmstate.h" =20 /** * DOC: Introduction @@ -27,6 +28,8 @@ typedef struct QemuClipboardNotify QemuClipboardNotify; typedef struct QemuClipboardInfo QemuClipboardInfo; typedef struct QemuClipboardContent QemuClipboardContent; =20 +extern const VMStateDescription vmstate_cbinfo; + /** * enum QemuClipboardType * diff --git a/ui/clipboard.c b/ui/clipboard.c index 132086eb13..f5db60c63d 100644 --- a/ui/clipboard.c +++ b/ui/clipboard.c @@ -7,6 +7,32 @@ static NotifierList clipboard_notifiers =3D =20 static QemuClipboardInfo *cbinfo[QEMU_CLIPBOARD_SELECTION__COUNT]; =20 +static const VMStateDescription vmstate_cbcontent =3D { + .name =3D "clipboard/content", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (const VMStateField[]) { + VMSTATE_BOOL(available, QemuClipboardContent), + VMSTATE_BOOL(requested, QemuClipboardContent), + VMSTATE_UINT32(size, QemuClipboardContent), + VMSTATE_VBUFFER_ALLOC_UINT32(data, QemuClipboardContent, 0, 0, siz= e), + VMSTATE_END_OF_LIST() + } +}; + +const VMStateDescription vmstate_cbinfo =3D { + .name =3D "clipboard", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (const VMStateField[]) { + VMSTATE_INT32(selection, QemuClipboardInfo), + VMSTATE_BOOL(has_serial, QemuClipboardInfo), + VMSTATE_UINT32(serial, QemuClipboardInfo), + VMSTATE_STRUCT_ARRAY(types, QemuClipboardInfo, QEMU_CLIPBOARD_TYPE= __COUNT, 0, vmstate_cbcontent, QemuClipboardContent), + VMSTATE_END_OF_LIST() + } +}; + void qemu_clipboard_peer_register(QemuClipboardPeer *peer) { notifier_list_add(&clipboard_notifiers, &peer->notifier); --=20 2.47.0 From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741710381; cv=none; d=zohomail.com; s=zohoarc; b=XwHDh9t3H4v+WjO20Wfk2srJDDwBp43CC8Fb2CAcbpMN7vjBLRv2PSzqdywIDemMRO2gJcxt9MFf6FwpdbxwxhOFF94bflaj1gsdQdCvpGOlvsDtGkqBldfh9sGWsE+pA7sQ8R+q02UwR/TfV23t23lqLGPu2XyT2wpLCOzBHnA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741710381; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ijg+IbW5ZDUV9XuY1BEmdaIm+JELa5s99Z8Jg9OqbXc=; b=ngGdOFkUpyP6wnucwSrIQdBrhuWjwlrQhHlN+v+itptGuWlLVPB3ITbwB7TOdeulZcNM0J9bK7iWwpCTwF/B/QSxpblGi0TuuBsMff665RmECEsXVwc1DVUxOoAOEYutbh9E7N0OnJehq39zW3MFU3AfXmKa096rbczHNdzmdEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741710381622612.7053389608793; Tue, 11 Mar 2025 09:26:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts23I-0004wx-H6; Tue, 11 Mar 2025 12:01:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21v-0003pc-31 for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21q-0005eN-S2 for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:30 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-_BW9SrojOLSI8a8NyiqnWg-1; Tue, 11 Mar 2025 12:00:22 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AB1611955D80 for ; Tue, 11 Mar 2025 16:00:21 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C1045195608F; Tue, 11 Mar 2025 16:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708826; 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: in-reply-to:in-reply-to:references:references; bh=ijg+IbW5ZDUV9XuY1BEmdaIm+JELa5s99Z8Jg9OqbXc=; b=Z4R5m0/2zmRU04SzPt0wWem/urQYoP8kkBRNbAhBtsmXtHG2ITY3mNNEr9EboWNRzhaOSy julYyD6rWpRpsnbT9gcuJui/Ycxo+8r4BUVbnyGdx7oRj1lPT4iHlcejY9eUvJy5IQPQ9c qSSV4k4zwVEKz/n1i1jAUk9RbMg2lYE= X-MC-Unique: _BW9SrojOLSI8a8NyiqnWg-1 X-Mimecast-MFC-AGG-ID: _BW9SrojOLSI8a8NyiqnWg_1741708821 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 05/10] ui/clipboard: delay clipboard update when not running Date: Tue, 11 Mar 2025 19:59:27 +0400 Message-ID: <20250311155932.1472092-6-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741710383838019100 From: Marc-Andr=C3=A9 Lureau When VM is paused, we shouldn't notify of clipboard changes, similar to how input are being treated. On unsuspend, notify of the current state. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/clipboard.c | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/ui/clipboard.c b/ui/clipboard.c index f5db60c63d..ec00a0b8ec 100644 --- a/ui/clipboard.c +++ b/ui/clipboard.c @@ -1,4 +1,5 @@ #include "qemu/osdep.h" +#include "system/runstate.h" #include "ui/clipboard.h" #include "trace.h" =20 @@ -7,6 +8,10 @@ static NotifierList clipboard_notifiers =3D =20 static QemuClipboardInfo *cbinfo[QEMU_CLIPBOARD_SELECTION__COUNT]; =20 +static VMChangeStateEntry *cb_change_state_entry =3D NULL; + +static bool cb_reset_serial_on_resume =3D false; + static const VMStateDescription vmstate_cbcontent =3D { .name =3D "clipboard/content", .version_id =3D 0, @@ -33,8 +38,32 @@ const VMStateDescription vmstate_cbinfo =3D { } }; =20 +static void qemu_clipboard_change_state(void *opaque, bool running, RunSta= te state) +{ + int i; + + if (!running) { + return; + } + + if (cb_reset_serial_on_resume) { + qemu_clipboard_reset_serial(); + } + + for (i =3D 0; i < QEMU_CLIPBOARD_SELECTION__COUNT; i++) { + if (cbinfo[i]) { + qemu_clipboard_update(cbinfo[i]); + } + } + +} + void qemu_clipboard_peer_register(QemuClipboardPeer *peer) { + if (cb_change_state_entry =3D=3D NULL) { + cb_change_state_entry =3D qemu_add_vm_change_state_handler(qemu_cl= ipboard_change_state, NULL); + } + notifier_list_add(&clipboard_notifiers, &peer->notifier); } =20 @@ -109,7 +138,9 @@ void qemu_clipboard_update(QemuClipboardInfo *info) } } =20 - notifier_list_notify(&clipboard_notifiers, ¬ify); + if (runstate_is_running() || runstate_check(RUN_STATE_SUSPENDED)) { + notifier_list_notify(&clipboard_notifiers, ¬ify); + } =20 if (cbinfo[info->selection] !=3D info) { qemu_clipboard_info_unref(cbinfo[info->selection]); @@ -189,7 +220,12 @@ void qemu_clipboard_reset_serial(void) info->serial =3D 0; } } - notifier_list_notify(&clipboard_notifiers, ¬ify); + + if (runstate_is_running() || runstate_check(RUN_STATE_SUSPENDED)) { + notifier_list_notify(&clipboard_notifiers, ¬ify); + } else { + cb_reset_serial_on_resume =3D true; + } } =20 void qemu_clipboard_set_data(QemuClipboardPeer *peer, --=20 2.47.0 From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741711433; cv=none; d=zohomail.com; s=zohoarc; b=CbmtYWFK2yvWvOKI8DvRs8AIZpDUvaxj4X1LQSlBnpgIH4cdSyRKs93e40Wcm5KblVfM0L0MBumYPmMAboH3Oq9AIr6B9pxKQOEcGhypLV6KucIJcIdjG230GqM0ZMpwUtRMIgz91ciKOd/KYANakEa0jg7tdOW6VjKNP8NIp+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741711433; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YQesjGLpbXftEhKF+ctDOBJc7kjjZoBOELRoqqSKbo8=; b=GVOl3j5CPHxATusbB+94Od/ojWVBtb2guYxG0cVC0Bx+HLsPqdYYgtY9VZgfb6JQuwgdvstjyA8gdOhpOvCA6xfJncuR3m+yNqGoeBjCPNxiiAnM+RCHV1o61rJfEuAckaGkcwuR2K+dTQoSElqA6q+ejBSvepvT/ndleaGGvSA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741711433288890.7973097457067; Tue, 11 Mar 2025 09:43:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts253-000788-EY; Tue, 11 Mar 2025 12:03:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21z-0003s3-0Y for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts21x-0005f7-4q for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:34 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-498-KjR0CLtIP9iXbj5xnEs6rw-1; Tue, 11 Mar 2025 12:00:30 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C2FB0180AF67 for ; Tue, 11 Mar 2025 16:00:29 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D66AC1828A93; Tue, 11 Mar 2025 16:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708832; 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: in-reply-to:in-reply-to:references:references; bh=YQesjGLpbXftEhKF+ctDOBJc7kjjZoBOELRoqqSKbo8=; b=RMgdXA3HFGBiwW8kVb4ruyPN3QRdmdO2yEn6pfwNEMuSWad2OAD+eZIjO24KBnIhTJdzHk UI/AVO8I1283JO3LDQj6eEdZ4M+bbL83wPnWzpSJB7vbV23da8+7c4FdGfhrlG5DWSrBj5 m9jot9XQMU7PPSNifL91LSvDgohm+FI= X-MC-Unique: KjR0CLtIP9iXbj5xnEs6rw-1 X-Mimecast-MFC-AGG-ID: KjR0CLtIP9iXbj5xnEs6rw_1741708829 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 06/10] ui/vdagent: replace Buffer with GByteArray Date: Tue, 11 Mar 2025 19:59:28 +0400 Message-ID: <20250311155932.1472092-7-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741711435219019100 From: Marc-Andr=C3=A9 Lureau Buffer is slightly more advanced than GByteArray, since it has a cursor/position. But vdagent code doesn't need it. This simplify a bit the code, and migration state. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/ui/vdagent.c b/ui/vdagent.c index 724eff972f..ddd8990318 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -47,7 +47,7 @@ struct VDAgentChardev { uint32_t msgsize; uint8_t *xbuf; uint32_t xoff, xsize; - Buffer outbuf; + GByteArray *outbuf; =20 /* mouse */ DeviceState mouse_dev; @@ -142,16 +142,16 @@ static void vdagent_send_buf(VDAgentChardev *vd) { uint32_t len; =20 - while (!buffer_empty(&vd->outbuf)) { + while (vd->outbuf->len) { len =3D qemu_chr_be_can_write(CHARDEV(vd)); if (len =3D=3D 0) { return; } - if (len > vd->outbuf.offset) { - len =3D vd->outbuf.offset; + if (len > vd->outbuf->len) { + len =3D vd->outbuf->len; } - qemu_chr_be_write(CHARDEV(vd), vd->outbuf.buffer, len); - buffer_advance(&vd->outbuf, len); + qemu_chr_be_write(CHARDEV(vd), vd->outbuf->data, len); + g_byte_array_remove_range(vd->outbuf, 0, len); } } =20 @@ -166,7 +166,7 @@ static void vdagent_send_msg(VDAgentChardev *vd, VDAgen= tMessage *msg) =20 msg->protocol =3D VD_AGENT_PROTOCOL; =20 - if (vd->outbuf.offset + msgsize > VDAGENT_BUFFER_LIMIT) { + if (vd->outbuf->len + msgsize > VDAGENT_BUFFER_LIMIT) { error_report("buffer full, dropping message"); return; } @@ -177,9 +177,8 @@ static void vdagent_send_msg(VDAgentChardev *vd, VDAgen= tMessage *msg) if (chunk.size > 1024) { chunk.size =3D 1024; } - buffer_reserve(&vd->outbuf, sizeof(chunk) + chunk.size); - buffer_append(&vd->outbuf, &chunk, sizeof(chunk)); - buffer_append(&vd->outbuf, msgbuf + msgoff, chunk.size); + g_byte_array_append(vd->outbuf, (void*)&chunk, sizeof (chunk)); + g_byte_array_append(vd->outbuf, msgbuf + msgoff, chunk.size); msgoff +=3D chunk.size; } vdagent_send_buf(vd); @@ -859,7 +858,7 @@ static void vdagent_disconnect(VDAgentChardev *vd) { trace_vdagent_disconnect(); =20 - buffer_reset(&vd->outbuf); + g_byte_array_set_size(vd->outbuf, 0); vdagent_reset_bufs(vd); vd->caps =3D 0; if (vd->mouse_hs) { @@ -920,7 +919,7 @@ static void vdagent_chr_init(Object *obj) { VDAgentChardev *vd =3D QEMU_VDAGENT_CHARDEV(obj); =20 - buffer_init(&vd->outbuf, "vdagent-outbuf"); + vd->outbuf =3D g_byte_array_new(); error_setg(&vd->migration_blocker, "The vdagent chardev doesn't yet support migration"); } @@ -934,7 +933,7 @@ static void vdagent_chr_fini(Object *obj) if (vd->mouse_hs) { qemu_input_handler_unregister(vd->mouse_hs); } - buffer_free(&vd->outbuf); + g_clear_pointer(&vd->outbuf, g_byte_array_unref); } =20 static const TypeInfo vdagent_chr_type_info =3D { --=20 2.47.0 From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741710112; cv=none; d=zohomail.com; s=zohoarc; b=f/+Cy+rq0+VmKmV3Yhoj2cZT+w0tftK1/BPoPith4wz56MDfxwuQgaOGftxy1GGh3QaqYxLrBTrzA73r/RNzYoYLhpN39BBw/olUwF9Ds3gkbVJp/kDTGxCZn72yKRlVVnjLLOrbDOmoemYu9ZCRcD1OXl8rKGtM59exppYCBsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741710112; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1nWszQmqouRumPlbII1dV2LPkhLnNaMA7EcBowO/kG4=; b=a/52T4lJiZhRp2ZybnaHN5z1DgR77+mgzPS+IxrYMvrfBmnOrYpKW1+Zw6Q2cfbYNzPV2wksmb9+AXHZeRz9NxdSeT5RY6BCYJDRBIphWHnqbGBr7m6Ey9ZNTNU45rKJ7PmhhA3XBWU4/0pkOt/nt2gQDlxjiP1wjUVZdmJghwc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174171011216088.15394021060831; Tue, 11 Mar 2025 09:21:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts255-0007D2-Gx; Tue, 11 Mar 2025 12:03:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts22A-00041M-64 for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts226-0005hY-Mu for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:45 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-362-q-A9w9HrP1evJoX2FFhbxg-1; Tue, 11 Mar 2025 12:00:38 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C589A1800875 for ; Tue, 11 Mar 2025 16:00:37 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BB07B195608F; Tue, 11 Mar 2025 16:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708840; 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: in-reply-to:in-reply-to:references:references; bh=1nWszQmqouRumPlbII1dV2LPkhLnNaMA7EcBowO/kG4=; b=Zre0RGnePSlPrXKb7ltjvLe/hXf94ldA1SB7zRPLYfHZovaJAtsZRm4NKwDKEF/tOrf0Bp ud49kzU0PsKPJQ7TSZdc0ww5bqJ5/7zHOzRMagBMyzzbhbe6c+9XJKfSxJv0o9fmvTlOF6 MX+S19sXrn9wwnmbbkIW4IAThpmole8= X-MC-Unique: q-A9w9HrP1evJoX2FFhbxg-1 X-Mimecast-MFC-AGG-ID: q-A9w9HrP1evJoX2FFhbxg_1741708837 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 07/10] ui/vdagent: keep "connected" state Date: Tue, 11 Mar 2025 19:59:29 +0400 Message-ID: <20250311155932.1472092-8-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741710115397019100 From: Marc-Andr=C3=A9 Lureau During post-load of migration, virtio will notify of fe_open state. However vdagent code will handle this as a reconnection. This will trigger a connection reset/caps with the agent. Check if the state actually changed before resetting the connection. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/vdagent.c b/ui/vdagent.c index ddd8990318..011a9057ee 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -40,6 +40,7 @@ struct VDAgentChardev { bool clipboard; =20 /* guest vdagent */ + bool connected; uint32_t caps; VDIChunkHeader chunk; uint32_t chunksize; @@ -858,6 +859,7 @@ static void vdagent_disconnect(VDAgentChardev *vd) { trace_vdagent_disconnect(); =20 + vd->connected =3D false; g_byte_array_set_size(vd->outbuf, 0); vdagent_reset_bufs(vd); vd->caps =3D 0; @@ -876,6 +878,10 @@ static void vdagent_chr_set_fe_open(struct Chardev *ch= r, int fe_open) =20 trace_vdagent_fe_open(fe_open); =20 + if (vd->connected =3D=3D fe_open) { + return; + } + if (!fe_open) { trace_vdagent_close(); vdagent_disconnect(vd); @@ -885,6 +891,7 @@ static void vdagent_chr_set_fe_open(struct Chardev *chr= , int fe_open) return; } =20 + vd->connected =3D true; vdagent_send_caps(vd, true); } =20 --=20 2.47.0 From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741709966; cv=none; d=zohomail.com; s=zohoarc; b=FXbC3xqzC6Kv1VzK9hQ48qHc2A6fQy0LaVadz3WhWhwP7AOgyadlvnMx1Y4OSfd58+aV0BKT+yRwk8TKuFtmN0ny+pJsTetOH0jHUQZg3D6dujHdybqUXUil5x8sVRYLdbFDRHXPkmA84T7OGEtWncZbLT0E3CVMHxEAVHIsHA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741709966; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NZPpGI81j++snYsw6LbhCm/alkStFwshXp6ZyPjgkUs=; b=O5kn4hcB7vqqQm3VXQfRz9w74NbgoHo8vh66zsOoIy4Z36gtDwA3gNmPrq5w84/cdUQNwuTKRjLxDr8qbx6+M6FlXRFuiotfZqSK+XiQCrk9fzRIGdzkkZDjSR6sr+1Q9aRkWMEUnTFGrNDo9X5cSyJ2wBJQIZfJEcjw2Yx5QzI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741709966278537.7180694605851; Tue, 11 Mar 2025 09:19:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts28x-0002eM-H6; Tue, 11 Mar 2025 12:07:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts22H-00046v-Gz for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts22F-0005jz-Ff for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:00:53 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-272-Korm2aBePAeNgd6zyKpnBA-1; Tue, 11 Mar 2025 12:00:46 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 67E83180AF65 for ; Tue, 11 Mar 2025 16:00:45 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6D92A18001E9; Tue, 11 Mar 2025 16:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708850; 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: in-reply-to:in-reply-to:references:references; bh=NZPpGI81j++snYsw6LbhCm/alkStFwshXp6ZyPjgkUs=; b=FLbnTSQbNI3TjafXuB0hrpA8zHCBuRdaPB/y1XrQop2++5/PU3gJkH6h+MDpoecoKf2utm TV5KLx0jiP0vEJO+aVj9MC+84sFz+sTMtRe+jdG9Loea7WrXgxgX8GRPzAeRTa3CD7MCNj NUKGBYqqUhbXTKQIN69zUI+4RPz/2Hk= X-MC-Unique: Korm2aBePAeNgd6zyKpnBA-1 X-Mimecast-MFC-AGG-ID: Korm2aBePAeNgd6zyKpnBA_1741708845 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 08/10] ui/vdagent: factor out clipboard peer registration Date: Tue, 11 Mar 2025 19:59:30 +0400 Message-ID: <20250311155932.1472092-9-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741709968084019000 From: Marc-Andr=C3=A9 Lureau This allows common code reuse during migration. Note that resetting the serial is now done regardless if the clipboard peer was registered or not. This should still be correct. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ui/vdagent.c b/ui/vdagent.c index 011a9057ee..125c659af7 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -694,6 +694,18 @@ static void vdagent_chr_open(Chardev *chr, *be_opened =3D true; } =20 +static void vdagent_clipboard_peer_register(VDAgentChardev *vd) +{ + if (vd->cbpeer.notifier.notify !=3D NULL) { + return; + } + + vd->cbpeer.name =3D "vdagent"; + vd->cbpeer.notifier.notify =3D vdagent_clipboard_notify; + vd->cbpeer.request =3D vdagent_clipboard_request; + qemu_clipboard_peer_register(&vd->cbpeer); +} + static void vdagent_chr_recv_caps(VDAgentChardev *vd, VDAgentMessage *msg) { VDAgentAnnounceCapabilities *caps =3D (void *)msg->data; @@ -720,13 +732,9 @@ static void vdagent_chr_recv_caps(VDAgentChardev *vd, = VDAgentMessage *msg) =20 memset(vd->last_serial, 0, sizeof(vd->last_serial)); =20 - if (have_clipboard(vd) && vd->cbpeer.notifier.notify =3D=3D NULL) { + if (have_clipboard(vd)) { qemu_clipboard_reset_serial(); - - vd->cbpeer.name =3D "vdagent"; - vd->cbpeer.notifier.notify =3D vdagent_clipboard_notify; - vd->cbpeer.request =3D vdagent_clipboard_request; - qemu_clipboard_peer_register(&vd->cbpeer); + vdagent_clipboard_peer_register(vd); } } =20 --=20 2.47.0 From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741712860; cv=none; d=zohomail.com; s=zohoarc; b=J/rVYLadp6Lt/FXg3xPmGQJxb6co3lAZP7aneByVuyfSUZt5UWyB+2/DSCTnRIQvwnO0yxzaF5SGHbgmR+VbQyCJYJvDlWNibdIVhbvkZrtz+wjd/R1B6PnDpGbmkE9/Ri0UV4SDqrvJNiicfI0n/V/4R9o+Ms3xxUdt1B3T8qU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741712860; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=f9AvjSm3OBLPexgkNYguLSVaeQ+0WUa/J+lMQ8EWkFY=; b=lF4POHaRMY+N/yQAbnEwUDWBF14JE8B4ewk4xlQkozTRYib4i3qnMKxxVRTRXSD/0+cVTnGnvFVl7UK/dTxBAzmARcvKrAanxOah/bpNvLbCZnNe694BwUTOj4uieJuIPaXsyzwR6C7cs1z20Y8p9y+mGC3bcAis+zcXlSjiPd4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741712860454889.5568247067873; Tue, 11 Mar 2025 10:07:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts2BT-0005WS-59; Tue, 11 Mar 2025 12:10:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts22X-0004PQ-VP for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:01:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts22L-0005l9-Fv for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:01:07 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-328-e1C-ZCVxN7KjWdX_DXS5fQ-1; Tue, 11 Mar 2025 12:00:54 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9D54B180AF6B for ; Tue, 11 Mar 2025 16:00:53 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B4BA3180AF7C; Tue, 11 Mar 2025 16:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708855; 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: in-reply-to:in-reply-to:references:references; bh=f9AvjSm3OBLPexgkNYguLSVaeQ+0WUa/J+lMQ8EWkFY=; b=ENJ1vnECuswgdOWamAjqkgO1/DfSLgB68e178jSXckbVs6Xc3okPx4M1bj/oh2NPN1sH7Q q7P7Fkq6QnhPhwxsgTdn6rMhmTcw92Y4igLPF97EqM6CNmspOs+SKz52FJq07iaN6z8Tw8 58ZuTrrdhnxFb3x058Tv7DTiITD3u8Y= X-MC-Unique: e1C-ZCVxN7KjWdX_DXS5fQ-1 X-Mimecast-MFC-AGG-ID: e1C-ZCVxN7KjWdX_DXS5fQ_1741708853 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 09/10] ui/vdagent: add migration support Date: Tue, 11 Mar 2025 19:59:31 +0400 Message-ID: <20250311155932.1472092-10-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741712862653019100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/ui/vdagent.c b/ui/vdagent.c index 125c659af7..cc5738a6ea 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -10,6 +10,7 @@ #include "ui/clipboard.h" #include "ui/console.h" #include "ui/input.h" +#include "migration/vmstate.h" #include "trace.h" =20 #include "qapi/qapi-types-char.h" @@ -930,6 +931,143 @@ static void vdagent_chr_class_init(ObjectClass *oc, v= oid *data) cc->chr_accept_input =3D vdagent_chr_accept_input; } =20 +static int post_load(void *opaque, int version_id) +{ + VDAgentChardev *vd =3D QEMU_VDAGENT_CHARDEV(opaque); + + if (have_mouse(vd) && vd->mouse_hs) { + qemu_input_handler_activate(vd->mouse_hs); + } + + if (have_clipboard(vd)) { + vdagent_clipboard_peer_register(vd); + } + + return 0; +} + +static const VMStateDescription vmstate_chunk =3D { + .name =3D "vdagent/chunk", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (const VMStateField[]) { + VMSTATE_UINT32(port, VDIChunkHeader), + VMSTATE_UINT32(size, VDIChunkHeader), + VMSTATE_END_OF_LIST() + } +}; + +static const VMStateDescription vmstate_vdba =3D { + .name =3D "vdagent/bytearray", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (const VMStateField[]) { + VMSTATE_UINT32(len, GByteArray), + VMSTATE_VBUFFER_ALLOC_UINT32(data, GByteArray, 0, 0, len), + VMSTATE_END_OF_LIST() + } +}; + +struct CBInfoArray { + uint32_t n; + QemuClipboardInfo cbinfo[QEMU_CLIPBOARD_SELECTION__COUNT]; +}; + +static const VMStateDescription vmstate_cbinfo_array =3D { + .name =3D "cbinfoarray", + .fields =3D (const VMStateField[]) { + VMSTATE_UINT32(n, struct CBInfoArray), + VMSTATE_STRUCT_VARRAY_UINT32(cbinfo, struct CBInfoArray, n, + 0, vmstate_cbinfo, QemuClipboardInfo), + VMSTATE_END_OF_LIST() + } +}; + +static int put_cbinfo(QEMUFile *f, void *pv, size_t size, + const VMStateField *field, JSONWriter *vmdesc) +{ + VDAgentChardev *vd =3D QEMU_VDAGENT_CHARDEV(pv); + struct CBInfoArray cbinfo =3D { 0, }; + int i; + + if (!have_clipboard(vd)) { + return 0; + } + + for (i =3D 0; i < QEMU_CLIPBOARD_SELECTION__COUNT; i++) { + if (qemu_clipboard_peer_owns(&vd->cbpeer, i)) { + cbinfo.cbinfo[cbinfo.n++] =3D *qemu_clipboard_info(i); + } + } + + return vmstate_save_state(f, &vmstate_cbinfo_array, &cbinfo, vmdesc); +} + +static int get_cbinfo(QEMUFile *f, void *pv, size_t size, + const VMStateField *field) +{ + VDAgentChardev *vd =3D QEMU_VDAGENT_CHARDEV(pv); + struct CBInfoArray cbinfo =3D { 0, }; + int i, ret; + + if (!have_clipboard(vd)) { + return 0; + } + + vdagent_clipboard_peer_register(vd); + + ret =3D vmstate_load_state(f, &vmstate_cbinfo_array, &cbinfo, 0); + if (ret) { + return ret; + } + + for (i =3D 0; i < cbinfo.n; i++) { + g_autoptr(QemuClipboardInfo) info =3D qemu_clipboard_info_new(&vd-= >cbpeer, cbinfo.cbinfo[i].selection); + /* this will steal clipboard data pointer from cbinfo.types */ + memcpy(info->types, cbinfo.cbinfo[i].types, sizeof(cbinfo.cbinfo[i= ].types)); + qemu_clipboard_update(info); + } + + return 0; +} + +static const VMStateInfo vmstate_cbinfos =3D { + .name =3D "vdagent/cbinfos", + .get =3D get_cbinfo, + .put =3D put_cbinfo, +}; + +static const VMStateDescription vmstate_vdagent =3D { + .name =3D "vdagent", + .version_id =3D 0, + .minimum_version_id =3D 0, + .post_load =3D post_load, + .fields =3D (const VMStateField[]) { + VMSTATE_BOOL(connected, VDAgentChardev), + VMSTATE_UINT32(caps, VDAgentChardev), + VMSTATE_STRUCT(chunk, VDAgentChardev, 0, vmstate_chunk, VDIChunkHe= ader), + VMSTATE_UINT32(chunksize, VDAgentChardev), + VMSTATE_UINT32(msgsize, VDAgentChardev), + VMSTATE_VBUFFER_ALLOC_UINT32(msgbuf, VDAgentChardev, 0, 0, msgsize= ), + VMSTATE_UINT32(xsize, VDAgentChardev), + VMSTATE_UINT32(xoff, VDAgentChardev), + VMSTATE_VBUFFER_ALLOC_UINT32(xbuf, VDAgentChardev, 0, 0, xsize), + VMSTATE_STRUCT_POINTER(outbuf, VDAgentChardev, vmstate_vdba, GByte= Array), + VMSTATE_UINT32(mouse_x, VDAgentChardev), + VMSTATE_UINT32(mouse_y, VDAgentChardev), + VMSTATE_UINT32(mouse_btn, VDAgentChardev), + VMSTATE_UINT32(mouse_display, VDAgentChardev), + VMSTATE_UINT32_ARRAY(last_serial, VDAgentChardev, QEMU_CLIPBOARD_S= ELECTION__COUNT), + VMSTATE_UINT32_ARRAY(cbpending, VDAgentChardev, QEMU_CLIPBOARD_SEL= ECTION__COUNT), + { + .name =3D "cbinfos", + .info =3D &vmstate_cbinfos, + .flags =3D VMS_SINGLE, + }, + VMSTATE_END_OF_LIST() + } +}; + static void vdagent_chr_init(Object *obj) { VDAgentChardev *vd =3D QEMU_VDAGENT_CHARDEV(obj); @@ -937,6 +1075,7 @@ static void vdagent_chr_init(Object *obj) vd->outbuf =3D g_byte_array_new(); error_setg(&vd->migration_blocker, "The vdagent chardev doesn't yet support migration"); + vmstate_register_any(NULL, &vmstate_vdagent, vd); } =20 static void vdagent_chr_fini(Object *obj) --=20 2.47.0 From nobody Thu Apr 3 10:45:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741709913; cv=none; d=zohomail.com; s=zohoarc; b=IbKJ8y2twETJ9yBS0Mg6hHm3QDTdfxg2HBYWP23ElQ0Poc4ybs7io529zEm0wZdsJ92lejOlU1pb+jARo9L7GdZgfOAjCi03HUAftaomKScxhGMz4RmaLzfXABTz9sFWuSn0QGaBe0DotNTCFfKxQJBCRa0zRg5KrJWZYuCdoV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741709913; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lZFCUSt+CA7uOUzEuduQjHaj5iVHAwCq5l0Wu92LpCg=; b=NSULE/EPX+KPWAB0khql/Lqng3EuXAa/cHkUrNR2oN7OMXoilzliAzXLQT58I98CtuQ2LOIHCk4n7x2+He+bLt/nHg+4v6O1bLbW/VA78uGa5LFdSuZEwKvcQFWp2jdbwgLjMgUhqbPp8J9J7hmmTzrJjN1scoE0kaly7J3W4nA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741709913194292.8235871164884; Tue, 11 Mar 2025 09:18:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts2Bx-0006lX-5D; Tue, 11 Mar 2025 12:10:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts22p-0004X3-9C for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:01:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts22i-0005nw-7X for qemu-devel@nongnu.org; Tue, 11 Mar 2025 12:01:24 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-112-AbIkjy3BNt2c-w_L1L0gGw-1; Tue, 11 Mar 2025 12:01:05 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D654180087D for ; Tue, 11 Mar 2025 16:01:04 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 40FF418009AE; Tue, 11 Mar 2025 16:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741708867; 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: in-reply-to:in-reply-to:references:references; bh=lZFCUSt+CA7uOUzEuduQjHaj5iVHAwCq5l0Wu92LpCg=; b=Aywhc4jTO9g/CIEX1wbIh/deF8+60Njp+eJKhqDfD9saIDATsXut/OavSsUMXStG6h6UCi +1x13ecv5BJmROJ8pBYR5CkgHrMkAF1dptc3++59ovUi/93LPdi1/kEUtL8JwNPPRaShV4 EGVI01JkiWgv23WxzLVkMOzlAURLXkE= X-MC-Unique: AbIkjy3BNt2c-w_L1L0gGw-1 X-Mimecast-MFC-AGG-ID: AbIkjy3BNt2c-w_L1L0gGw_1741708864 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH for-10.1 10/10] ui/vdagent: remove migration blocker Date: Tue, 11 Mar 2025 19:59:32 +0400 Message-ID: <20250311155932.1472092-11-marcandre.lureau@redhat.com> In-Reply-To: <20250311155932.1472092-1-marcandre.lureau@redhat.com> References: <20250311155932.1472092-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741709913821019000 From: Marc-Andr=C3=A9 Lureau Fixes: https://issues.redhat.com/browse/RHEL-81894 Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ui/vdagent.c b/ui/vdagent.c index cc5738a6ea..3b27ba25fb 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -6,7 +6,6 @@ #include "qemu/option.h" #include "qemu/units.h" #include "hw/qdev-core.h" -#include "migration/blocker.h" #include "ui/clipboard.h" #include "ui/console.h" #include "ui/input.h" @@ -33,9 +32,6 @@ struct VDAgentChardev { Chardev parent; =20 - /* TODO: migration isn't yet supported */ - Error *migration_blocker; - /* config */ bool mouse; bool clipboard; @@ -673,10 +669,6 @@ static void vdagent_chr_open(Chardev *chr, return; #endif =20 - if (migrate_add_blocker(&vd->migration_blocker, errp) !=3D 0) { - return; - } - vd->mouse =3D VDAGENT_MOUSE_DEFAULT; if (cfg->has_mouse) { vd->mouse =3D cfg->mouse; @@ -1073,8 +1065,6 @@ static void vdagent_chr_init(Object *obj) VDAgentChardev *vd =3D QEMU_VDAGENT_CHARDEV(obj); =20 vd->outbuf =3D g_byte_array_new(); - error_setg(&vd->migration_blocker, - "The vdagent chardev doesn't yet support migration"); vmstate_register_any(NULL, &vmstate_vdagent, vd); } =20 @@ -1082,7 +1072,6 @@ static void vdagent_chr_fini(Object *obj) { VDAgentChardev *vd =3D QEMU_VDAGENT_CHARDEV(obj); =20 - migrate_del_blocker(&vd->migration_blocker); vdagent_disconnect(vd); if (vd->mouse_hs) { qemu_input_handler_unregister(vd->mouse_hs); --=20 2.47.0