From nobody Fri Apr 19 09:02:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1637675276590942.3856045417944; Tue, 23 Nov 2021 05:47:56 -0800 (PST) Received: from localhost ([::1]:32862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpW9K-0004xx-H2 for importer@patchew.org; Tue, 23 Nov 2021 08:47:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpW4w-00080K-Bp for qemu-devel@nongnu.org; Tue, 23 Nov 2021 08:43:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpW4t-0003pX-90 for qemu-devel@nongnu.org; Tue, 23 Nov 2021 08:43:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-430-JWyBiu75N8-YGiO6M512aw-1; Tue, 23 Nov 2021 08:43:15 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BB1721926DA1 for ; Tue, 23 Nov 2021 13:43:14 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0265962A41; Tue, 23 Nov 2021 13:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637674998; 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=+ELIT9O6f0aFxW51BRV7p/d45dLoJvpe7wXHyazeIbI=; b=Pok+cgvaaPtbuLd8X+cGI7euperclQ4+FoY97X0OcUIPN6SvoVLDwVYpN9hleDC5H0IWkU TcDCAYUD2QWpxHkusR/1tV8uk3PErZHfRmerERHnlwXrx7hQyNxa8fMcgrzJGEAaKMk4xL G7AcptLvILWKScSjv8pkisgrMJsANIE= X-MC-Unique: JWyBiu75N8-YGiO6M512aw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/2] ui: avoid compiler warnings from unused clipboard info variable Date: Tue, 23 Nov 2021 13:43:01 +0000 Message-Id: <20211123134302.45741-2-berrange@redhat.com> In-Reply-To: <20211123134302.45741-1-berrange@redhat.com> References: <20211123134302.45741-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: , Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1637675278452100001 With latest clang 13.0.0 we get ../ui/clipboard.c:47:34: error: variable 'old' set but not used [-Werror,-W= unused-but-set-variable] g_autoptr(QemuClipboardInfo) old =3D NULL; ^ The compiler can't tell that we only declared this variable in order to get the side effect of free'ing it when out of scope. This pattern is a little dubious for a use of g_autoptr, so rewrite the code to avoid it. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daud=C3=A9 --- ui/clipboard.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/clipboard.c b/ui/clipboard.c index d7b008d62a..7672058e84 100644 --- a/ui/clipboard.c +++ b/ui/clipboard.c @@ -44,12 +44,11 @@ void qemu_clipboard_peer_release(QemuClipboardPeer *pee= r, =20 void qemu_clipboard_update(QemuClipboardInfo *info) { - g_autoptr(QemuClipboardInfo) old =3D NULL; assert(info->selection < QEMU_CLIPBOARD_SELECTION__COUNT); =20 notifier_list_notify(&clipboard_notifiers, info); =20 - old =3D cbinfo[info->selection]; + qemu_clipboard_info_unref(cbinfo[info->selection]); cbinfo[info->selection] =3D qemu_clipboard_info_ref(info); } =20 --=20 2.33.1 From nobody Fri Apr 19 09:02:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1637675116960849.8801801924479; Tue, 23 Nov 2021 05:45:16 -0800 (PST) Received: from localhost ([::1]:56444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpW6k-0001hl-S8 for importer@patchew.org; Tue, 23 Nov 2021 08:45:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpW4y-00083T-Gq for qemu-devel@nongnu.org; Tue, 23 Nov 2021 08:43:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpW4u-0003pi-WA for qemu-devel@nongnu.org; Tue, 23 Nov 2021 08:43:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-392-VMiU5dXXMOaBYHCj25SXJQ-1; Tue, 23 Nov 2021 08:43:16 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBF911926DA0 for ; Tue, 23 Nov 2021 13:43:15 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A47E62A41; Tue, 23 Nov 2021 13:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637675000; 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=662Eu7PXYmrPma8O6CiucOkvcPEwV+AucS/VeDAUISY=; b=EC+55et3ONRk9N2vc7DtQ44PYCVTtcyUzxLkrgrZgr1JI7l1IrIELHcDIA21yO9HUjat5q RpWDFI56J/2mCv5oqIOHSCGEdUFD/q7/ccFcDOfX3hIPdNPG+ZDFbVaG1Kxonh5B8gjBwW TQJ0x79AEJQybyTItB1FAP3V74CJ79g= X-MC-Unique: VMiU5dXXMOaBYHCj25SXJQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/2] spice: Update QXLInterface for spice >= 0.15.0 Date: Tue, 23 Nov 2021 13:43:02 +0000 Message-Id: <20211123134302.45741-3-berrange@redhat.com> In-Reply-To: <20211123134302.45741-1-berrange@redhat.com> References: <20211123134302.45741-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: , Cc: John Snow , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1637675119392100001 Content-Type: text/plain; charset="utf-8" From: John Snow spice updated the spelling (and arguments) of "attache_worker" in 0.15.0. Update QEMU to match, preventing -Wdeprecated-declarations compilations from reporting build errors. See also: https://gitlab.freedesktop.org/spice/spice/-/commit/974692bda1e77af92b71ed4= 3b022439448492cb9 Signed-off-by: John Snow Acked-by: Richard Henderson Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/qxl.c | 14 +++++++++++++- include/ui/qemu-spice.h | 6 ++++++ ui/spice-display.c | 11 +++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 29c80b4289..1da6703e44 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -517,13 +517,20 @@ static int qxl_track_command(PCIQXLDevice *qxl, struc= t QXLCommandExt *ext) =20 /* spice display interface callbacks */ =20 -static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worke= r) +static void interface_attached_worker(QXLInstance *sin) { PCIQXLDevice *qxl =3D container_of(sin, PCIQXLDevice, ssd.qxl); =20 trace_qxl_interface_attach_worker(qxl->id); } =20 +#if !(SPICE_HAS_ATTACHED_WORKER) +static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worke= r) +{ + interface_attached_worker(sin); +} +#endif + static void interface_set_compression_level(QXLInstance *sin, int level) { PCIQXLDevice *qxl =3D container_of(sin, PCIQXLDevice, ssd.qxl); @@ -1131,7 +1138,12 @@ static const QXLInterface qxl_interface =3D { .base.major_version =3D SPICE_INTERFACE_QXL_MAJOR, .base.minor_version =3D SPICE_INTERFACE_QXL_MINOR, =20 +#if SPICE_HAS_ATTACHED_WORKER + .attached_worker =3D interface_attached_worker, +#else .attache_worker =3D interface_attach_worker, +#endif + .set_compression_level =3D interface_set_compression_level, #if SPICE_NEEDS_SET_MM_TIME .set_mm_time =3D interface_set_mm_time, diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index 71ecd6cfd1..21fe195e18 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -40,6 +40,12 @@ int qemu_spice_migrate_info(const char *hostname, int po= rt, int tls_port, #define SPICE_NEEDS_SET_MM_TIME 0 #endif =20 +#if defined(SPICE_SERVER_VERSION) && (SPICE_SERVER_VERSION >=3D 0x000f00) +#define SPICE_HAS_ATTACHED_WORKER 1 +#else +#define SPICE_HAS_ATTACHED_WORKER 0 +#endif + #else /* CONFIG_SPICE */ =20 #include "qemu/error-report.h" diff --git a/ui/spice-display.c b/ui/spice-display.c index f59c69882d..1a60cebb7d 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -500,10 +500,17 @@ void qemu_spice_display_refresh(SimpleSpiceDisplay *s= sd) =20 /* spice display interface callbacks */ =20 +#if SPICE_HAS_ATTACHED_WORKER +static void interface_attached_worker(QXLInstance *sin) +{ + /* nothing to do */ +} +#else static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worke= r) { /* nothing to do */ } +#endif =20 static void interface_set_compression_level(QXLInstance *sin, int level) { @@ -702,7 +709,11 @@ static const QXLInterface dpy_interface =3D { .base.major_version =3D SPICE_INTERFACE_QXL_MAJOR, .base.minor_version =3D SPICE_INTERFACE_QXL_MINOR, =20 +#if SPICE_HAS_ATTACHED_WORKER + .attached_worker =3D interface_attached_worker, +#else .attache_worker =3D interface_attach_worker, +#endif .set_compression_level =3D interface_set_compression_level, #if SPICE_NEEDS_SET_MM_TIME .set_mm_time =3D interface_set_mm_time, --=20 2.33.1