From nobody Sat Nov 23 20:57:50 2024 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=1728913362; cv=none; d=zohomail.com; s=zohoarc; b=LQFet+X+bIuIkXyHGXDhgx3HuHzk719cVChfJHpvikmqNn2SAVfEE2Gj1qNeB9S3dumyBJuYFv7l69dBq9PMXM8Mq1sK0OyAMXL6lv4qHai1/pv0whu1ibbZFKH2qm72oIW67Ux2H8MfVZCtNoloH77W9/x5JlZfY7bG9VS+uZw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913362; 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=0XYBhezV8ICaxkklWVa1IANiJe8ZXPyeCmgDrHusSOk=; b=J+bMj/wRxk85stXhbZHDDzHZX5rezn/L5YihfEfhtPSJXovzPzVu/sZ4+fuRqQMeSGL3wsJ8/B9rOl2WhqZsJt3yUkZzZW4bWcGGC0/xqzIFI9qDsfw4vPUdAhwx148PhYn8G4FkcK2IEUXrn6669gTIJ2BF6Z7UWuq0FlRJ+mQ= 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 172891336269066.60670709933379; Mon, 14 Oct 2024 06:42:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LIi-0000bc-HG; Mon, 14 Oct 2024 09:39:56 -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 1t0LIg-0000bL-Cv for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:39: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 1t0LIf-0003bh-36 for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:39:54 -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-286-chFqT-O3MRSNeen2hJc3ng-1; Mon, 14 Oct 2024 09:39:47 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 EB17619560B1; Mon, 14 Oct 2024 13:39:46 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 12AC919560AA; Mon, 14 Oct 2024 13:39:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913191; 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=0XYBhezV8ICaxkklWVa1IANiJe8ZXPyeCmgDrHusSOk=; b=VOYPv+98Z5yXGJ4ABxWSVOaV+i/rYDWokairKZoet/Bn56lu8vXQbYU8QL/lODK+Md2B8R jWWBEDS5bzk0yqZw5Y/RxMaMOvVNeB2C5fSo/HTGiEQp2P3bzK1x7Hyw6sYs2NfvtbNPkX LaRxbPT7igB+paYlG1gCDmR6kb/ynBo= X-MC-Unique: chFqT-O3MRSNeen2hJc3ng-1 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 01/20] hw/audio/hda: free timer on exit Date: Mon, 14 Oct 2024 17:39:16 +0400 Message-ID: <20241014133935.470709-2-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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.40 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913363058116600 From: Marc-Andr=C3=A9 Lureau Fixes: 280c1e1cd ("audio/hda: create millisecond timers that handle IO") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-2-marcandre.lureau@redhat.com> --- hw/audio/hda-codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index b40eec9604..74c0292284 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -751,7 +751,7 @@ static void hda_audio_exit(HDACodecDevice *hda) continue; } if (a->use_timer) { - timer_del(st->buft); + timer_free(st->buft); } if (st->output) { AUD_close_out(&a->card, st->voice.out); --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913270; cv=none; d=zohomail.com; s=zohoarc; b=gg0CS2PELzoh+NIQLDcpi4+Cqbuund5ylj4joghR69jvej8qQa3k6G+iBQunl+XTdtCvrbGNIYNhuIf9U8n2OOzr1G29o1WA/gQP7jEn5JmLCwi2wPKpeEviWQM7e2FFJjFFj1dEChZOI+1oGg52MpWtTFieQrH4yI1fkWHn0jU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913270; 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=1PTfUGdCyWdAnIhfD+U+SAAjJ3HTvhDRsaQrP7Y1u1I=; b=AWXTaU3KZtOMnx0yoyb3ojLdmm0bL/sYrly4OPAI2oMSnFynKlgqpiasAl1SAWFe5zF9WXJ95o0ltKGKlvO26JzNDa3XX6Bvzs+A4snSqLjlw/qEaxDqqLf2SJoeLxvCi5a12f68nhudil0TtAYWYjZq6BA4tUwWo5LMpRQ9SHM= 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 1728913270934830.2611564387142; Mon, 14 Oct 2024 06:41:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LIp-0000de-I5; Mon, 14 Oct 2024 09:40:03 -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 1t0LIi-0000bU-54 for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:39:56 -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 1t0LIg-0003c0-Ke for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:39:55 -0400 Received: from mx-prod-mc-02.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-564-5urMRV-iMUG46OpwBiMvIA-1; Mon, 14 Oct 2024 09:39:52 -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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B32CA1955BC1; Mon, 14 Oct 2024 13:39:51 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6D0B11955E8F; Mon, 14 Oct 2024 13:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913194; 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=1PTfUGdCyWdAnIhfD+U+SAAjJ3HTvhDRsaQrP7Y1u1I=; b=fhmgOYnAOMD5SKnpUHzceGCEcUY6AtCaSyhuJ3gV1F1LTk8hMU5Rh8MvzhwcKtUUYzhuEJ AnL7uCyX7vy2p694ZjZuSpCyi7Eielj8XnLX6YsiqG6fYz8kEZiGKrod3t5pgzfiV4YoTk DT5tDL0FE25H95tjVgs1dgeJWsTMN3A= X-MC-Unique: 5urMRV-iMUG46OpwBiMvIA-1 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 02/20] hw/audio/hda: fix memory leak on audio setup Date: Mon, 14 Oct 2024 17:39:17 +0400 Message-ID: <20241014133935.470709-3-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913272613116600 From: Marc-Andr=C3=A9 Lureau When SET_STREAM_FORMAT is called, we should clear the existing setup. Factor out common function to close a stream. Direct leak of 144 byte(s) in 3 object(s) allocated from: #0 0x7f91d38f7350 in calloc (/lib64/libasan.so.8+0xf7350) (BuildId: a4a= d7eb954b390cf00f07fa10952988a41d9fc7a) #1 0x7f91d2ab7871 in g_malloc0 (/lib64/libglib-2.0.so.0+0x64871) (Build= Id: 36b60dbd02e796145a982d0151ce37202ec05649) #2 0x562fa2f447ee in timer_new_full /home/elmarco/src/qemu/include/qemu= /timer.h:538 #3 0x562fa2f4486f in timer_new /home/elmarco/src/qemu/include/qemu/time= r.h:559 #4 0x562fa2f448a9 in timer_new_ns /home/elmarco/src/qemu/include/qemu/t= imer.h:577 #5 0x562fa2f47955 in hda_audio_setup ../hw/audio/hda-codec.c:490 #6 0x562fa2f4897e in hda_audio_command ../hw/audio/hda-codec.c:605 Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-3-marcandre.lureau@redhat.com> --- hw/audio/hda-codec.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 74c0292284..bc661504cf 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -472,6 +472,24 @@ static void hda_audio_set_amp(HDAAudioStream *st) } } =20 +static void hda_close_stream(HDAAudioState *a, HDAAudioStream *st) +{ + if (st->node =3D=3D NULL) { + return; + } + if (a->use_timer) { + timer_free(st->buft); + st->buft =3D NULL; + } + if (st->output) { + AUD_close_out(&a->card, st->voice.out); + st->voice.out =3D NULL; + } else { + AUD_close_in(&a->card, st->voice.in); + st->voice.in =3D NULL; + } +} + static void hda_audio_setup(HDAAudioStream *st) { bool use_timer =3D st->state->use_timer; @@ -484,6 +502,7 @@ static void hda_audio_setup(HDAAudioStream *st) trace_hda_audio_format(st->node->name, st->as.nchannels, fmt2name[st->as.fmt], st->as.freq); =20 + hda_close_stream(st->state, st); if (st->output) { if (use_timer) { cb =3D hda_audio_output_cb; @@ -741,23 +760,11 @@ static void hda_audio_init(HDACodecDevice *hda, static void hda_audio_exit(HDACodecDevice *hda) { HDAAudioState *a =3D HDA_AUDIO(hda); - HDAAudioStream *st; int i; =20 dprint(a, 1, "%s\n", __func__); for (i =3D 0; i < ARRAY_SIZE(a->st); i++) { - st =3D a->st + i; - if (st->node =3D=3D NULL) { - continue; - } - if (a->use_timer) { - timer_free(st->buft); - } - if (st->output) { - AUD_close_out(&a->card, st->voice.out); - } else { - AUD_close_in(&a->card, st->voice.in); - } + hda_close_stream(a, a->st + i); } AUD_remove_card(&a->card); } --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913450; cv=none; d=zohomail.com; s=zohoarc; b=Lg55EfTr4yU0eR4MuGpuJZdMgtg6HuMgzVH57mmKv+vy1kVq8TLYKOv0/x1ljfNB9lt5LLJV7ZYBcEX2d+OkiRNZbNK5QeIELiwzeQj4jQAsFREokVZRFFvX+0PzrysaBGbdwSSDfM+4d5Eu1tv2+cdveI4pA18lIzGr5r3iYAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913450; 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=nHRB1whGVw8mX/aUU1Ur+Ucds5VkQl5/+pCbAos7MKo=; b=JPRvX6fuDap6hy+Rvld3Bj5QEqqxebRlE/BpsNHQrz4DR91uhnoFGTogEeqgyVJMqZtsglzV0ykUJnAw+IGpbRseRaNFg4MPfNoG7Ln9DNXGnIP4uLn9rli/PDw+GvD4OFU2qveeRASQ7YI1Mh2bgkP4dxa5BwZd5+l8OjlWiRo= 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 1728913450689477.11921645736015; Mon, 14 Oct 2024 06:44:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LIs-0000ee-76; Mon, 14 Oct 2024 09:40:06 -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 1t0LIq-0000dn-56 for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:04 -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 1t0LIo-0003cp-C5 for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:03 -0400 Received: from mx-prod-mc-01.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-393-51WBrWTfOsCfimJ9Ta0dKA-1; Mon, 14 Oct 2024 09:39:57 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5EF7E1956058; Mon, 14 Oct 2024 13:39:56 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2E88F19560A2; Mon, 14 Oct 2024 13:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913199; 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=nHRB1whGVw8mX/aUU1Ur+Ucds5VkQl5/+pCbAos7MKo=; b=FX/QzBpOS46j9re5osBjYcJVihJtZ45bQksLs5RswnX1sPbBd7sjwApzQpxB0QBJswQyFn Y5EMpyfIS5sLxkjFidefrCzz1SslYyUDtbrUWgU8QpeRIDum2hfcDRq3JqQXYVql090hik bHI5ISt71wOcByAcRk6+C1U2E3GdBnY= X-MC-Unique: 51WBrWTfOsCfimJ9Ta0dKA-1 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 03/20] ui/dbus: fix leak on message filtering Date: Mon, 14 Oct 2024 17:39:18 +0400 Message-ID: <20241014133935.470709-4-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913451528116600 From: Marc-Andr=C3=A9 Lureau A filter function that wants to drop a message should return NULL, in which case it must also unref the message itself. Fixes: fa88b85de ("ui/dbus: filter out pending messages when scanout") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-4-marcandre.lureau@redhat.com> --- ui/dbus-listener.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index a54123acea..434bd608f2 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -1001,6 +1001,7 @@ dbus_filter(GDBusConnection *connection, serial =3D g_dbus_message_get_serial(message); if (serial <=3D ddl->out_serial_to_discard) { trace_dbus_filter(serial, ddl->out_serial_to_discard); + g_object_unref(message); return NULL; } =20 --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913318; cv=none; d=zohomail.com; s=zohoarc; b=W6F8VK3dGzC2XLGWk/kCLONwdJ9zp7EiyVkeUMGEWJajIwwC9K3Xz4EWj1R0ghlRKNyVctxi77SnFAgGF46gZsQ6cehek/NZ5cs3ThKkw1/nqO9D80RkwHLEhzFUD5Gipxm/CgR/mKb/aWco7HYt6fzij1+GqRJ/MzoKb5B7nnA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913318; 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=9pFt/Nin4HtEmlNkr3ydNSrNAOcODug9K3kQsKhru2w=; b=hG04XxGFRW59d13pKWyeh+O4P+UbeW4hinAxvx2Mmpp4gve6EALxFCtgcj4mng2OpJGQ0Axh4mt6HsQVLI+SlJCFueUBTgrAAYYBpeXaH5CIq8VmNaQq11oAst3UIYhj3oYvvpHC2w5yohNj2Aq1JXxgVNeXADl1J279dvg3qwQ= 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 172891331881925.5251163241295; Mon, 14 Oct 2024 06:41:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LIu-0000fn-Ol; Mon, 14 Oct 2024 09:40:08 -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 1t0LIs-0000fD-Ih for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:06 -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 1t0LIq-0003eZ-Uj for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:06 -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-133-W-MVJSZ1NAOVMOeb7Mubzw-1; Mon, 14 Oct 2024 09:40:01 -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 CE8DB1956095; Mon, 14 Oct 2024 13:40:00 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C17D51955E8F; Mon, 14 Oct 2024 13:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913203; 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=9pFt/Nin4HtEmlNkr3ydNSrNAOcODug9K3kQsKhru2w=; b=hbHUiKvkwIdTkScxcc1Rr5jhdL8N7qxyJq/9/jcVY8Z4ie3CzujiQm82vulhxR1z5c9ccD VLo+SE2Q8LFgMjWt2Lqa2wEsSmSQHZfAniuGe4EjByT2iinJhXLrJpmjjBiV7hWGIowvRS 7DuD+6xdprc3fAUqr1BVCKIvYF1EtjI= X-MC-Unique: W-MVJSZ1NAOVMOeb7Mubzw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" Subject: [PULL 04/20] ui/win32: fix potential use-after-free with dbus shared memory Date: Mon, 14 Oct 2024 17:39:19 +0400 Message-ID: <20241014133935.470709-5-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913320913116600 From: Marc-Andr=C3=A9 Lureau DisplaySurface may be free before the pixman image is freed, since the image is refcounted and used by different objects, including pending dbus messages. Furthermore, setting the destroy function in create_displaysurface_from() isn't appropriate, as it may not be used, and may be overriden as in ramfb. Set the destroy function when the shared handle is set, use the HANDLE directly for destroy data, using a single common helper qemu_pixman_win32_image_destroy(). Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-5-marcandre.lureau@redhat.com> --- include/ui/qemu-pixman.h | 2 ++ hw/display/virtio-gpu.c | 14 ++------------ ui/console.c | 24 ++---------------------- ui/qemu-pixman.c | 15 +++++++++++++++ 4 files changed, 21 insertions(+), 34 deletions(-) diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h index ef13a8210c..e3dd72b9e3 100644 --- a/include/ui/qemu-pixman.h +++ b/include/ui/qemu-pixman.h @@ -97,6 +97,8 @@ void qemu_pixman_glyph_render(pixman_image_t *glyph, =20 void qemu_pixman_image_unref(pixman_image_t *image); =20 +void qemu_pixman_win32_image_destroy(pixman_image_t *image, void *data); + G_DEFINE_AUTOPTR_CLEANUP_FUNC(pixman_image_t, qemu_pixman_image_unref) =20 #endif /* QEMU_PIXMAN_H */ diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 3281842bfe..017a0f170c 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -238,16 +238,6 @@ static uint32_t calc_image_hostmem(pixman_format_code_= t pformat, return height * stride; } =20 -#ifdef WIN32 -static void -win32_pixman_image_destroy(pixman_image_t *image, void *data) -{ - HANDLE handle =3D data; - - qemu_win32_map_free(pixman_image_get_data(image), handle, &error_warn); -} -#endif - static void virtio_gpu_resource_create_2d(VirtIOGPU *g, struct virtio_gpu_ctrl_command *= cmd) { @@ -308,7 +298,7 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *g, bits, c2d.height ? res->hostmem / c2d.height : 0); #ifdef WIN32 if (res->image) { - pixman_image_set_destroy_function(res->image, win32_pixman_ima= ge_destroy, res->handle); + pixman_image_set_destroy_function(res->image, qemu_pixman_win3= 2_image_destroy, res->handle); } #endif } @@ -1327,7 +1317,7 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque,= size_t size, return -EINVAL; } #ifdef WIN32 - pixman_image_set_destroy_function(res->image, win32_pixman_image_d= estroy, res->handle); + pixman_image_set_destroy_function(res->image, qemu_pixman_win32_im= age_destroy, res->handle); #endif =20 res->addrs =3D g_new(uint64_t, res->iov_cnt); diff --git a/ui/console.c b/ui/console.c index 105a0e2c70..8f416ff0b9 100644 --- a/ui/console.c +++ b/ui/console.c @@ -461,24 +461,6 @@ void qemu_displaysurface_win32_set_handle(DisplaySurfa= ce *surface, surface->handle =3D h; surface->handle_offset =3D offset; } - -static void -win32_pixman_image_destroy(pixman_image_t *image, void *data) -{ - DisplaySurface *surface =3D data; - - if (!surface->handle) { - return; - } - - assert(surface->handle_offset =3D=3D 0); - - qemu_win32_map_free( - pixman_image_get_data(surface->image), - surface->handle, - &error_warn - ); -} #endif =20 DisplaySurface *qemu_create_displaysurface(int width, int height) @@ -504,6 +486,8 @@ DisplaySurface *qemu_create_displaysurface(int width, i= nt height) =20 #ifdef WIN32 qemu_displaysurface_win32_set_handle(surface, handle, 0); + pixman_image_set_destroy_function(surface->image, + qemu_pixman_win32_image_destroy, han= dle); #endif return surface; } @@ -519,10 +503,6 @@ DisplaySurface *qemu_create_displaysurface_from(int wi= dth, int height, width, height, (void *)data, linesize); assert(surface->image !=3D NULL); -#ifdef WIN32 - pixman_image_set_destroy_function(surface->image, - win32_pixman_image_destroy, surface); -#endif =20 return surface; } diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c index 6cada8b45e..3870e1a215 100644 --- a/ui/qemu-pixman.c +++ b/ui/qemu-pixman.c @@ -4,6 +4,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "ui/console.h" #include "standard-headers/drm/drm_fourcc.h" #include "trace.h" @@ -267,3 +268,17 @@ void qemu_pixman_glyph_render(pixman_image_t *glyph, pixman_image_unref(ibg); } #endif /* CONFIG_PIXMAN */ + +#ifdef WIN32 +void +qemu_pixman_win32_image_destroy(pixman_image_t *image, void *data) +{ + HANDLE handle =3D data; + + qemu_win32_map_free( + pixman_image_get_data(image), + handle, + &error_warn + ); +} +#endif --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913453; cv=none; d=zohomail.com; s=zohoarc; b=Ci4SYyFIVejZwAQf5akL8XmqHtgREZiWu6hcVvCoEXvplSIN1jVjwx1hgkl0EkYj/PzrA8U3VrN64puVtdWEp95y//qTwTpsF2cRV2rc4Li3LyJz8/C/RzKs5IxubXQXvQsck1yu1eImDSDWdqi/FkF6VMM5ilbjUNHJ8YwxN7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913453; 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=4Sbeeh6Nt5K4NX0Ls8O7TyT/aeG41lol8tOrg2NOQdw=; b=d2/WhTnlcjX3/fujOG1LVFW56Ag+aidyDkng0fIOQVv7ttFEH2s4/QIVRg3MKaTYgdD/ovWoJ5NsnJ7O15aDs+C77i2KYvV6V7zN5hxhRx6VJNc3THBwXPyu4HMIyC4ItiemYMm24zVgD91AB1Oajt8KqU2NVI8QMUG8H3N/BxA= 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 172891345326098.03776703328174; Mon, 14 Oct 2024 06:44:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LIx-0000hl-EF; Mon, 14 Oct 2024 09:40:11 -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 1t0LIw-0000h2-Ma for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:10 -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 1t0LIv-0003qH-4K for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:10 -0400 Received: from mx-prod-mc-02.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-483-dqC3AR8lO-2S0DsJZXlPCQ-1; Mon, 14 Oct 2024 09:40:06 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 552081955D95; Mon, 14 Oct 2024 13:40:05 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3F2A119560AA; Mon, 14 Oct 2024 13:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913208; 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=4Sbeeh6Nt5K4NX0Ls8O7TyT/aeG41lol8tOrg2NOQdw=; b=Me2r2s8dB0uKNyn5PYCAMVGmu91w7A2YH3mLx5fgTWsEWF7aNxdSlB+xvWpbQSQT5Ekwp9 Oi9hc3j8Wg/F1Va4wConltTS5HiLpLwbLaT1uwJxyuaUndmegKGn/rHq1W0YNr4C8Ieo1r vPiIW/VymePyqiIWX78H8dtCuGbCdFo= X-MC-Unique: dqC3AR8lO-2S0DsJZXlPCQ-1 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 05/20] ui/dbus: fix filtering all update messages Date: Mon, 14 Oct 2024 17:39:20 +0400 Message-ID: <20241014133935.470709-6-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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.40 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913453601116600 From: Marc-Andr=C3=A9 Lureau Filtering pending messages when a new scanout is given shouldn't discard pending cursor changes, for example. Since filtering happens in a different thread, use atomic set/get. Fixes: fa88b85dea ("ui/dbus: filter out pending messages when scanout") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-6-marcandre.lureau@redhat.com> --- ui/dbus-listener.c | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 434bd608f2..c69afc05a8 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -26,6 +26,7 @@ #include "qapi/error.h" #include "sysemu/sysemu.h" #include "dbus.h" +#include "glib.h" #ifdef G_OS_UNIX #include #endif @@ -85,7 +86,7 @@ struct _DBusDisplayListener { #endif =20 guint dbus_filter; - guint32 out_serial_to_discard; + guint32 display_serial_to_discard; }; =20 G_DEFINE_TYPE(DBusDisplayListener, dbus_display_listener, G_TYPE_OBJECT) @@ -93,10 +94,12 @@ G_DEFINE_TYPE(DBusDisplayListener, dbus_display_listene= r, G_TYPE_OBJECT) static void dbus_gfx_update(DisplayChangeListener *dcl, int x, int y, int w, int h); =20 -static void ddl_discard_pending_messages(DBusDisplayListener *ddl) +static void ddl_discard_display_messages(DBusDisplayListener *ddl) { - ddl->out_serial_to_discard =3D g_dbus_connection_get_last_serial( + guint32 serial =3D g_dbus_connection_get_last_serial( g_dbus_proxy_get_connection(G_DBUS_PROXY(ddl->proxy))); + + g_atomic_int_set(&ddl->display_serial_to_discard, serial); } =20 #ifdef CONFIG_OPENGL @@ -290,7 +293,7 @@ static void dbus_scanout_dmabuf(DisplayChangeListener *= dcl, return; } =20 - ddl_discard_pending_messages(ddl); + ddl_discard_display_messages(ddl); =20 width =3D qemu_dmabuf_get_width(dmabuf); height =3D qemu_dmabuf_get_height(dmabuf); @@ -338,7 +341,7 @@ static bool dbus_scanout_map(DBusDisplayListener *ddl) return false; } =20 - ddl_discard_pending_messages(ddl); + ddl_discard_display_messages(ddl); =20 if (!qemu_dbus_display1_listener_win32_map_call_scanout_map_sync( ddl->map_proxy, @@ -401,7 +404,7 @@ dbus_scanout_share_d3d_texture( return false; } =20 - ddl_discard_pending_messages(ddl); + ddl_discard_display_messages(ddl); =20 qemu_dbus_display1_listener_win32_d3d11_call_scanout_texture2d( ddl->d3d11_proxy, @@ -659,7 +662,7 @@ static void ddl_scanout(DBusDisplayListener *ddl) surface_stride(ddl->ds) * surface_height(ddl->ds), TRUE, (GDestroyNotify)pixman_image_unref, pixman_image_ref(ddl->ds->imag= e)); =20 - ddl_discard_pending_messages(ddl); + ddl_discard_display_messages(ddl); =20 qemu_dbus_display1_listener_call_scanout( ddl->proxy, surface_width(ddl->ds), surface_height(ddl->ds), @@ -992,17 +995,35 @@ dbus_filter(GDBusConnection *connection, gpointer user_data) { DBusDisplayListener *ddl =3D DBUS_DISPLAY_LISTENER(user_data); - guint32 serial; + guint32 serial, discard_serial; =20 if (incoming) { return message; } =20 serial =3D g_dbus_message_get_serial(message); - if (serial <=3D ddl->out_serial_to_discard) { - trace_dbus_filter(serial, ddl->out_serial_to_discard); - g_object_unref(message); - return NULL; + + discard_serial =3D g_atomic_int_get(&ddl->display_serial_to_discard); + if (serial <=3D discard_serial) { + const char *member =3D g_dbus_message_get_member(message); + static const char *const display_messages[] =3D { + "Scanout", + "Update", +#ifdef CONFIG_GBM + "ScanoutDMABUF", + "UpdateDMABUF", +#endif + "ScanoutMap", + "UpdateMap", + "Disable", + NULL, + }; + + if (g_strv_contains(display_messages, member)) { + trace_dbus_filter(serial, discard_serial); + g_object_unref(message); + return NULL; + } } =20 return message; --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913423; cv=none; d=zohomail.com; s=zohoarc; b=kYJOcnqfjp2+ZzdEAH+U472vavYFgdQRa9OQw8iLg6/VbLMrkmu9+BYSbB3yYg9rWYYkQq1kjS80LZ6WBpOvP2mX81O8Cq0LihHXdZRAmlFe/Rr73PWlzMkY3ryZDFwdBfHU9jyqEgBqmiDkVX5GSxuPqtxIThB5pfJ/Q8xkZ3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913423; 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=/iUJo0tw8HtDvopjdwborUv0KJfopz5zeTSM+qwYWXo=; b=fFcDmFh+voPKwLhwkeKlLS9HrL/Inm4phiSR2aHlvd/9il2dpxo7TmTUZtwZxuKf+zloeg1KPcHAh5vymDWFai6Vbo7G4IJGQoGHDSN1/XF/4GDx1IOByNZLrTjMcgGKYef1RyvNZEaOm28MK7E7GY6G42C6MQju547tfh9CBUM= 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 1728913423070973.8363492356405; Mon, 14 Oct 2024 06:43:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LJ2-0000p3-66; Mon, 14 Oct 2024 09:40:16 -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 1t0LJ0-0000ki-6E for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:14 -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 1t0LIy-0003qw-TK for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:13 -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-240-ZYlKxb7LPsyAzqUft0I1QQ-1; Mon, 14 Oct 2024 09:40:10 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 A26A01955F28; Mon, 14 Oct 2024 13:40:09 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C94FD19560AA; Mon, 14 Oct 2024 13:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913212; 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=/iUJo0tw8HtDvopjdwborUv0KJfopz5zeTSM+qwYWXo=; b=PrQH4KZ/nZr8eV45E6x8WUoGAQYkY/4PQ0A0tRBU888pQSPfBELZGkU2bSuNWcGyHAP5go OFfE0WEVZRzFVhNAvZfYUaJX/q9dMw2dCdOtEWw03Lbq4zQgCksv5oU9EQJj9CB8PAMrt2 fLMnrQBkg5PPcPi53zPlFRCFhhg2TJc= X-MC-Unique: ZYlKxb7LPsyAzqUft0I1QQ-1 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 06/20] ui/dbus: discard display messages on disable Date: Mon, 14 Oct 2024 17:39:21 +0400 Message-ID: <20241014133935.470709-7-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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.40 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913423411116600 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-7-marcandre.lureau@redhat.com> --- ui/dbus-listener.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index c69afc05a8..19cb74e92b 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -107,6 +107,8 @@ static void dbus_scanout_disable(DisplayChangeListener = *dcl) { DBusDisplayListener *ddl =3D container_of(dcl, DBusDisplayListener, dc= l); =20 + ddl_discard_display_messages(ddl); + qemu_dbus_display1_listener_call_disable( ddl->proxy, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); } --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913423; cv=none; d=zohomail.com; s=zohoarc; b=gD2i8p8p6e70EdKPDBotOlP4HeOP2n5FgFceKASIecepQnO3ZFR7YAnLSRSBn+uIh6GRzW144OgEP/w7aG8iso3YuQCuWsZSRdl12jSXFNEoBlw9Te0BdJMlFNGeEUMlErl7zHB8lk/I/jbciJcSC4pcYFHWWA1PrG28jlanN48= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913423; 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=4UkssCHtZn6euZrutNV08M+zkXLuzb949FB1rSug110=; b=mj9veXvJ/NuywEiIYgB6QJb+LzWO3MRjIWBFKxTLlCE/fYaVjVKE+9Hzs9zx0twQE3A/WWHKzXU30AfF2IqRBg5nDH8V4aeCJtoQ4wNr+bLyiSiPPJle/XBerlIcFoeiIIBsr6kyrV1TeHPIfVVvSqiff+6d+WjV3Mw8QSJwqtM= 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 172891342379654.59895579920669; Mon, 14 Oct 2024 06:43:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LJM-0000vg-Gu; Mon, 14 Oct 2024 09:40:36 -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 1t0LJC-0000sS-Dl for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:27 -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 1t0LJ9-0003vQ-Ko for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:25 -0400 Received: from mx-prod-mc-01.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-673-bzmvVnVlMm2e96Yffiwk6A-1; Mon, 14 Oct 2024 09:40:15 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 580421955F3E; Mon, 14 Oct 2024 13:40:14 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 289E03000198; Mon, 14 Oct 2024 13:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913218; 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=4UkssCHtZn6euZrutNV08M+zkXLuzb949FB1rSug110=; b=GAYoIPZxvCqrxgVBfYhJFEQUZrCiK/ecPoBVLUKS8zJnHV+ZdvRwH1yxa5ZykNAWoKoVbq U2yCGEcv3K84SW3Yszbt5+xeV3Y1DrfeG/e3Qk+XE+TWhiWWOk1Pr5fq9LExaOL4byoKws KS4VPF9UIpd3UUraeCMm1eACpCPSX7c= X-MC-Unique: bzmvVnVlMm2e96Yffiwk6A-1 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 07/20] ui/dbus: discard pending CursorDefine on new one Date: Mon, 14 Oct 2024 17:39:22 +0400 Message-ID: <20241014133935.470709-8-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913425450116600 From: Marc-Andr=C3=A9 Lureau Similar to scanout updates, let's discard pending cursor changes. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-8-marcandre.lureau@redhat.com> --- ui/dbus-listener.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 19cb74e92b..eca6890ce6 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -87,6 +87,7 @@ struct _DBusDisplayListener { =20 guint dbus_filter; guint32 display_serial_to_discard; + guint32 cursor_serial_to_discard; }; =20 G_DEFINE_TYPE(DBusDisplayListener, dbus_display_listener, G_TYPE_OBJECT) @@ -102,6 +103,14 @@ static void ddl_discard_display_messages(DBusDisplayLi= stener *ddl) g_atomic_int_set(&ddl->display_serial_to_discard, serial); } =20 +static void ddl_discard_cursor_messages(DBusDisplayListener *ddl) +{ + guint32 serial =3D g_dbus_connection_get_last_serial( + g_dbus_proxy_get_connection(G_DBUS_PROXY(ddl->proxy))); + + g_atomic_int_set(&ddl->cursor_serial_to_discard, serial); +} + #ifdef CONFIG_OPENGL static void dbus_scanout_disable(DisplayChangeListener *dcl) { @@ -502,6 +511,8 @@ static void dbus_cursor_dmabuf(DisplayChangeListener *d= cl, return; } =20 + ddl_discard_cursor_messages(ddl); + egl_dmabuf_import_texture(dmabuf); texture =3D qemu_dmabuf_get_texture(dmabuf); if (!texture) { @@ -745,6 +756,8 @@ static void dbus_cursor_define(DisplayChangeListener *d= cl, DBusDisplayListener *ddl =3D container_of(dcl, DBusDisplayListener, dc= l); GVariant *v_data =3D NULL; =20 + ddl_discard_cursor_messages(ddl); + v_data =3D g_variant_new_from_data( G_VARIANT_TYPE("ay"), c->data, @@ -1028,6 +1041,21 @@ dbus_filter(GDBusConnection *connection, } } =20 + discard_serial =3D g_atomic_int_get(&ddl->cursor_serial_to_discard); + if (serial <=3D discard_serial) { + const gchar *member =3D g_dbus_message_get_member(message); + static const char *const cursor_messages[] =3D { + "CursorDefine", + NULL + }; + + if (g_strv_contains(cursor_messages, member)) { + trace_dbus_filter(serial, discard_serial); + g_object_unref(message); + return NULL; + } + } + return message; } =20 --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913381; cv=none; d=zohomail.com; s=zohoarc; b=lO8lP5rcMAhz3euBqlFTajCelgZ4wNXGQoVT4Q+DWkA0mtknnlrpvM6QFB3Ew+N95JbssAvTB0dyu9s7u4TSQgWVdKSmfT7wOtmIJWn2gbambtc2REFfh+c2WWE9HcmowXbcZt3mvaqgexIidyQTefGU2yKcAJGhA9FlvdjVh9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913381; 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=yK5DK8IRSVjo2xjfM9nW0stAdpht7Vxz2+u7HDto7a8=; b=bxKVcpoMbr3CpheG3yo7sxqICAVip+6/9nsBy6E84vIfDZyWnuLnUslehxNAY30IfBy2PrkLToAUBjFpUHivs33JMPwtVx3pe8l8y8OtRxTW/Vgbb6nvwfJlIyQQ1uDQOIK/i4HvZEM0PlDoTuXwOCFeqfxgnWPlwCoNz6z+aOE= 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 1728913381524757.47975212037; Mon, 14 Oct 2024 06: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 1t0LJQ-00018M-9E; Mon, 14 Oct 2024 09:40: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 1t0LJE-0000t3-3n for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:30 -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 1t0LJC-0003yb-QZ for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:27 -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-644-a8Umvbk1O9KRI0IJTMZ9ww-1; Mon, 14 Oct 2024 09:40:20 -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 4A71C19560B0; Mon, 14 Oct 2024 13:40:19 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1E42F1955E8F; Mon, 14 Oct 2024 13:40:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913225; 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=yK5DK8IRSVjo2xjfM9nW0stAdpht7Vxz2+u7HDto7a8=; b=HR7SYkLyBAgYEKHemajSeBF0RanOIs0fhSSxi5Rh0xEA+dnx3zrNi74M2BrIoSsVUc7C96 ncEub2/4TDvLeDP2Te+XW3E/5vO2BgcE7ai0HX2b6+0OzdGTE7/OPOtf4qvudyn1NtoyzM JMnD7teW27SlloLDPK/jF2FBQ8FUzgU= X-MC-Unique: a8Umvbk1O9KRI0IJTMZ9ww-1 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 08/20] util/memfd: report potential errors on free Date: Mon, 14 Oct 2024 17:39:23 +0400 Message-ID: <20241014133935.470709-9-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913383137116600 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-9-marcandre.lureau@redhat.com> --- util/memfd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/memfd.c b/util/memfd.c index 4a3c07e0be..8a2e906962 100644 --- a/util/memfd.c +++ b/util/memfd.c @@ -28,6 +28,7 @@ #include "qemu/osdep.h" =20 #include "qapi/error.h" +#include "qemu/error-report.h" #include "qemu/memfd.h" #include "qemu/host-utils.h" =20 @@ -149,11 +150,15 @@ err: void qemu_memfd_free(void *ptr, size_t size, int fd) { if (ptr) { - munmap(ptr, size); + if (munmap(ptr, size) !=3D 0) { + error_report("memfd munmap() failed: %s", strerror(errno)); + } } =20 if (fd !=3D -1) { - close(fd); + if (close(fd) !=3D 0) { + error_report("memfd close() failed: %s", strerror(errno)); + } } } =20 --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913359; cv=none; d=zohomail.com; s=zohoarc; b=msHnXzbOGNN98gydInhp4xfLHTqO+yLTGT/i9KrvopZdTmwug76p/9wN+WyssUho6Uh8RdTiRHTfuSQtrEV9gOzm5eLRhbgRsH8hD9FnRwvCeTPw7MtXUqkUEbiiU0b5ROsjdziVB3iNMwl+QumlSriy6gQ/BhRbr6vJTRsQVBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913359; 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=rAoGnKwqk8h22mctB6lanWlmJg4bmO5JRQex5Rblr34=; b=HCAdR41dd58F+FC+whLKRzyPIHzbcKZXIRvaZUCZqtqUcA83leaBz5j9D8EuN26mAXrSol0HuQBmeCsBlpnIveaA33B9iqhk+VVedA5aHS77RpNJ2GQjZgalK4he2DzoaZJDNzX368wpv1kwHWDbSxCcXS6pL9uM4yg3eO31KfI= 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 1728913359881973.1580822279957; Mon, 14 Oct 2024 06:42:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LJO-000149-Bz; Mon, 14 Oct 2024 09:40:38 -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 1t0LJH-0000tp-Hd for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40: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 1t0LJG-0003zK-4c for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:31 -0400 Received: from mx-prod-mc-02.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-582-6REvvYydN72L0Tcf4tN-Aw-1; Mon, 14 Oct 2024 09:40:25 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 370021955EEA; Mon, 14 Oct 2024 13:40:24 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E870E1956089; Mon, 14 Oct 2024 13:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913228; 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=rAoGnKwqk8h22mctB6lanWlmJg4bmO5JRQex5Rblr34=; b=CNbXVgYdNMX9Za/ILhzEApN5AkJUta7cnXlJJOw2UcBPhdoakBIPPxcPmdzKpnxmpBJnQI BloAxg6CdT4ljJzL/XWtkZE3kbhlZCBDYx9hgqVNmnVXl2M4ZnceRa/6ivdng9FSIO3Yv5 gkz2jWjBvN5b0ef+YZlDh03AYjfKNaI= X-MC-Unique: 6REvvYydN72L0Tcf4tN-Aw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" Subject: [PULL 09/20] ui/pixman: generalize shared_image_destroy Date: Mon, 14 Oct 2024 17:39:24 +0400 Message-ID: <20241014133935.470709-10-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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.15 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913361070116600 From: Marc-Andr=C3=A9 Lureau Learn to free memfd-allocated shared memory. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-10-marcandre.lureau@redhat.com> --- include/ui/qemu-pixman.h | 2 +- hw/display/virtio-gpu.c | 4 ++-- ui/console.c | 2 +- ui/qemu-pixman.c | 20 ++++++++++++-------- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h index e3dd72b9e3..a97f56d09a 100644 --- a/include/ui/qemu-pixman.h +++ b/include/ui/qemu-pixman.h @@ -97,7 +97,7 @@ void qemu_pixman_glyph_render(pixman_image_t *glyph, =20 void qemu_pixman_image_unref(pixman_image_t *image); =20 -void qemu_pixman_win32_image_destroy(pixman_image_t *image, void *data); +void qemu_pixman_shared_image_destroy(pixman_image_t *image, void *data); =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(pixman_image_t, qemu_pixman_image_unref) =20 diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 017a0f170c..77f6e76f23 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -298,7 +298,7 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *g, bits, c2d.height ? res->hostmem / c2d.height : 0); #ifdef WIN32 if (res->image) { - pixman_image_set_destroy_function(res->image, qemu_pixman_win3= 2_image_destroy, res->handle); + pixman_image_set_destroy_function(res->image, qemu_pixman_shar= ed_image_destroy, res->handle); } #endif } @@ -1317,7 +1317,7 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque,= size_t size, return -EINVAL; } #ifdef WIN32 - pixman_image_set_destroy_function(res->image, qemu_pixman_win32_im= age_destroy, res->handle); + pixman_image_set_destroy_function(res->image, qemu_pixman_shared_i= mage_destroy, res->handle); #endif =20 res->addrs =3D g_new(uint64_t, res->iov_cnt); diff --git a/ui/console.c b/ui/console.c index 8f416ff0b9..fdd76c2be4 100644 --- a/ui/console.c +++ b/ui/console.c @@ -487,7 +487,7 @@ DisplaySurface *qemu_create_displaysurface(int width, i= nt height) #ifdef WIN32 qemu_displaysurface_win32_set_handle(surface, handle, 0); pixman_image_set_destroy_function(surface->image, - qemu_pixman_win32_image_destroy, han= dle); + qemu_pixman_shared_image_destroy, ha= ndle); #endif return surface; } diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c index 3870e1a215..46a91e7f7a 100644 --- a/ui/qemu-pixman.c +++ b/ui/qemu-pixman.c @@ -6,6 +6,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "ui/console.h" +#include "qemu/memfd.h" #include "standard-headers/drm/drm_fourcc.h" #include "trace.h" =20 @@ -269,16 +270,19 @@ void qemu_pixman_glyph_render(pixman_image_t *glyph, } #endif /* CONFIG_PIXMAN */ =20 -#ifdef WIN32 void -qemu_pixman_win32_image_destroy(pixman_image_t *image, void *data) +qemu_pixman_shared_image_destroy(pixman_image_t *image, void *data) { + void *ptr =3D pixman_image_get_data(image); + +#ifdef WIN32 HANDLE handle =3D data; =20 - qemu_win32_map_free( - pixman_image_get_data(image), - handle, - &error_warn - ); -} + qemu_win32_map_free(ptr, handle, &error_warn); +#else + int shmfd =3D GPOINTER_TO_INT(data); + size_t size =3D pixman_image_get_height(image) * pixman_image_get_stri= de(image); + + qemu_memfd_free(ptr, size, shmfd); #endif +} --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913387; cv=none; d=zohomail.com; s=zohoarc; b=iqJt/itImG7mcgZMTS+N4xTskDt9rN/JH5yJGUw6vGkZa8K5IvvLJz6ExW8JftqpGwW3FaOOxTcNHBlIfMiMnfhCNMHpOavwUQ40/axWTpuhcbu33LSL45V8aYHw61/y+kSoiCU4UAf3v0xds00rTNoyzIB/8+GRckGKNFCOGOE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913387; 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=l1dt4gJ4zQFanIv9RIqjXOgzzwqYe/Xz1Gzw9Wy38Dc=; b=KKJvhezdtbAVGNOdU20p7odFbveNTpjTgJeWpVGw5zCM5VJes+sopqFj0GWiEFKErOf7n7xsyaII28ToUdjjfwRyOa0LCVfdCTAuYb0u0V+XXH3+sEjTPtgLVCKPxw2NzX3TNQSELyPSEGzK2uhjE1qtNjIE0oxZ+QAq8RTH31I= 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 1728913387178794.7700870264664; Mon, 14 Oct 2024 06:43:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LJR-0001Ak-0p; Mon, 14 Oct 2024 09:40:41 -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 1t0LJJ-00010J-Qt for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40: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 1t0LJI-0003zu-E2 for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:33 -0400 Received: from mx-prod-mc-02.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-628-kOxqk_cRMtmrCn95t58_xQ-1; Mon, 14 Oct 2024 09:40:30 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6529C1955D5D; Mon, 14 Oct 2024 13:40:29 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 34F3119560AA; Mon, 14 Oct 2024 13:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913231; 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=l1dt4gJ4zQFanIv9RIqjXOgzzwqYe/Xz1Gzw9Wy38Dc=; b=BH34o8NIaoPdTr+lqNyNSihI6ywwqL4/la65VHKEqteTE80r2NarKvihQVn03+j8rgl7oz hej3oAC2uQhlSgdvZ8IkRQ2+XH+3mrLlG5ip1MEQCgbJrWuDAbW7AjEJK21MpZZiv2C2Ku b1u0tdJgOD2SaERW0Wq/lk1imDQ4CYc= X-MC-Unique: kOxqk_cRMtmrCn95t58_xQ-1 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 10/20] ui/dbus: do not limit to one listener per connection / bus name Date: Mon, 14 Oct 2024 17:39:25 +0400 Message-ID: <20241014133935.470709-11-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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.40 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913389235116600 From: Marc-Andr=C3=A9 Lureau This is an arbitrary limitation that doesn't concern QEMU directly and may make some use cases unnecessarily more complicated. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-11-marcandre.lureau@redhat.com> --- ui/dbus-console.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/ui/dbus-console.c b/ui/dbus-console.c index 578b67f62b..5eb1d40d16 100644 --- a/ui/dbus-console.c +++ b/ui/dbus-console.c @@ -41,7 +41,7 @@ struct _DBusDisplayConsole { DisplayChangeListener dcl; =20 DBusDisplay *display; - GHashTable *listeners; + GPtrArray *listeners; QemuDBusDisplay1Console *iface; =20 QemuDBusDisplay1Keyboard *iface_kbd; @@ -142,8 +142,7 @@ dbus_display_console_init(DBusDisplayConsole *object) { DBusDisplayConsole *ddc =3D DBUS_DISPLAY_CONSOLE(object); =20 - ddc->listeners =3D g_hash_table_new_full(g_str_hash, g_str_equal, - NULL, g_object_unref); + ddc->listeners =3D g_ptr_array_new_with_free_func(g_object_unref); ddc->dcl.ops =3D &dbus_console_dcl_ops; } =20 @@ -157,7 +156,7 @@ dbus_display_console_dispose(GObject *object) g_clear_object(&ddc->iface_mouse); g_clear_object(&ddc->iface_kbd); g_clear_object(&ddc->iface); - g_clear_pointer(&ddc->listeners, g_hash_table_unref); + g_clear_pointer(&ddc->listeners, g_ptr_array_unref); g_clear_pointer(&ddc->kbd, qkbd_state_free); =20 G_OBJECT_CLASS(dbus_display_console_parent_class)->dispose(object); @@ -179,7 +178,7 @@ listener_vanished_cb(DBusDisplayListener *listener) =20 trace_dbus_listener_vanished(name); =20 - g_hash_table_remove(ddc->listeners, name); + g_ptr_array_remove_fast(ddc->listeners, listener); qkbd_state_lift_all_keys(ddc->kbd); } =20 @@ -267,16 +266,6 @@ dbus_console_register_listener(DBusDisplayConsole *ddc, DBusDisplayListener *listener; int fd; =20 - if (sender && g_hash_table_contains(ddc->listeners, sender)) { - g_dbus_method_invocation_return_error( - invocation, - DBUS_DISPLAY_ERROR, - DBUS_DISPLAY_ERROR_INVALID, - "`%s` is already registered!", - sender); - return DBUS_METHOD_INVOCATION_HANDLED; - } - #ifdef G_OS_WIN32 if (!dbus_win32_import_socket(invocation, arg_listener, &fd)) { return DBUS_METHOD_INVOCATION_HANDLED; @@ -331,9 +320,7 @@ dbus_console_register_listener(DBusDisplayConsole *ddc, return DBUS_METHOD_INVOCATION_HANDLED; } =20 - g_hash_table_insert(ddc->listeners, - (gpointer)dbus_display_listener_get_bus_name(liste= ner), - listener); + g_ptr_array_add(ddc->listeners, listener); g_object_connect(listener_conn, "swapped-signal::closed", listener_vanished_cb, liste= ner, NULL); --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913363; cv=none; d=zohomail.com; s=zohoarc; b=MXwhEjppotgDcR8VshbCeT/J6nbNXvHvc287dtFobUQ8A20t/RNEs8mh6s/PBx+Yte5+HR1lNIAX37vd5ty+MPavXrZtWmdPH2KHCqnjpw/4KBAKrPNaWOErS6GUABF0SaD6+IU5vo7SVG5ekKIhZtdbOk6nHTeqx2/YMYFDt68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913363; 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=GWsI9SwHhIzKFlX7OZDBlAv2wQLqzoCkRBUZVwdj6QI=; b=KrVlNYpz7QfTwNpYs5wY/bI/8n090Pm6YWwONoBvD6q2jprDQ9d6Cnsixuu8tDJLVZZ0mSnIt1bNnexLpcbdp7KLVw+J8yQTiBW7y1UCMioA4vO58+eAKu+e4AA7e3K4QsN4Bcfw/k7AOF/x4Zrtbr839lJU9DWSihHzxo/eE3Y= 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 1728913363914428.7221162164535; Mon, 14 Oct 2024 06:42:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LJS-0001Cn-JI; Mon, 14 Oct 2024 09:40:42 -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 1t0LJQ-00018R-5B for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:40 -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 1t0LJO-00040I-QJ for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:39 -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-132-sawv3cajPh-0IUScfWH2oA-1; Mon, 14 Oct 2024 09:40:35 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E9F7519560BE; Mon, 14 Oct 2024 13:40:34 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 59578300019B; Mon, 14 Oct 2024 13:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913237; 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=GWsI9SwHhIzKFlX7OZDBlAv2wQLqzoCkRBUZVwdj6QI=; b=WgHwaCz/wVhP7vHa43cJB8yxWCtHIGjYKFXWaypBv+0xJZ2C9BJrdIxa0pdM5TLC1nv/Yu FdqCCSuRx6hx9uitXkyo5UG6IvkGQhHgI0k8Tj1fvnlQkbWhbqsrvIQaIWuBrLWAWUe1Vh l8vsL8earMlQdfRWizQ+/XlmvrrBX6w= X-MC-Unique: sawv3cajPh-0IUScfWH2oA-1 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 11/20] ui/dbus: add trace for can_share_map Date: Mon, 14 Oct 2024 17:39:26 +0400 Message-ID: <20241014133935.470709-12-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913365074116600 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-12-marcandre.lureau@redhat.com> --- ui/dbus-listener.c | 1 + ui/trace-events | 1 + 2 files changed, 2 insertions(+) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index eca6890ce6..7142afcddb 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -1089,6 +1089,7 @@ dbus_display_listener_new(const char *bus_name, ddl->console =3D console; =20 dbus_display_listener_setup_shared_map(ddl); + trace_dbus_can_share_map(ddl->can_share_map); dbus_display_listener_setup_d3d11(ddl); =20 con =3D qemu_console_lookup_by_index(dbus_display_console_get_index(co= nsole)); diff --git a/ui/trace-events b/ui/trace-events index fb253c1666..3da0d5e280 100644 --- a/ui/trace-events +++ b/ui/trace-events @@ -166,6 +166,7 @@ dbus_clipboard_unregister(const char *bus_name) "peer %= s" dbus_scanout_texture(uint32_t tex_id, bool backing_y_0_top, uint32_t backi= ng_width, uint32_t backing_height, uint32_t x, uint32_t y, uint32_t w, uint= 32_t h) "tex_id:%u y0top:%d back:%ux%u %u+%u-%ux%u" dbus_gl_gfx_switch(void *p) "surf: %p" dbus_filter(unsigned int serial, unsigned int filter) "serial=3D%u (<=3D %= u)" +dbus_can_share_map(bool share) "can_share_map: %d" =20 # egl-helpers.c egl_init_d3d11_device(void *p) "d3d device: %p" --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913439; cv=none; d=zohomail.com; s=zohoarc; b=LR9CdHo63eBKfvl7qPtrbP0MiO+34ZamXt+eH2/nUl1EU/AQ77AvKaRS8cDFn/a0wTyrBU/omEDFqDg6HgHIj2lxnrTf+/wRXy09Kv2R18JLDTXQx2XlBy2j5Dzdoh04ODSOn75pAMBvJHecgMrlUpbZO1yVvcM7xaGoO7XIffY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913439; 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=7dovugkP7VQlHiHIlAhTAIbVz2WTHmd/aEchJnZzyJw=; b=RgldL0IKveDKZlCGBn2Z+ID93LUT2s4LefWwAZ85De/06FrFkgH9uTr15SQdmXTIDGWEYDYUg96PYwXk0AQWNM+i5lb1IoacaWP3SHk8iQY/EJPL2nmynGNngLwI8gEii3h4jpwd3ULZyNfP8TTksq3l5tyfd8J0LX47v/LFezU= 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 1728913439585854.09390176568; Mon, 14 Oct 2024 06:43:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LJY-0001VZ-8p; Mon, 14 Oct 2024 09:40:48 -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 1t0LJT-0001Jk-GU for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:44 -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 1t0LJR-00040i-Uc for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:43 -0400 Received: from mx-prod-mc-02.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-446--xx8MJlXP9O6qxJnD6Usgg-1; Mon, 14 Oct 2024 09:40:40 -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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 230F71955D95; Mon, 14 Oct 2024 13:40:39 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 527A63000198; Mon, 14 Oct 2024 13:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913241; 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=7dovugkP7VQlHiHIlAhTAIbVz2WTHmd/aEchJnZzyJw=; b=i1aFulrqU2KhUe2SlDA3YEhTdpXzH2KUfOAQCuNEP9MgkuPFFEvcS0iFbU3AL4p28ihNp4 ypyZdAtV/FcXPDs0FEKRej1455f6N1rtDB1Z45/VOAncUbQo4+mbxKAWS/CoRoyF39ogNh xGlAr9TGKZKn4GPFTiPOjGzmKpgr5RQ= X-MC-Unique: -xx8MJlXP9O6qxJnD6Usgg-1 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 12/20] ui/surface: allocate shared memory on !win32 Date: Mon, 14 Oct 2024 17:39:27 +0400 Message-ID: <20241014133935.470709-13-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913441578116600 From: Marc-Andr=C3=A9 Lureau Use qemu_memfd_alloc() to allocate the display surface memory, which will fallback on tmpfile/mmap() on systems without memfd, and allow to share the display with other processes. This is similar to how display memory is allocated on win32 since commit 09b4c198 ("console/win32: allocate shareable display surface"). Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-13-marcandre.lureau@redhat.com> --- include/ui/surface.h | 6 ++++++ ui/console.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/include/ui/surface.h b/include/ui/surface.h index 345b19169d..37d03be4af 100644 --- a/include/ui/surface.h +++ b/include/ui/surface.h @@ -26,6 +26,9 @@ typedef struct DisplaySurface { #ifdef WIN32 HANDLE handle; uint32_t handle_offset; +#else + int shmfd; + uint32_t shmfd_offset; #endif } DisplaySurface; =20 @@ -40,6 +43,9 @@ DisplaySurface *qemu_create_placeholder_surface(int w, in= t h, #ifdef WIN32 void qemu_displaysurface_win32_set_handle(DisplaySurface *surface, HANDLE h, uint32_t offset); +#else +void qemu_displaysurface_set_shmfd(DisplaySurface *surface, + int shmfd, uint32_t offset); #endif =20 DisplaySurface *qemu_create_displaysurface(int width, int height); diff --git a/ui/console.c b/ui/console.c index fdd76c2be4..3a2aaba3c7 100644 --- a/ui/console.c +++ b/ui/console.c @@ -37,6 +37,7 @@ #include "trace.h" #include "exec/memory.h" #include "qom/object.h" +#include "qemu/memfd.h" =20 #include "console-priv.h" =20 @@ -461,6 +462,15 @@ void qemu_displaysurface_win32_set_handle(DisplaySurfa= ce *surface, surface->handle =3D h; surface->handle_offset =3D offset; } +#else +void qemu_displaysurface_set_shmfd(DisplaySurface *surface, + int shmfd, uint32_t offset) +{ + assert(surface->shmfd =3D=3D -1); + + surface->shmfd =3D shmfd; + surface->shmfd_offset =3D offset; +} #endif =20 DisplaySurface *qemu_create_displaysurface(int width, int height) @@ -469,12 +479,16 @@ DisplaySurface *qemu_create_displaysurface(int width,= int height) void *bits =3D NULL; #ifdef WIN32 HANDLE handle =3D NULL; +#else + int shmfd =3D -1; #endif =20 trace_displaysurface_create(width, height); =20 #ifdef WIN32 bits =3D qemu_win32_map_alloc(width * height * 4, &handle, &error_abor= t); +#else + bits =3D qemu_memfd_alloc("displaysurface", width * height * 4, 0, &sh= mfd, &error_abort); #endif =20 surface =3D qemu_create_displaysurface_from( @@ -486,9 +500,13 @@ DisplaySurface *qemu_create_displaysurface(int width, = int height) =20 #ifdef WIN32 qemu_displaysurface_win32_set_handle(surface, handle, 0); - pixman_image_set_destroy_function(surface->image, - qemu_pixman_shared_image_destroy, ha= ndle); + void *data =3D handle; +#else + qemu_displaysurface_set_shmfd(surface, shmfd, 0); + void *data =3D GINT_TO_POINTER(shmfd); #endif + pixman_image_set_destroy_function(surface->image, qemu_pixman_shared_i= mage_destroy, data); + return surface; } =20 @@ -499,6 +517,9 @@ DisplaySurface *qemu_create_displaysurface_from(int wid= th, int height, DisplaySurface *surface =3D g_new0(DisplaySurface, 1); =20 trace_displaysurface_create_from(surface, width, height, format); +#ifndef WIN32 + surface->shmfd =3D -1; +#endif surface->image =3D pixman_image_create_bits(format, width, height, (void *)data, linesize); @@ -512,6 +533,9 @@ DisplaySurface *qemu_create_displaysurface_pixman(pixma= n_image_t *image) DisplaySurface *surface =3D g_new0(DisplaySurface, 1); =20 trace_displaysurface_create_pixman(surface); +#ifndef WIN32 + surface->shmfd =3D -1; +#endif surface->image =3D pixman_image_ref(image); =20 return surface; --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913387; cv=none; d=zohomail.com; s=zohoarc; b=WuG+9ZxbQg8LB1GBJkYHwDH/1SF87vf4WO2G400PVUaC5ZkugOzY+JvHwJY+8cRgTkfXL5aNrOoKylMCEdldulGL+Ab/6fVNbBfBuMZNGPoDxUrlsxsdklM1Ya88FfFf9jsMSBZMj/b4j55NIdBT8S1JUStBFGGVDeNwCTuW3GQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913387; 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=3PruoiI617525VQgvhlaBSdl9+pQieDR76NYht7d+cM=; b=d04hPLdv2bdxGhYCGoqaHECXo1+WRn0KO1NAXMIDrvr/J9ptcmpzjIXq/dO1nuz1wkTsKGQ6lNyqfqy663g3f1Y7JNICqWERPGy3bSC75ToX9OKmHVFn1ETKdfejEMpUiiQu4TnoRVtZ2ytz0lKaVD5wtMmkrlvVh1AsYIggJOw= 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 1728913387043275.085090770267; Mon, 14 Oct 2024 06:43:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LJc-0001ox-N2; Mon, 14 Oct 2024 09:40:52 -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 1t0LJZ-0001dA-Oh for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:49 -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 1t0LJY-00041J-A3 for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:49 -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-629-wc_6AJiUPievU75sO0CISw-1; Mon, 14 Oct 2024 09:40:46 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 299D219560AE; Mon, 14 Oct 2024 13:40:45 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1C66D19560AA; Mon, 14 Oct 2024 13:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913247; 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=3PruoiI617525VQgvhlaBSdl9+pQieDR76NYht7d+cM=; b=Ab1c6BctLiaeyYijTDC1rpO36OutX3+3bLCh3fIiyQG5gevdtQ1seNGRD5/6SvdjG1Ebsj 6nu5yXASlmGgsbrkiPh5bJJUVvDBF1PB5CGY4leDxC+3yS8gzEuIW8E/0Fb8A0oGTAWEV7 Ndu3R+56kFMMTtD9e+k2ndUKA5iC9+Q= X-MC-Unique: wc_6AJiUPievU75sO0CISw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 13/20] meson: find_program('gdbus-codegen') directly Date: Mon, 14 Oct 2024 17:39:28 +0400 Message-ID: <20241014133935.470709-14-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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.40 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913389221116600 From: Marc-Andr=C3=A9 Lureau gio.pc variable is a bit bogus in context of cross-compilation, since it contains an absolute path, relative to the sysroot directory. On Fedora, it= ends up as: /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/usr/bin/gdbus-codegen path which does not exist because it is not shipped by Fedora mingw packages. Instead, we can rely on meson find_program() behaviour to do a better job based on its search order and capabilities. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-14-marcandre.lureau@redhat.com> --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index aecc381932..ed0d2086cb 100644 --- a/meson.build +++ b/meson.build @@ -1036,7 +1036,7 @@ if not get_option('gio').auto() or have_system gio =3D not_found endif if gio.found() - gdbus_codegen =3D find_program(gio.get_variable('gdbus_codegen'), + gdbus_codegen =3D find_program('gdbus-codegen', required: get_option('gio')) gio_unix =3D dependency('gio-unix-2.0', required: get_option('gio'), method: 'pkg-config') --=20 2.47.0 From nobody Sat Nov 23 20:57:50 2024 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=1728913282; cv=none; d=zohomail.com; s=zohoarc; b=NceifrTS5FkdtYuLtKMw+peppjH2h3J4o2oI2CIYLFmX9943EdNeMgml0Gpdp2UIkWSW4JzDOYtZFJzA66n+707KMhy49x9LudSYmkJ1Kmz5GKx2wpF8eXvtpjnDBd6V09ARdza9iQ+uT3nz0lejfNG+WIww35VrPY03XqkL/YM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728913282; 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=Yrqoflg3l1dftDMu79xkNPIsGxZyHa/Gmrgv7tDquws=; b=P6F4ZRstB0AW1XdmY58JolKLIYje7YJEvejq69w/Ubkqu6/fvN1IDqZSuHuJCtIWE4FO64byMxlZyk4W5pOjeYDKnoDiP3vOVycRb+bOUVTm/c+Z3Ak2R7+trN3mPNhu9fkUmU8T0hinz61lB+n+CIEhyXaqxZ0vqV0p0/r5ea0= 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 17289132820888.528232666828785; Mon, 14 Oct 2024 06:41:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0LJh-0002FL-NO; Mon, 14 Oct 2024 09:40:57 -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 1t0LJg-00028K-2A for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:56 -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 1t0LJe-00042P-Ij for qemu-devel@nongnu.org; Mon, 14 Oct 2024 09:40:55 -0400 Received: from mx-prod-mc-01.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-163-GoNS2EvqPueDCKVN68UG7A-1; Mon, 14 Oct 2024 09:40:50 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9241A1955F3D; Mon, 14 Oct 2024 13:40:49 +0000 (UTC) Received: from localhost (unknown [10.39.208.12]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 71D5E1956089; Mon, 14 Oct 2024 13:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728913253; 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=Yrqoflg3l1dftDMu79xkNPIsGxZyHa/Gmrgv7tDquws=; b=UOpAl1oHz7ECzHf6A0wMdWQiyz/W/nD+eaIiU028aIdjEFn4AhLO8pVze55FjyE6zSG6Dg FRADP5t/U5VEN8ZYiIqaeksvtFBsiuhPAhwz4vttFJi+5Kahu9Iql+LIS4vzZIcSmiHR4V sh1Lc7Qx9vswJToosZMuhLbelUSemtQ= X-MC-Unique: GoNS2EvqPueDCKVN68UG7A-1 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 14/20] ui/dbus: make Listener.Win32.Map win32-specific Date: Mon, 14 Oct 2024 17:39:29 +0400 Message-ID: <20241014133935.470709-15-marcandre.lureau@redhat.com> In-Reply-To: <20241014133935.470709-1-marcandre.lureau@redhat.com> References: <20241014133935.470709-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.15 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.076, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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: 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: 1728913284667116600 From: Marc-Andr=C3=A9 Lureau There are no types specific to Windows, so the code compiles on other platforms, but its useless on !Windows. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-15-marcandre.lureau@redhat.com> --- ui/dbus-display1.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/dbus-display1.xml b/ui/dbus-display1.xml index ce35d64eea..d5bb279698 100644 --- a/ui/dbus-display1.xml +++ b/ui/dbus-display1.xml @@ -476,6 +476,7 @@ org.qemu.Display1.Listener on ``/org/qemu/Display1/Listener`` for Wi= ndows specific shared memory scanouts. --> + + + + + + + + + + + + + + + + + + + + + + +