From nobody Wed Apr 1 23:50:27 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1774950824; cv=none; d=zohomail.com; s=zohoarc; b=jUijuTaur+J95J1ZUCCrIs6jXlnLyQIhMUKVJv72pENEahe1+hoTiBidR2lCQ3hzZMiq1vCmEP0HbJZboiBjsN+ID6Fudhj0VySkHd90vZGneTQgfqIj0s3BFKuc8skaqhSm55HG3rCxFfth0t73ygSirkYS5VIKpJRaEUE5EGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774950824; 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=jvHT6BwsoBPWDujNFtkt+Bu13w+qxfZDiiZxPnQYDZM=; b=Loq8y8hEdebHzgOFE61o7RYpa2dC89IK3iy3JgSP3wbkaL2r4iJu8SmcAq9Xs7N4xosTuKx1CJMz1C1yoX5ui33ZkLtyvA+iIX2GjaQehgHYnT9alrxnR845f3RfeN3P6GrG8pMq4dM9CSM2BHjVe0huoCFZhZF1mGU3Lp4f9Ok= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774950824041717.8631863076229; Tue, 31 Mar 2026 02:53:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w7Vmk-0000Uk-JK; Tue, 31 Mar 2026 05:53:22 -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 1w7Vmi-0000UV-SA for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:20 -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 1w7Vmh-00084R-ET for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:20 -0400 Received: from mx-prod-mc-03.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-457-ZOGNzu5sOvyywyQXzHwr-A-1; Tue, 31 Mar 2026 05:53:14 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D058119560B4; Tue, 31 Mar 2026 09:53:13 +0000 (UTC) Received: from localhost (unknown [10.44.22.22]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 866EA180075B; Tue, 31 Mar 2026 09:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774950798; 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=jvHT6BwsoBPWDujNFtkt+Bu13w+qxfZDiiZxPnQYDZM=; b=DIj7xP7LP3gmpatHObS4gi3o/EMETUgV45dVfHxt9B/9D1SiAQFQPZKfdU3yxNNcjBMmMd eMlUe+aQGVFZ2W+GpgHYbBTxoIeKWN2/Hvq7TOg9oy2fl42M3zFgBIHWWME71+H+6cWe7b 62cdb7AudN90w2vG+np+tEtw/ggtDkw= X-MC-Unique: ZOGNzu5sOvyywyQXzHwr-A-1 X-Mimecast-MFC-AGG-ID: ZOGNzu5sOvyywyQXzHwr-A_1774950794 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PULL 1/6] audio/mixeng: fix sw/hw mixup in audio_pcm_sw_init_ Date: Tue, 31 Mar 2026 13:52:57 +0400 Message-ID: <20260331095302.644608-2-marcandre.lureau@redhat.com> In-Reply-To: <20260331095302.644608-1-marcandre.lureau@redhat.com> References: <20260331095302.644608-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: 27 X-Spam_score: 2.7 X-Spam_bar: ++ X-Spam_report: (2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54, 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_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1774950825727158500 From: Marc-Andr=C3=A9 Lureau Commit 42061a14358 ("audio/mixeng: replace redundant pcm_info fields with AudioFormat") accidentally changed the conv/clip function selection in audio_pcm_sw_init_ to use hw->info.af (the hardware voice format) instead of sw->info.af (the software voice format). This causes audio distortion when the software and hardware voices use different formats, as the wrong conversion functions are applied to the audio data. Fix by using sw->info.af, restoring the original behavior. Fixes: 42061a14358c ("audio/mixeng: replace redundant pcm_info fields with = AudioFormat") Reported-by: Dmitry Osipenko Reviewed-by: Christian Schoenebeck Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio_template.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index fe769cde667..398a7273739 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -172,7 +172,7 @@ static int glue (audio_pcm_sw_init_, TYPE) ( sw->empty =3D true; #endif =20 - if (audio_format_is_float(hw->info.af)) { + if (audio_format_is_float(sw->info.af)) { #ifdef DAC sw->conv =3D mixeng_conv_float[sw->info.nchannels =3D=3D 2] [sw->info.swap_endianness]; @@ -187,9 +187,9 @@ static int glue (audio_pcm_sw_init_, TYPE) ( sw->clip =3D mixeng_clip #endif [sw->info.nchannels =3D=3D 2] - [audio_format_is_signed(hw->info.af)] + [audio_format_is_signed(sw->info.af)] [sw->info.swap_endianness] - [audio_format_to_index(hw->info.af)]; + [audio_format_to_index(sw->info.af)]; } =20 sw->name =3D g_strdup (name); --=20 2.53.0 From nobody Wed Apr 1 23:50:27 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1774950854; cv=none; d=zohomail.com; s=zohoarc; b=hLJRQ54vKIHQPGoYRyPHRegZzVu4tT2oAGF/sPJELArcog8hP8JhAVsMOWm8f+++GzTEKaqnrOx4PFGBKHmGCZnV0BzDdJpKNtn4hkkpUk3JgS5ym63lPWyjjm/IQcg40DMsEOF2fOaXr02l5WrYRLEbzGOQfNGxLms1NzR1kvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774950854; 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=mHpBtpFggB69Aq4TcqZoU6H0mIeC/0Ty0iKbm2he4uw=; b=JhWBJEaOjKB8i+qxieELlZmpgRC2+Na08yAWllAn3RkaoL2iH+g6Ior+br7E33OQKaoVMM/9P+ce0FKivS4kD9wX94ffr4hNWTj4GzHQGTVhPVLOIX/T9mvMYzooLwQF9TyOrdIjVt0t+Dp2VfJPIkEsk3VfVjm5j/ibDU8W7MI= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177495085491173.0868061326006; Tue, 31 Mar 2026 02:54:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w7Vmq-0000Vi-3C; Tue, 31 Mar 2026 05:53:28 -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 1w7Vmp-0000VD-2x for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:27 -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 1w7Vmn-00084z-Gy for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:26 -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-120-5H_G1zdKOyeTX3MUod59SA-1; Tue, 31 Mar 2026 05:53:21 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 016CA195608E; Tue, 31 Mar 2026 09:53:20 +0000 (UTC) Received: from localhost (unknown [10.44.22.22]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6E4B330002DA; Tue, 31 Mar 2026 09:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774950804; 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=mHpBtpFggB69Aq4TcqZoU6H0mIeC/0Ty0iKbm2he4uw=; b=VbFp+9rvhYh1CmA2Is6MF+ussTaeJo3Ev/J68iShVO/JVN/eNyjYyEtA2zvEPPT2/ZWd3C Y34ocYj93UngjpW8Hau5sno2rt1T8hQkhwz8s6d78y0fW/YGlwVUbNSgeo4fii1N4ezkGc QV0ih1M6JK4iu43gffoqsnorQXhuADU= X-MC-Unique: 5H_G1zdKOyeTX3MUod59SA-1 X-Mimecast-MFC-AGG-ID: 5H_G1zdKOyeTX3MUod59SA_1774950800 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, GuoHan Zhao , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 2/6] ui/dbus: associate add_client completion with its request Date: Tue, 31 Mar 2026 13:52:58 +0400 Message-ID: <20260331095302.644608-3-marcandre.lureau@redhat.com> In-Reply-To: <20260331095302.644608-1-marcandre.lureau@redhat.com> References: <20260331095302.644608-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.4 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: 27 X-Spam_score: 2.7 X-Spam_bar: ++ X-Spam_report: (2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54, 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.01, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1774950856022158501 From: GuoHan Zhao Commit 99997823bbbd ("ui/dbus: add p2p=3Don/off option") introduced an asynchronous D-Bus client setup path, with the completion handler reaching back into the global dbus_display state. This makes the callback effectively operate on whatever request is current when it runs, rather than the one that created it. A completion from an older request can therefore clear a newer add_client_cancellable or install its connection after a replacement request has already been issued. It also relies on the DBusDisplay instance remaining alive until completion. Fix this by passing the DBusDisplay and GCancellable as callback data, taking references while the async setup is in flight, and only acting on completion if it still matches the current request. Also drop the previous cancellable before creating a new request. Fixes: 99997823bbbd ("ui/dbus: add p2p=3Don/off option") Signed-off-by: GuoHan Zhao Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20260326065111.626236-1-zhaoguohan@kylinos.cn> --- ui/dbus.c | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/ui/dbus.c b/ui/dbus.c index 4f24215555a..7c54b6a502d 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -263,22 +263,52 @@ dbus_display_complete(UserCreatable *uc, Error **errp) } } =20 +typedef struct DBusDisplayAddClientData { + DBusDisplay *display; + GCancellable *cancellable; +} DBusDisplayAddClientData; + +static void dbus_display_add_client_data_free(DBusDisplayAddClientData *da= ta) +{ + if (data->display) { + object_unref(OBJECT(data->display)); + data->display =3D NULL; + } + g_clear_object(&data->cancellable); + g_free(data); +} + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(DBusDisplayAddClientData, + dbus_display_add_client_data_free) + static void dbus_display_add_client_ready(GObject *source_object, GAsyncResult *res, gpointer user_data) { + g_autoptr(DBusDisplayAddClientData) data =3D user_data; + DBusDisplay *display =3D data->display; + bool current =3D display->add_client_cancellable =3D=3D data->cancella= ble; g_autoptr(GError) err =3D NULL; g_autoptr(GDBusConnection) conn =3D NULL; =20 - g_clear_object(&dbus_display->add_client_cancellable); + if (current) { + g_clear_object(&display->add_client_cancellable); + } =20 conn =3D g_dbus_connection_new_finish(res, &err); if (!conn) { - error_printf("Failed to accept D-Bus client: %s", err->message); + if (!g_error_matches(err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + error_printf("Failed to accept D-Bus client: %s", err->message= ); + } + return; } =20 - g_dbus_object_manager_server_set_connection(dbus_display->server, conn= ); + if (!current) { + return; + } + + g_dbus_object_manager_server_set_connection(display->server, conn); g_dbus_connection_start_message_processing(conn); } =20 @@ -290,6 +320,7 @@ dbus_display_add_client(int csock, Error **errp) g_autoptr(GSocket) socket =3D NULL; g_autoptr(GSocketConnection) conn =3D NULL; g_autofree char *guid =3D g_dbus_generate_guid(); + DBusDisplayAddClientData *data; =20 if (!dbus_display) { error_setg(errp, "p2p connections not accepted in bus mode"); @@ -298,6 +329,7 @@ dbus_display_add_client(int csock, Error **errp) =20 if (dbus_display->add_client_cancellable) { g_cancellable_cancel(dbus_display->add_client_cancellable); + g_clear_object(&dbus_display->add_client_cancellable); } =20 #ifdef WIN32 @@ -318,6 +350,10 @@ dbus_display_add_client(int csock, Error **errp) conn =3D g_socket_connection_factory_create_connection(socket); =20 dbus_display->add_client_cancellable =3D g_cancellable_new(); + data =3D g_new0(DBusDisplayAddClientData, 1); + data->display =3D DBUS_DISPLAY(object_ref(OBJECT(dbus_display))); + data->cancellable =3D g_object_ref(dbus_display->add_client_cancellabl= e); + GDBusConnectionFlags flags =3D G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER | G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING; @@ -332,7 +368,7 @@ dbus_display_add_client(int csock, Error **errp) NULL, dbus_display->add_client_cancellable, dbus_display_add_client_ready, - NULL); + data); =20 return true; } --=20 2.53.0 From nobody Wed Apr 1 23:50:27 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1774950856; cv=none; d=zohomail.com; s=zohoarc; b=LHYMh4/w+wo+zwK452y5q83+GLSo9acZJvCTASbBppTWYVPkvddIsavm+Z8Ry7zWV7kP4Ef7fszmbtk/qRyBGnaLXsykYOxoRuTfUr1b9lYzpn4uNIils/VN8zQpMwoTzoYtRKbc1QNMs1qDUqZpXE8O11LRks8lBcqeJcc2j1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774950856; 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=DCd5vbV6w9R6yKj4V/czrdfnnJcVB5pJMCCePIO1TVw=; b=cG4zMQp3wXFh7yCg1Fkffq42YvGBC3xXN0YbBXTp2ps72LiWJNJtuMaPCu9oSMyPIgYhPJKjTTc2/AUtFiExXuUY5CZlaQCQrwy66w9obIGxxG44FJxFR2U+4eJhyOSJ4Q+56wJ49awlCfSZUNZMH6ivULYYtBrjMbD1oBqYW/4= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774950856299235.09011637341462; Tue, 31 Mar 2026 02:54:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w7Vmw-0000WT-JV; Tue, 31 Mar 2026 05:53:34 -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 1w7Vmu-0000W5-Nw for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:32 -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 1w7Vmt-00085e-A3 for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:32 -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-175-or04q_v8Pm-qbfExPnd_PA-1; Tue, 31 Mar 2026 05:53:27 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 E4400180044D; Tue, 31 Mar 2026 09:53:25 +0000 (UTC) Received: from localhost (unknown [10.44.22.22]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4319E1955F42; Tue, 31 Mar 2026 09:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774950810; 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=DCd5vbV6w9R6yKj4V/czrdfnnJcVB5pJMCCePIO1TVw=; b=K2GFwJYTnoVq1rhkXdYUNnRGGYzfmyU175BQLquVLTfHXP8jXLkSeCew1kaNwbY+EeRG8F OTcByK5R9Yizkx3FgBWeOzvMVwk/D3qFAOGxTTY1frUO5xkkvuPKfIwoT8Eg0cO18d9cC6 1L6ZZs8tsqsHjX/72ypncvrIEFs7T20= X-MC-Unique: or04q_v8Pm-qbfExPnd_PA-1 X-Mimecast-MFC-AGG-ID: or04q_v8Pm-qbfExPnd_PA_1774950806 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, GuoHan Zhao , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 3/6] ui/dbus: tear down clipboard callbacks on display finalize Date: Tue, 31 Mar 2026 13:52:59 +0400 Message-ID: <20260331095302.644608-4-marcandre.lureau@redhat.com> In-Reply-To: <20260331095302.644608-1-marcandre.lureau@redhat.com> References: <20260331095302.644608-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.12 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: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54, 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_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1774950858804154100 From: GuoHan Zhao The clipboard D-Bus teardown path currently runs when the peer disappears, but not when DBusDisplay itself is finalized. That leaves pending clipboard requests and signal handlers associated with the clipboard proxy active past display teardown. Add an explicit clipboard fini hook and invoke it from dbus_display_finalize() so the clipboard teardown also runs during display destruction. bixes: ff1a5810f61f ("ui/dbus: add clipboard interface") Signed-off-by: GuoHan Zhao Message-ID: <20260330091310.42868-1-zhaoguohan@kylinos.cn> [ Marc-Andr=C3=A9 - Move clipobard finalization to the function] Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/dbus.h | 1 + ui/dbus-clipboard.c | 16 ++++++++++++++++ ui/dbus.c | 3 +-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ui/dbus.h b/ui/dbus.h index 1e8c24a48e3..986d7774601 100644 --- a/ui/dbus.h +++ b/ui/dbus.h @@ -150,5 +150,6 @@ void dbus_display_notify(DBusDisplayEvent *event); void dbus_chardev_init(DBusDisplay *dpy); =20 void dbus_clipboard_init(DBusDisplay *dpy); +void dbus_clipboard_fini(DBusDisplay *dpy); =20 #endif /* UI_DBUS_H */ diff --git a/ui/dbus-clipboard.c b/ui/dbus-clipboard.c index 6787a776687..935b6b1a2ac 100644 --- a/ui/dbus-clipboard.c +++ b/ui/dbus-clipboard.c @@ -191,6 +191,7 @@ static void dbus_clipboard_unregister_proxy(DBusDisplay *dpy) { const char *name =3D NULL; + GDBusConnection *connection =3D NULL; int i; =20 for (i =3D 0; i < G_N_ELEMENTS(dpy->clipboard_request); ++i) { @@ -201,6 +202,13 @@ dbus_clipboard_unregister_proxy(DBusDisplay *dpy) return; } =20 + connection =3D g_dbus_proxy_get_connection( + G_DBUS_PROXY(dpy->clipboard_proxy)); + if (connection) { + g_signal_handlers_disconnect_by_data(connection, dpy); + } + g_signal_handlers_disconnect_by_data(dpy->clipboard_proxy, dpy); + name =3D g_dbus_proxy_get_name(G_DBUS_PROXY(dpy->clipboard_proxy)); trace_dbus_clipboard_unregister(name); g_clear_object(&dpy->clipboard_proxy); @@ -425,6 +433,14 @@ dbus_clipboard_request( return DBUS_METHOD_INVOCATION_HANDLED; } =20 +void +dbus_clipboard_fini(DBusDisplay *dpy) +{ + dbus_clipboard_unregister_proxy(dpy); + qemu_clipboard_peer_unregister(&dpy->clipboard_peer); + g_clear_object(&dpy->clipboard); +} + void dbus_clipboard_init(DBusDisplay *dpy) { diff --git a/ui/dbus.c b/ui/dbus.c index 7c54b6a502d..794b65c4ada 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -145,8 +145,7 @@ dbus_display_finalize(Object *o) dbus_display_notifier_remove(&dd->notifier); } =20 - qemu_clipboard_peer_unregister(&dd->clipboard_peer); - g_clear_object(&dd->clipboard); + dbus_clipboard_fini(dd); =20 g_clear_object(&dd->server); g_clear_pointer(&dd->consoles, g_ptr_array_unref); --=20 2.53.0 From nobody Wed Apr 1 23:50:27 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1774950826; cv=none; d=zohomail.com; s=zohoarc; b=GojcLarw3lfWDq4AHkhpYMBAecWjQASO5exJy+QJ+kFbANV2ni191NzTlkv3nTuFa9NS+Z+eUDKKiMevX3BNIp3WIAsqm0YXRrunCW78KJgdykz1tNLYbmCwZr46kEViBeDViS1vUN3iISkyox5rw2qJ88UY+zcI7xQHnCrjkoA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774950826; 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=f2zQVVCmyQ0LGrf0EklnYlbhl3AtvR1KwwHBqe0PJ9I=; b=OK/lQ1fwE2nUvfXPk9iKhwT5nm5ZqIVpm2LkFQLGXOjMglZAqfCNU3cE/G2nPplwkEQmmkZ6kd2fAomputnmFoaFsZ7R7WrVocq0lkz2uGFZa+2HVO95CwpysXtNOKYWD1CIfoOMqrETYXKv0zdkkc9Qrc+MkErI6mj5DGbLV/M= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774950826963769.4577147284308; Tue, 31 Mar 2026 02:53:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w7Vn2-0000Zr-VI; Tue, 31 Mar 2026 05:53:40 -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 1w7Vn0-0000Xs-QM for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:39 -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 1w7Vmz-00089S-Et for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:38 -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-376-LWtE86NEOrW71MRV9zAneA-1; Tue, 31 Mar 2026 05:53:33 -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 5CB18180034E; Tue, 31 Mar 2026 09:53:32 +0000 (UTC) Received: from localhost (unknown [10.44.22.22]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 61DE418002A6; Tue, 31 Mar 2026 09:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774950816; 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=f2zQVVCmyQ0LGrf0EklnYlbhl3AtvR1KwwHBqe0PJ9I=; b=ZdWrMZ5LwZWcM8aZZ48wpvq1P1j84Om94KesaBaCicGSAwWFaCIGl77Yi6G8w70UiiI+Z7 0S97EP/MskEp4d3SVG22AXvEfxU+oySopXpnXWB4Jv6w85JhDOGB3mK6mDxjlqp2ZynGtQ C3EOBH6vHMNvS7dXmIlFQedtDkPZ7T0= X-MC-Unique: LWtE86NEOrW71MRV9zAneA-1 X-Mimecast-MFC-AGG-ID: LWtE86NEOrW71MRV9zAneA_1774950812 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 4/6] ui/vnc-jobs: fix VncRectEntry leak on job cleanup Date: Tue, 31 Mar 2026 13:53:00 +0400 Message-ID: <20260331095302.644608-5-marcandre.lureau@redhat.com> In-Reply-To: <20260331095302.644608-1-marcandre.lureau@redhat.com> References: <20260331095302.644608-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: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54, 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.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1774950828389154100 From: Marc-Andr=C3=A9 Lureau When a VncJob is freed, its associated VncRectEntry list must also be freed. Previously, vnc_job_push() and the disconnected path in vnc_worker_thread_loop() called g_free(job) directly, leaking all VncRectEntry allocations. Introduce vnc_job_free() which iterates and frees the rectangle entries before freeing the job itself, and use it in both paths. Also add QLIST_REMOVE() in the worker loop before g_free(entry), so that entries processed during normal operation are properly unlinked. Without this, vnc_job_free() would iterate dangling pointers to already-freed entries, causing use-after-free. Fixes: bd023f953e5e ("vnc: threaded VNC server") Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vnc-jobs.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c index b296d19e089..ca625da6d05 100644 --- a/ui/vnc-jobs.c +++ b/ui/vnc-jobs.c @@ -107,11 +107,25 @@ int vnc_job_add_rect(VncJob *job, int x, int y, int w= , int h) return 1; } =20 +static void vnc_job_free(VncJob *job) +{ + VncRectEntry *entry, *tmp; + + if (!job) { + return; + } + QLIST_FOREACH_SAFE(entry, &job->rectangles, next, tmp) { + /* no need for QLIST_REMOVE(entry, next) */ + g_free(entry); + } + g_free(job); +} + void vnc_job_push(VncJob *job) { vnc_lock_queue(queue); if (queue->exit || QLIST_EMPTY(&job->rectangles)) { - g_free(job); + vnc_job_free(job); } else { QTAILQ_INSERT_TAIL(&queue->jobs, job, next); qemu_cond_broadcast(&queue->cond); @@ -296,6 +310,7 @@ static int vnc_worker_thread_loop(VncJobQueue *queue) n_rectangles +=3D n; } } + QLIST_REMOVE(entry, next); g_free(entry); } trace_vnc_job_nrects(&vs, job, n_rectangles); @@ -324,7 +339,7 @@ disconnected: QTAILQ_REMOVE(&queue->jobs, job, next); vnc_unlock_queue(queue); qemu_cond_broadcast(&queue->cond); - g_free(job); + vnc_job_free(job); vs.magic =3D 0; return 0; } --=20 2.53.0 From nobody Wed Apr 1 23:50:27 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1774950854; cv=none; d=zohomail.com; s=zohoarc; b=VpOz6TV2JmQihnQb9rg9+hsY/R82dV19lRjiBVC37nDLdl8noDxbsBv6uhvHbE8mmb0p2InQjt+AP4DBqa8gOmeDsjqFiXjVNs1QL0HkGThu5tmAjSv2dH4z784xJLIZePsrzWAKYTM/cJzHmsmmWnEd8/y616SquH//dZKsFbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774950854; 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=RBM9nkW+r4Seb1KGGXoI8JFaAWn2nmtP93T+sV0Bs4Y=; b=DKbDEfv0HqXLIz5sE9xe71nIzlEqRwlgkQRTnwu8Tx9KlgW3GYdqR+02R78X0qq4+nnMPS4jyuD2HIRW/5URU0CETOMzZ2aiLmhxBnRbdOu9XIcsuVrOnwaje6BARpztHKeJcgtInNV+S6j1r+x5fTtGDWWv/b/vXtQ3AGKmxGQ= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774950854656411.85185762716844; Tue, 31 Mar 2026 02:54:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w7Vn8-0000ua-1c; Tue, 31 Mar 2026 05:53:46 -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 1w7Vn6-0000kI-33 for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:44 -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 1w7Vn4-0008EU-HM for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:43 -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-335-QeGswUESNDOTKdD5OT7dHQ-1; Tue, 31 Mar 2026 05:53:39 -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 B459C1956094; Tue, 31 Mar 2026 09:53:38 +0000 (UTC) Received: from localhost (unknown [10.44.22.22]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A6E8A180058B; Tue, 31 Mar 2026 09:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774950821; 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=RBM9nkW+r4Seb1KGGXoI8JFaAWn2nmtP93T+sV0Bs4Y=; b=flBsSUvW9FLU75ciN6Dyc3wdeCAw+wK1srybd5CXKz1GISQJR35wSq5sGCzUAH/vTH+4f4 M6BBew0pN3vMGaTFw8O93VFNpwXcagGshX7UNhYVwXqLfYv1bgWj+pwDdDuJZdT/IfvEh1 xnXXNLjdDh0AjjDimNHsEPWpYpaCO68= X-MC-Unique: QeGswUESNDOTKdD5OT7dHQ-1 X-Mimecast-MFC-AGG-ID: QeGswUESNDOTKdD5OT7dHQ_1774950818 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 5/6] ui/vnc-jobs: clear source tag Date: Tue, 31 Mar 2026 13:53:01 +0400 Message-ID: <20260331095302.644608-6-marcandre.lureau@redhat.com> In-Reply-To: <20260331095302.644608-1-marcandre.lureau@redhat.com> References: <20260331095302.644608-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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 27 X-Spam_score: 2.7 X-Spam_bar: ++ X-Spam_report: (2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54, 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_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1774950856707154100 From: Marc-Andr=C3=A9 Lureau Avoid potentially removing a dangling source & simplify code. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vnc-jobs.c | 4 +--- ui/vnc.c | 31 +++++++------------------------ 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c index ca625da6d05..ec90ae6d5fc 100644 --- a/ui/vnc-jobs.c +++ b/ui/vnc-jobs.c @@ -162,9 +162,7 @@ void vnc_jobs_consume_buffer(VncState *vs) vnc_lock_output(vs); if (vs->jobs_buffer.offset) { if (vs->ioc !=3D NULL && buffer_empty(&vs->output)) { - if (vs->ioc_tag) { - g_source_remove(vs->ioc_tag); - } + g_clear_handle_id(&vs->ioc_tag, g_source_remove); if (vs->disconnecting =3D=3D FALSE) { vs->ioc_tag =3D qio_channel_add_watch( vs->ioc, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_OUT, diff --git a/ui/vnc.c b/ui/vnc.c index 952976e9649..ccc73bd7aa4 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1301,10 +1301,7 @@ static void vnc_disconnect_start(VncState *vs) } trace_vnc_client_disconnect_start(vs, vs->ioc); vnc_set_share_mode(vs, VNC_SHARE_MODE_DISCONNECTED); - if (vs->ioc_tag) { - g_source_remove(vs->ioc_tag); - vs->ioc_tag =3D 0; - } + g_clear_handle_id(&vs->ioc_tag, g_source_remove); qio_channel_close(vs->ioc, NULL); vs->disconnecting =3D TRUE; } @@ -1462,9 +1459,7 @@ static size_t vnc_client_write_plain(VncState *vs) } =20 if (vs->output.offset =3D=3D 0) { - if (vs->ioc_tag) { - g_source_remove(vs->ioc_tag); - } + g_clear_handle_id(&vs->ioc_tag, g_source_remove); vs->ioc_tag =3D qio_channel_add_watch( vs->ioc, G_IO_IN | G_IO_HUP | G_IO_ERR, vnc_client_io, vs, NULL); @@ -1500,9 +1495,7 @@ static void vnc_client_write(VncState *vs) if (vs->output.offset) { vnc_client_write_locked(vs); } else if (vs->ioc !=3D NULL) { - if (vs->ioc_tag) { - g_source_remove(vs->ioc_tag); - } + g_clear_handle_id(&vs->ioc_tag, g_source_remove); vs->ioc_tag =3D qio_channel_add_watch( vs->ioc, G_IO_IN | G_IO_HUP | G_IO_ERR, vnc_client_io, vs, NULL); @@ -1638,10 +1631,7 @@ gboolean vnc_client_io(QIOChannel *ioc G_GNUC_UNUSED, } =20 if (vs->disconnecting) { - if (vs->ioc_tag !=3D 0) { - g_source_remove(vs->ioc_tag); - } - vs->ioc_tag =3D 0; + g_clear_handle_id(&vs->ioc_tag, g_source_remove); } return TRUE; } @@ -1684,9 +1674,7 @@ void vnc_write(VncState *vs, const void *data, size_t= len) buffer_reserve(&vs->output, len); =20 if (vs->ioc !=3D NULL && buffer_empty(&vs->output)) { - if (vs->ioc_tag) { - g_source_remove(vs->ioc_tag); - } + g_clear_handle_id(&vs->ioc_tag, g_source_remove); vs->ioc_tag =3D qio_channel_add_watch( vs->ioc, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_OUT, vnc_client_io, vs, NULL); @@ -1734,10 +1722,7 @@ void vnc_flush(VncState *vs) vnc_client_write_locked(vs); } if (vs->disconnecting) { - if (vs->ioc_tag !=3D 0) { - g_source_remove(vs->ioc_tag); - } - vs->ioc_tag =3D 0; + g_clear_handle_id(&vs->ioc_tag, g_source_remove); } vnc_unlock_output(vs); } @@ -3342,9 +3327,7 @@ static void vnc_connect(VncDisplay *vd, QIOChannelSoc= ket *sioc, VNC_DEBUG("New client on socket %p\n", vs->sioc); update_displaychangelistener(&vd->dcl, VNC_REFRESH_INTERVAL_BASE); qio_channel_set_blocking(vs->ioc, false, &error_abort); - if (vs->ioc_tag) { - g_source_remove(vs->ioc_tag); - } + g_clear_handle_id(&vs->ioc_tag, g_source_remove); if (websocket) { vs->websocket =3D 1; if (vd->tlscreds) { --=20 2.53.0 From nobody Wed Apr 1 23:50:27 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1774950857; cv=none; d=zohomail.com; s=zohoarc; b=FKRr0hGFc3uCj0+a1uteZWU8jBL+iGFx+aPymArPeLgyVH9RqNn3jzyRSC9FA9l4QwqK63+223njnwQkAH0ib/zRRyXDq4Whk2EDuf47rN6DZipCiXyl+P4oIfzGJpprgugUq/8SieEiRbXfg/y09wrdnttjroY3sJ6wyUhPjoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774950857; 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=XF0CkezX3Sf94Et+WA9PyBVV/sdIs6tS9kfJBKf5JBc=; b=SpRM7zmFDJXr16lgisqArUyPVRQ7Rgp5cGLAgrYTy/R/GyVLk7Ji4K9oYjXgWWSswXtlxlaf8M16ZSm4+IUqXT6yzr2V7Qs9UzqsM+D2g3MrwKjrJrkgRheD8EEWyUALFxrvPXG7b8xYwjwI4ClxhTyT+ktbx+eipOiyfPDbzVg= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774950857636201.95737886926247; Tue, 31 Mar 2026 02:54:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w7VnG-0001FT-Ip; Tue, 31 Mar 2026 05:53:54 -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 1w7VnF-0001DX-6b for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:53 -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 1w7VnD-0008H1-HH for qemu-devel@nongnu.org; Tue, 31 Mar 2026 05:53:52 -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-626-qUh7VvyQNSyI4azbsudlRA-1; Tue, 31 Mar 2026 05:53:46 -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 25B9B180047F; Tue, 31 Mar 2026 09:53:45 +0000 (UTC) Received: from localhost (unknown [10.44.22.22]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CA20B19540C4; Tue, 31 Mar 2026 09:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774950830; 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=XF0CkezX3Sf94Et+WA9PyBVV/sdIs6tS9kfJBKf5JBc=; b=VPLHqK75CBF8/aSAnR8IXPW5xeAennjr8XVaPDdSlyfSyZzEpdCFQBYQmY7bB5MmJ84Xv8 XbqkQiVRQR0L8vKY3v1IC+EUYDJbLTufF6OOrH1OLeK3vcjmRbZf6Y0TtRz4FTLJhvMVnm 0PKDHZzXPmLZSbJlGcCdQ2zklkdNErM= X-MC-Unique: qUh7VvyQNSyI4azbsudlRA-1 X-Mimecast-MFC-AGG-ID: qUh7VvyQNSyI4azbsudlRA_1774950825 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Anton Kuchin , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 6/6] tests: don't build audio tests when no audio drivers are enabled Date: Tue, 31 Mar 2026 13:53:02 +0400 Message-ID: <20260331095302.644608-7-marcandre.lureau@redhat.com> In-Reply-To: <20260331095302.644608-1-marcandre.lureau@redhat.com> References: <20260331095302.644608-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: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54, 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.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1774950860627154100 From: Anton Kuchin When there are no audio drivers configure fails with "ERROR: Command cannot have '@INPUT@', since no input files were specified". Fixes: 3220b38a8d ("tests: start manual audio backend test") Signed-off-by: Anton Kuchin Message-ID: [ Marc-Andr=C3=A9 - use empty modinfo stub ] Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/audio/modinfo-stub.c | 5 +++++ tests/audio/meson.build | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 tests/audio/modinfo-stub.c diff --git a/tests/audio/modinfo-stub.c b/tests/audio/modinfo-stub.c new file mode 100644 index 00000000000..1cae8c6905e --- /dev/null +++ b/tests/audio/modinfo-stub.c @@ -0,0 +1,5 @@ +#include "qemu/osdep.h" +#include "qemu/module.h" +const QemuModinfo qemu_modinfo[] =3D { + { /* end of list */ } +}; diff --git a/tests/audio/meson.build b/tests/audio/meson.build index 84754bde221..be96313a63e 100644 --- a/tests/audio/meson.build +++ b/tests/audio/meson.build @@ -6,12 +6,14 @@ endif =20 modinfo_dep =3D not_found if enable_modules - modinfo_src =3D custom_target('modinfo.c', - output: 'modinfo.c', - input: audio_modinfo_files, - command: [modinfo_generate, '--skip-missin= g-deps', '@INPUT@'], - capture: true) - + modinfo_src =3D 'modinfo-stub.c' + if audio_modinfo_files.length() !=3D 0 + modinfo_src =3D custom_target('modinfo.c', + output: 'modinfo.c', + input: audio_modinfo_files, + command: [modinfo_generate, '--skip-mi= ssing-deps', '@INPUT@'], + capture: true) + endif modinfo_lib =3D static_library('modinfo.c', modinfo_src) modinfo_dep =3D declare_dependency(link_with: modinfo_lib) endif --=20 2.53.0