From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640607; cv=none; d=zohomail.com; s=zohoarc; b=mOa6LfvvW5cXyk5BRrsbKrKuewZOawnIfi6C9crO+O4PqDjdhQwgLO4bVPo+cOgTq2z96wbSDrfn/wvMefR+VRx1sXM8JDZrqgJnOk7pYLY8yp+mFbE3hln4uss0dtJdKtMeuWtyOJjILTNNgFI6Fv/xyhMPy/N6jqK3D3T23yk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640607; 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=3ljHRkhuv+A2yN+7QxHiz97kCfvWj865DJY7sh7n1vs=; b=LQKekbF9+snsQLt5YYSbIkPNrSTziCUp1SAQ16TspGUUuZbCz4Z0WAvRtMs5mLluCAV2cz7mKBAZbHAGCPE+1UTZzVQGhxpHxHc1cU7ZeBTbHRyEpA31NlqoeqshSZEyxpxiQmM+uYpU/HtqwfIbfKY75hVipoznsHsOMZ0TyNY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640607412833.4275316891877; Fri, 8 Aug 2025 01:10:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9c-0007Db-3r; Fri, 08 Aug 2025 04:08:44 -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 1ukI9T-00072w-7J for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08: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 1ukI9R-0006TU-Fd for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:34 -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-338-6F2Yr0EqNXCCXIkD7ZstdA-1; Fri, 08 Aug 2025 04:08:27 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8EF1119560B7; Fri, 8 Aug 2025 08:08:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EAC46180028A; Fri, 8 Aug 2025 08:08:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4754621E6924; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640512; 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=3ljHRkhuv+A2yN+7QxHiz97kCfvWj865DJY7sh7n1vs=; b=dn4NTcQlq5h/+uWp41IIsaWXniZn8pXYcYX8pCuABLIPAySsC9hpJMP9SwUnvlRK/rKx/N cbRLhZqwVPVrM8i3dRDPVg7CRfVCxSEwEkpbE12OSYTWrJc7e9GHCO4WzL4DsuTtsuDrkq HymG3YgxfFyfgQNzYac/W1Dr1PUjDZQ= X-MC-Unique: 6F2Yr0EqNXCCXIkD7ZstdA-1 X-Mimecast-MFC-AGG-ID: 6F2Yr0EqNXCCXIkD7ZstdA_1754640507 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 01/12] monitor: Clean up HMP gdbserver error reporting Date: Fri, 8 Aug 2025 10:08:12 +0200 Message-ID: <20250808080823.2638861-2-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640609676124100 HMP command gdbserver used to emit two error messages for certain errors. For instance, with -M none: (qemu) gdbserver gdbstub: meaningless to attach gdb to a machine without any CPU. Could not open gdbserver on device 'tcp::1234' The first message is the specific error, and the second one a generic additional message that feels superfluous to me. Commit c0e6b8b798b (system: propagate Error to gdbserver_start (and other device setups)) turned the first message into a warning: warning: gdbstub: meaningless to attach gdb to a machine without any CP= U. Could not open gdbserver on device 'tcp::1234' This is arguably worse. hmp_gdbserver() passes &error_warn to gdbserver_start(), so that failure gets reported as warning, and then additionally emits the generic error on failure. This is a misuse of &error_warn. Instead, receive the error in &err and report it, as usual. With this, gdbserver reports just the error: gdbstub: meaningless to attach gdb to a machine without any CPU. Cc: Alex Benn=C3=A9e Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrang=C3=A9 --- include/exec/gdbstub.h | 3 --- monitor/hmp-cmds.c | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index a16c0051ce..bd7182c4d3 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -55,9 +55,6 @@ void gdb_unregister_coprocessor_all(CPUState *cpu); * system emulation you can use a full chardev spec for your gdbserver * port. * - * The error handle should be either &error_fatal (for start-up) or - * &error_warn (for QMP/HMP initiated sessions). - * * Returns true when server successfully started. */ bool gdbserver_start(const char *port_or_device, Error **errp); diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 74a0f56566..33a88ce205 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -280,14 +280,15 @@ void hmp_log(Monitor *mon, const QDict *qdict) =20 void hmp_gdbserver(Monitor *mon, const QDict *qdict) { + Error *err =3D NULL; const char *device =3D qdict_get_try_str(qdict, "device"); + if (!device) { device =3D "tcp::" DEFAULT_GDBSTUB_PORT; } =20 - if (!gdbserver_start(device, &error_warn)) { - monitor_printf(mon, "Could not open gdbserver on device '%s'\n", - device); + if (!gdbserver_start(device, &err)) { + error_report_err(err); } else if (strcmp(device, "none") =3D=3D 0) { monitor_printf(mon, "Disabled gdbserver\n"); } else { --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640653; cv=none; d=zohomail.com; s=zohoarc; b=X4ZcLPTUXGYf2NFF0RThycqFPgRfgWsdFTUCB1wbEGfu6uKDn34Vyow5OAHxFlqInrPUwLPQvhRqB0URqfby/E1wRPXJbbu4Kl7anAItIq/u4pQl+XMBJSbY/5yKCs7X2AsQYCX+QJjQTgocP3ohlR1qvDLlM6bmZpHWzZulu5w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640653; h=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=1r0cQ0Q83RNcWR+DFapG2wZddI27l+q5A5mrQBO+m4A=; b=GJUt7LHS5PsLfexx0p2FJWXG5NtYmYb+VSQ4PGSrkGL3bzImkjpeDM6RsaAGF16r2WrkFta9Kimdi7WATCKSVsrcczKsJi3T60kxW4Perwq12FGAndFTtquI8OeAl5/5jAjyCHfhnqTgZapFQrtBF41pumc+HIAn/IMmKlWQvFI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640653960654.7392604429823; Fri, 8 Aug 2025 01:10:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9V-00076W-NS; Fri, 08 Aug 2025 04:08:37 -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 1ukI9S-00072b-PC for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:34 -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 1ukI9Q-0006TO-Ri for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:34 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-695-SshKzHkhOcqdug5awLg9ng-1; Fri, 08 Aug 2025 04:08:28 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 02F611800451; Fri, 8 Aug 2025 08:08:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0368B19560AD; Fri, 8 Aug 2025 08:08:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4BA1A21E6925; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1r0cQ0Q83RNcWR+DFapG2wZddI27l+q5A5mrQBO+m4A=; b=QrsEzqaPJ3mZwnGCx6JGNUtnC1d/D1OrAgdGT5XH9tuOI6sG1gu8jQiQuTPjV064YxpJXy NHaGznwlCk1cCxiH/FmD/sV6HwShFsr8uaezuDkIjnVc9NdKCsjaYvq4yq85C6Rzm6k3ZO EOdV7rkISHdFF+2zn6rwnwlnofB+M00= X-MC-Unique: SshKzHkhOcqdug5awLg9ng-1 X-Mimecast-MFC-AGG-ID: SshKzHkhOcqdug5awLg9ng_1754640507 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com, Richard Henderson Subject: [PATCH 02/12] tcg: Fix error reporting on mprotect() failure in tcg_region_init() Date: Fri, 8 Aug 2025 10:08:13 +0200 Message-ID: <20250808080823.2638861-3-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@redhat.com> MIME-Version: 1.0 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640655481116600 Content-Type: text/plain; charset="utf-8" tcg_region_init() calls one of qemu_mprotect_rwx(), qemu_mprotect_rw(), and mprotect(), then reports failure with error_setg_errno(&error_fatal, errno, ...). The use of &error_fatal is undesirable. qapi/error.h advises: * Please don't error_setg(&error_fatal, ...), use error_report() and * exit(), because that's more obvious. The use of errno is wrong. qemu_mprotect_rwx() and qemu_mprotect_rw() wrap around qemu_mprotect__osdep(). qemu_mprotect__osdep() calls mprotect() on POSIX, VirtualProtect() on Windows, and reports failure with error_report(). VirtualProtect() doesn't set errno. mprotect() does, but error_report() may clobber it. Fix tcg_region_init() to report errors only when it calls mprotect(), and rely on qemu_mprotect_rwx()'s and qemu_mprotect_rw()'s error reporting otherwise. Use error_report(), not error_setg(). Fixes: 22c6a9938f75 (tcg: Merge buffer protection and guard page protection) Fixes: 6bc144237a85 (tcg: Use Error with alloc_code_gen_buffer) Cc: Richard Henderson Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrang=C3=A9 --- tcg/region.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index 7ea0b37a84..74e3b4b774 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -832,13 +832,17 @@ void tcg_region_init(size_t tb_size, int splitwx, uns= igned max_threads) } else { #ifdef CONFIG_POSIX rc =3D mprotect(start, end - start, need_prot); + if (rc) { + error_report("mprotect of jit buffer: %s", + strerror(errno)); + } + #else g_assert_not_reached(); #endif } if (rc) { - error_setg_errno(&error_fatal, errno, - "mprotect of jit buffer"); + exit(1); } } if (have_prot !=3D 0) { --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640673; cv=none; d=zohomail.com; s=zohoarc; b=gwI0digKPYU8B4H5EN87YUjFREoKdCfOpZOw19KhUo/lO9mhMaMjILbac/jrjhsbnbXVKkdgGLiYHgl/FIA4tKvvvIQTu2oewdCPmdn/sQzUQNQL6jT10L27bB8/SMbhaD/tgNjFiXTU9/ZRZO7FPnKaDOcFBEHHFKjjGWLabCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640673; h=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=YWqpCLBK+hhQauHT2lf7oa/LCZhcGpTlEip3nitM2Wg=; b=nNGTUdZLX3Ja22fdkFcWxohw2hTDEpg1vSipYn723Iaq8/g4MumU1zs6YEt0JINNgVCjJc/fvq5rHAAOcvteuARcLZG3iHy77rsGzAJJI0AMvPMWjJDDYZ3MftLiSDo2O8x/8rdpbq0xu7CrXtKIp+kYj7gONVCuciPm9X7HNxA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640673021527.4934008113787; Fri, 8 Aug 2025 01:11:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9X-00078a-Pl; Fri, 08 Aug 2025 04:08:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukI9T-00073X-TK for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:35 -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 1ukI9P-0006TE-SG for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:35 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-689-ZUinX9_8NTSxeTIU_UDvBA-1; Fri, 08 Aug 2025 04:08:27 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AD04C1800289; Fri, 8 Aug 2025 08:08:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 151BC19560B0; Fri, 8 Aug 2025 08:08:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4F8A321E6935; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YWqpCLBK+hhQauHT2lf7oa/LCZhcGpTlEip3nitM2Wg=; b=MI9TlIAvX5oM8lWSl4R/GN4s2TXnzTRxEvOq7p+0dQ+T50bs3AgNUbvHMFJ+glBi869My3 C+GXKJQ082u0NQfavYazPewPS9vJ+HcelUBfw+cjdoOkXq573tcUnzru2UO9Xdyi0UWVJC cH1xdoT4QhhdPDWBUFAQgxr1xdx8/l8= X-MC-Unique: ZUinX9_8NTSxeTIU_UDvBA-1 X-Mimecast-MFC-AGG-ID: ZUinX9_8NTSxeTIU_UDvBA_1754640506 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com, Jonathan Cameron Subject: [PATCH 03/12] hw/cxl: Convert cxl_fmws_link() to Error Date: Fri, 8 Aug 2025 10:08:14 +0200 Message-ID: <20250808080823.2638861-4-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@redhat.com> MIME-Version: 1.0 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640674541124100 Content-Type: text/plain; charset="utf-8" Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is bogus. cxl_fmws_link_targets() violates this principle: it calls error_setg(&error_fatal, ...) via cxl_fmws_link(). Goes back to commit 584f722eb3ab (hw/cxl: Make the CXL fixed memory windows devices.) Currently harmless, because cxl_fmws_link_targets()'s callers always pass &error_fatal. Clean this up by converting cxl_fmws_link() to Error. Cc: Jonathan Cameron Signed-off-by: Markus Armbruster Reviewed-by: Jonathan Cameron Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/cxl/cxl-host.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 5c2ce25a19..0d891c651d 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -72,6 +72,7 @@ static void cxl_fixed_memory_window_config(CXLFixedMemory= WindowOptions *object, =20 static int cxl_fmws_link(Object *obj, void *opaque) { + Error **errp =3D opaque; struct CXLFixedWindow *fw; int i; =20 @@ -87,9 +88,9 @@ static int cxl_fmws_link(Object *obj, void *opaque) o =3D object_resolve_path_type(fw->targets[i], TYPE_PXB_CXL_DEV, &ambig); if (!o) { - error_setg(&error_fatal, "Could not resolve CXLFM target %s", + error_setg(errp, "Could not resolve CXLFM target %s", fw->targets[i]); - return 1; + return -1; } fw->target_hbs[i] =3D PXB_CXL_DEV(o); } @@ -99,7 +100,7 @@ static int cxl_fmws_link(Object *obj, void *opaque) void cxl_fmws_link_targets(Error **errp) { /* Order doesn't matter for this, so no need to build list */ - object_child_foreach_recursive(object_get_root(), cxl_fmws_link, NULL); + object_child_foreach_recursive(object_get_root(), cxl_fmws_link, errp); } =20 static bool cxl_hdm_find_target(uint32_t *cache_mem, hwaddr addr, --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640569; cv=none; d=zohomail.com; s=zohoarc; b=Z1P8YWPiGbKZNMTqARqdXh2cUUOcHJCgO6XIEmLrYn0kgR2tuPJvd32YoaUaaZbLexuBm6VMjmHUFGiwHq8wB0xNm7uXe0FgYQq9tIyi21kZJxzUto7Ax802XLDBVZQ69o1sN9Onz3n0A1eb5z1eeeU3lZNn2TI0/iaM7S6hTTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640569; h=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=/0BFU3f3t2hzCViZolGUTl+gEXGzgiRRyktDZUPX6Ko=; b=cOX9HZ0svUMQAnbux97uxGFL+cda62+zX6iBFplJ7nAnfbb80X3yX8wqhoMatAmoNE9hOod6MH/9o/Zqj/s3LGmEbSy7TZg+9fomak++EcFdCZMxGf1X0bvAY0WlRuZaMNCqjdc51MXZIGptipKhl97uM7WSW0ah6spBhMoA0ak= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640569888156.24150237502215; Fri, 8 Aug 2025 01:09:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9U-00073f-94; Fri, 08 Aug 2025 04:08: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 1ukI9R-00071w-F2 for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:33 -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 1ukI9P-0006TG-Se for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:33 -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-687-_36Awsz4N06cdVMUJhtifw-1; Fri, 08 Aug 2025 04:08:27 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8EA9F195608F; Fri, 8 Aug 2025 08:08:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2D7E21954185; Fri, 8 Aug 2025 08:08:26 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5370521E6768; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/0BFU3f3t2hzCViZolGUTl+gEXGzgiRRyktDZUPX6Ko=; b=UEbM5O2nrFLKiGLdRu8MFDnz2WWi/VFXL0kwAUDmRlgY52IHMo55YDZtliGuKjpXP4F8Pc 8eKax01Kp9JDETkk9ihX5/VkMIbcgGTuYbjFIiaTnRqaw1V+/OGC5+q1TMSka0CpKfcsUF VMH+OGRKKvy3Dz1L892uWeKBRiyL9xs= X-MC-Unique: _36Awsz4N06cdVMUJhtifw-1 X-Mimecast-MFC-AGG-ID: _36Awsz4N06cdVMUJhtifw_1754640507 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com, Steve Sistare Subject: [PATCH 04/12] migration/cpr: Clean up error reporting in cpr_resave_fd() Date: Fri, 8 Aug 2025 10:08:15 +0200 Message-ID: <20250808080823.2638861-5-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@redhat.com> MIME-Version: 1.0 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640570397116600 Content-Type: text/plain; charset="utf-8" qapi/error.h advises: * Please don't error_setg(&error_fatal, ...), use error_report() and * exit(), because that's more obvious. Do that. The error message starts with "internal error: ", so maybe this should assert() instead. Cc: Steve Sistare Signed-off-by: Markus Armbruster Reviewed-by: Steve Sistare --- migration/cpr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/migration/cpr.c b/migration/cpr.c index 42ad0b0d50..908bcf83b2 100644 --- a/migration/cpr.c +++ b/migration/cpr.c @@ -7,6 +7,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/error-report.h" #include "hw/vfio/vfio-device.h" #include "migration/cpr.h" #include "migration/misc.h" @@ -100,10 +101,10 @@ void cpr_resave_fd(const char *name, int id, int fd) if (old_fd < 0) { cpr_save_fd(name, id, fd); } else if (old_fd !=3D fd) { - error_setg(&error_fatal, - "internal error: cpr fd '%s' id %d value %d " - "already saved with a different value %d", - name, id, fd, old_fd); + error_report("internal error: cpr fd '%s' id %d value %d " + "already saved with a different value %d", + name, id, fd, old_fd); + exit(1); } } =20 --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640587; cv=none; d=zohomail.com; s=zohoarc; b=oEu0l8TVhNtzhQrEF2OfMsu9zKG7H8HghuwhzQyKu8NY12hNq6C886iq5IVSLagOnqZnxDVqr8uPl+jzngI8bfXSxq5C1Hz6B38v+VnlhvKdnyLqryTyYZZHWJm/KT492+mbULc/phDDHqDP5WMPd91ThIIhUJfNVln13SsRaIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640587; h=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=DQlc2J4S+Y7sWvNha6HkIII0V/76lM4iGtQgm82KWy8=; b=Dxtkr5B9sN1B8UhRN55VI55BWSs8xcACKEcKcuelKEJ/OmTUXiFK8CBbJOv8BUON3P0JkSqE3P1j2bEnkJ5ZQIh3AD9cyFeVcHAu+iQH0gGdeuUGJuDwTG1MSffZ7ug3VUSf3iepXN/t/slXBKFSZhoW5wT3CWelQbI96erGFFk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640587699605.7161599550401; Fri, 8 Aug 2025 01:09:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9c-0007Df-Cx; Fri, 08 Aug 2025 04:08:44 -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 1ukI9V-000750-CT for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:37 -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 1ukI9T-0006UN-5o for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:37 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-Oc_0CyiUMH69vDZlPe1n_A-1; Fri, 08 Aug 2025 04:08:30 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D5FF6180036F; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8D16E19560B5; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 579B821E6775; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DQlc2J4S+Y7sWvNha6HkIII0V/76lM4iGtQgm82KWy8=; b=NNNJoONZ5JajCDkBTf9yG0fJBDLj3zXd4Oo2dVCk1jh1jYLoeRQZJxxziD1fsQFQmlCNrQ dpo3m7FpRKz+iGZfUriq3zVP2psfpDdmyPGmhmAvrKnC/b1T28YQ5QVDY/Q6fKngm//vLD PjjzLFeZdpJB7umM4g0bELSQBiUOJw4= X-MC-Unique: Oc_0CyiUMH69vDZlPe1n_A-1 X-Mimecast-MFC-AGG-ID: Oc_0CyiUMH69vDZlPe1n_A_1754640509 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com, Jagannathan Raman Subject: [PATCH 05/12] hw/remote/vfio-user: Clean up error reporting Date: Fri, 8 Aug 2025 10:08:16 +0200 Message-ID: <20250808080823.2638861-6-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@redhat.com> MIME-Version: 1.0 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640588627116600 Content-Type: text/plain; charset="utf-8" VFU_OBJECT_ERROR() reports the error with error_setg(&error_abort, ...) when auto-shutdown is enabled, else with error_report(). Issues: 1. The error is serious enough to warrant aborting the process when auto-shutdown is enabled, yet harmless enough to permit carrying on when it's disabled. This makes no sense to me. 2. Like assert(), &error_abort is strictly for programming errors. Is this one? Or should we exit(1) instead? 3. qapi/error.h advises "don't error_setg(&error_abort, ...), use assert()." This patch addresses just 3. Cc: Jagannathan Raman Signed-off-by: Markus Armbruster --- hw/remote/vfio-user-obj.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index ea6165ebdc..eb96982a3a 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -75,12 +75,9 @@ OBJECT_DECLARE_TYPE(VfuObject, VfuObjectClass, VFU_OBJEC= T) */ #define VFU_OBJECT_ERROR(o, fmt, ...) \ { \ - if (vfu_object_auto_shutdown()) { \ - error_setg(&error_abort, (fmt), ## __VA_ARGS__); \ - } else { \ - error_report((fmt), ## __VA_ARGS__); \ - } \ - } \ + error_report((fmt), ## __VA_ARGS__); \ + assert(!vfu_object_auto_shutdown()); \ + } =20 struct VfuObjectClass { ObjectClass parent_class; --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640606; cv=none; d=zohomail.com; s=zohoarc; b=OiIN3Zk46zqViVyxR6Z4UVx4oWOz9QzyFEOa5pKfSMJ8aLp8D4tcZ8TwWUXrHTNZgrFxm8MRtZ+wJezw2I5ErdZ3nm06Wk3hv3Nv81D5ZV94QY0XCGfCwVd4BxmgxQNdD5jtS3ka3KYDAx/o0ef/fjsR7gb8P4lhIdUJyL1gFO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640606; 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=CKNHjrkE+SV7LG40jEVf1ht2LSznPIly+hKCp2dcHGI=; b=kUilYON2PFdelSBOe4sgEWMXBWMHQIkBzmHPFsGQS4smFtNyBFZWGgWWYBEWUWflL3oMhl7RrOOvejReqeBKM9LcydqDhuWUrlQ5NnyOYh9H5W4E0gYgtEsaFJdo3Z/6yejfq7NyAte1VAFafPTQ5TPpbtnx0OAM87caEXuXOfM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640606764373.186358241781; Fri, 8 Aug 2025 01:10:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9Z-00079v-0K; Fri, 08 Aug 2025 04:08: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 1ukI9U-000748-WA for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:37 -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 1ukI9T-0006UA-1R for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:36 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-208-PRP5d_yOMk-NkE5wPjTg8g-1; Fri, 08 Aug 2025 04:08:30 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CB4D11800359; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 82E24180028A; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5C03C21E6779; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640514; 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=CKNHjrkE+SV7LG40jEVf1ht2LSznPIly+hKCp2dcHGI=; b=V3nYX2W+rcJn1gkwP/I0ZFz358zfalYUpFd8hPTN0rC4nyTgE/8W+/KVr315yWK1R7WDOI KPoUEAiSqx6UqTaL7T2wbi3JZSRbagn37LjVwvOGeQILXlWo+J2T941os7bhpVx0rzVp9x /Kkxdk8+Ga/RKyzx86TOm9Ckx7AC5gY= X-MC-Unique: PRP5d_yOMk-NkE5wPjTg8g-1 X-Mimecast-MFC-AGG-ID: PRP5d_yOMk-NkE5wPjTg8g_1754640509 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com Subject: [PATCH 06/12] net/slirp: Clean up error reporting Date: Fri, 8 Aug 2025 10:08:17 +0200 Message-ID: <20250808080823.2638861-7-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640608755116600 net_slirp_register_poll_sock() and net_slirp_unregister_poll_sock() report WSAEventSelect() failure with error_setg(&error_warn, ...). I'm not familiar with liblirp, so I can't say whether the network backend will work after such a failure. If it doesn't, then this should be an error. If it does, then why bother the user with a warning that isn't actionable, and likely confusing? Regardless of that, error_setg_win32(&error_warn, ...) is undesirable just like error_setg(&error_fatal, ...) and error_setg(&error_abort, ...) are. Replace by warn_report(). Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- net/slirp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index 9657e86a84..d75b09f16b 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -262,7 +262,8 @@ static void net_slirp_register_poll_sock(slirp_os_socke= t fd, void *opaque) if (WSAEventSelect(fd, event_notifier_get_handle(&ctxt->notifier), FD_READ | FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_WRITE | FD_OOB) !=3D 0) { - error_setg_win32(&error_warn, WSAGetLastError(), "failed to WSAEve= ntSelect()"); + warn_report("failed to WSAEventSelect(): %s", + g_win32_error_message(WSAGetLastError())); } #endif } @@ -271,7 +272,8 @@ static void net_slirp_unregister_poll_sock(slirp_os_soc= ket fd, void *opaque) { #ifdef WIN32 if (WSAEventSelect(fd, NULL, 0) !=3D 0) { - error_setg_win32(&error_warn, WSAGetLastError(), "failed to WSAEve= ntSelect()"); + warn_report("failed to WSAEventSelect()", + g_win32_error_message(WSAGetLastError())); } #endif } --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640566; cv=none; d=zohomail.com; s=zohoarc; b=kPNWPOOH4uedjNxL10CjcX73zA/OfzWZkErJcqm1Yk5MurataHsdqdmoBP9ezoKpL5iva8r2ue59+pBSABtGByfrCgDlKPrBLSHeNDMdEtUYo3hrbNjjhZflE98ozPdNhqW9bbD05hf32Vhr8drkKGDedPelIh682kFeDOKYTYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640566; 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=lFO+wHuHsYmjvUEmMjjSVaO3ZnGXBm+IeroqybUwYqw=; b=IRq1RHOECtU0IUHNVboyjP84ccBnuyED5YoFDjfkzLUMMVcEWEMKK9m7R23LsERBYy0qlYJOeV+QToi0AWsz2/2eK77H8beviclWu4B5iIEIZWLE9+17UxeKLrQp/aQ2UmigOGa1+4/WRoZ1ReC5ETGSox5UEEAxHejfeeLS7fo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640566602510.1722633787235; Fri, 8 Aug 2025 01:09:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9c-0007EM-Oa; Fri, 08 Aug 2025 04:08:44 -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 1ukI9U-00073e-58 for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:36 -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 1ukI9S-0006TS-Dm for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:35 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-210-HZCbQwY1OGq862UStORJdQ-1; Fri, 08 Aug 2025 04:08:31 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1EFD81800371; Fri, 8 Aug 2025 08:08:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 970BE1800291; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5FC7E21E677A; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640512; 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=lFO+wHuHsYmjvUEmMjjSVaO3ZnGXBm+IeroqybUwYqw=; b=DUYOvzfhSMZm74OgMGNn+7E0gLjkqHgNgReb2tp/KUl5ceWrLKSLQ8SIzI0wpvjTxZVPwu PnbUZpdEZ5LoziH/hQz+FOUEk/SNp1qy1Tgu9h4r2Rlfhbw9NvRyt6fHOPN4dKRAU4kXHJ e+K7gBQdJ0RUxYtJT/JMd3j5u+/o+58= X-MC-Unique: HZCbQwY1OGq862UStORJdQ-1 X-Mimecast-MFC-AGG-ID: HZCbQwY1OGq862UStORJdQ_1754640510 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com Subject: [PATCH 07/12] ui/spice-core: Clean up error reporting Date: Fri, 8 Aug 2025 10:08:18 +0200 Message-ID: <20250808080823.2638861-8-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640571216124100 watch_add() reports _open_osfhandle() failure with error_setg(&error_warn, ...). I'm not familiar with Spice, so I can't say whether it will work after such a failure. If it doesn't, then this should be an error. If it does, then why bother the user with a warning that isn't actionable, and likely confusing? Regardless of that, error_setg_win32(&error_warn, ...) is undesirable just like error_setg(&error_fatal, ...) and error_setg(&error_abort, ...) are. Replace by warn_report(). Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/spice-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 5992f9daec..97bdd171cd 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -132,7 +132,8 @@ static SpiceWatch *watch_add(int fd, int event_mask, Sp= iceWatchFunc func, void * #ifdef WIN32 fd =3D _open_osfhandle(fd, _O_BINARY); if (fd < 0) { - error_setg_win32(&error_warn, WSAGetLastError(), "Couldn't associa= te a FD with the SOCKET"); + warn_report("Couldn't associate a FD with the SOCKET: %s" + g_win32_error_message(WSAGetLastError())); return NULL; } #endif --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640603; cv=none; d=zohomail.com; s=zohoarc; b=DWELjj1GZeOhtdyIiydxWevVlOSccLSzdV+cVEE8C+GAJ0hj4934zB6s7Zqe/AABOcd+AmOfHYvuH7lf1n1T/hiSQ7BXvC40DaKcrAfVvtvNEQDQzaNugnJ2Yrel44VRyCTkJ5v8R3lVuME6/b6ljLCrYSOdRkP73B4ELSshZTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640603; 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=mLTZcSj7iNq5OuEH8/JlnbJNdOKdUQD0MxDROOyY5U8=; b=E7vIVsnYSK8vT24qE/WZ5p529wTB5IzQCC0QUkNxUQOpPmvgDrfrlq1ppcJaFgDAdccsVeoC37iHdGqZRBu4ivLV+4e9qf22Uo5QzQ2uBF26dLf1Rrdrm6Jntst+zjYbtYbkKevwW6X7HCYu+D+l+1W9G/Vnr2ukLpHgd73k1Bo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640603014261.92013560131556; Fri, 8 Aug 2025 01:10:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9Y-00079c-EX; Fri, 08 Aug 2025 04:08: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 1ukI9V-00075U-IG for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:37 -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 1ukI9T-0006Um-NX for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:37 -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-473-KJDt79g7NeurZo2YeYiZsg-1; Fri, 08 Aug 2025 04:08:31 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0941B1956080; Fri, 8 Aug 2025 08:08:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 67FDD19560B0; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 63A0C21E6741; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640514; 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=mLTZcSj7iNq5OuEH8/JlnbJNdOKdUQD0MxDROOyY5U8=; b=R7AeL6L+TOVR+MdyM+VWCvti/c10sgZBIcL2qZ885aARY3YlHZEpzx9lX2nKzqYp7cPl7L hrCff3Fcg1nbP5hi3cHfwF00pVSD2F23vVDty4DX/6fug6O9l5bvGKp9tO5wXaU8OCemjx l7hlJ6H39+gfJiZa8DYtHyu/UU7dYVA= X-MC-Unique: KJDt79g7NeurZo2YeYiZsg-1 X-Mimecast-MFC-AGG-ID: KJDt79g7NeurZo2YeYiZsg_1754640510 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com Subject: [PATCH 08/12] util/oslib-win32: Revert warning on WSAEventSelect() failure Date: Fri, 8 Aug 2025 10:08:19 +0200 Message-ID: <20250808080823.2638861-9-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640604719116600 qemu_socket_select() and its wrapper qemu_socket_unselect() treat a NULL @errp as &error_warn. This is wildly inappropriate. A caller passing NULL specifies that errors are to be ignored. If warnings are wanted, the caller must pass &error_warn. I'm not familiar with the calling code, so I can't say whether it will work after WSAEventSelect() failure. If it doesn't, then this should be an error. If it does, then why bother the user with a warning that isn't actionable, and likely confusing? The warning goes back to commit f5fd677ae7cf (win32/socket: introduce qemu_socket_select() helper). Before that commit, the error was ignored, as indicated by passing a null @errp. Revert to that behavior. Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- util/oslib-win32.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/util/oslib-win32.c b/util/oslib-win32.c index b7351634ec..136a8fe118 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -296,10 +296,6 @@ bool qemu_socket_select(int sockfd, WSAEVENT hEventObj= ect, { SOCKET s =3D _get_osfhandle(sockfd); =20 - if (errp =3D=3D NULL) { - errp =3D &error_warn; - } - if (s =3D=3D INVALID_SOCKET) { error_setg(errp, "invalid socket fd=3D%d", sockfd); return false; --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640543; cv=none; d=zohomail.com; s=zohoarc; b=aCs459hU/L8vH0EqHKyVkcZDUHLhzk8rrLHjR+sc7Ik/8H6JJfJ92ju5I7iEdsyMp0hSV3uVZTbe2k6eEIq/9v64baos++h5vs9r6yV8ueMnMq2fjpV43cWR34wiBTLhBHh7ViDSyDLT5tsBVIql1AlAZiBPQfI9wo5wSBcZ7g8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640543; 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=meKENbAgBsXeChFWuBiTb2HPp95oc+Z3Oczse6BwGbU=; b=QouBVlhX8td3iOlyUSTq9xAgjNpRJ0p6tEPNrzPazbt7ii/yku1ngxvqBOvTPaBNercHk9GPm1Z6OqjJxM1uUTQ41hqnK/TR1cvwxUF0mYd1Xdt+NK/5NSdjq3B9rr5taSgQB4TaOF3rQMJCKuAmcR6eXGV6M8X84p0cvHJ0/dc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640543470810.7480787750383; Fri, 8 Aug 2025 01:09:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9U-00073u-VL; Fri, 08 Aug 2025 04:08: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 1ukI9T-00072o-26 for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:35 -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 1ukI9R-0006TV-Fx for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:34 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-37-BU5n0MM3O8O70kQiT9lGZQ-1; Fri, 08 Aug 2025 04:08:30 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D1D84180035D; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 88D5C1954185; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6792A21E66C4; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640512; 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=meKENbAgBsXeChFWuBiTb2HPp95oc+Z3Oczse6BwGbU=; b=DYIqaL50Ov1mPxf8sDnoes2RJ806ZhUeQcyOfOsyPCU6j5hOdZPOkWBphJojtqtaMq//hu A9pMokGN/RqqUcYTYywEc0+LwKhFJps2CURm0srcrFWTrhw94Cn6ezxpfj7yz52ldOTbYe Fv9IGOieG8NzsuI1w5ai8cxYO4nXhJE= X-MC-Unique: BU5n0MM3O8O70kQiT9lGZQ-1 X-Mimecast-MFC-AGG-ID: BU5n0MM3O8O70kQiT9lGZQ_1754640509 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com Subject: [PATCH 09/12] ui/pixman: Consistent error handling in qemu_pixman_shareable_free() Date: Fri, 8 Aug 2025 10:08:20 +0200 Message-ID: <20250808080823.2638861-10-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640545068124100 qemu_pixman_shareable_free() wraps around either qemu_memfd_free() or qemu_win32_map_free(). The former reports trouble as error, with error_report(), then succeeds. The latter reports it as warning (we pass it &error_warn), then succeeds. Change the latter to report as error, too. Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/qemu-pixman.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c index ef4e71da11..e46c6232cf 100644 --- a/ui/qemu-pixman.c +++ b/ui/qemu-pixman.c @@ -288,7 +288,10 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handl= e, void *ptr, size_t size) { #ifdef WIN32 - qemu_win32_map_free(ptr, handle, &error_warn); + Error *err =3D NULL; + + qemu_win32_map_free(ptr, handle, &err); + error_report_err(err); #else qemu_memfd_free(ptr, size, handle); #endif --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640596; cv=none; d=zohomail.com; s=zohoarc; b=bgGgZoWDaqkkXZ/88sPU0RMGtuo5m2UWj/k40IdGnFpAk+umscOa5jD9Y+6MqOrmlf7/KVx71i48UniAZNSpGlApDFsvBpZDTxnmxG3KTQVj+/ac0oH8xwcPPgUomYgj+WoBqzv2H8Zxf+tHmvXDNgrI2oO0mzd7Lk+fuOka4Bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640596; 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=0a8mAgbX2PYqZidFDUyDRO19lWaXvm1R8I1vvmw2cEs=; b=D0tF6XUbpETIJmaqkYdWM7/OXmB+quiC8bs5uL/qQS5Ezh1xSsD0ssVPvM3LZBLprfu4ftoSS14yVG5frySY4NO5fkN7zB0Rz17341PJFesqRb4mwe7hV0gdmaKhD2+3jwzAjhy3KS50Iv2kRk23RWl76Vcw2K+u3Fb7HGzSXX0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17546405963931003.6243909287323; Fri, 8 Aug 2025 01:09:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9Y-00079S-2u; Fri, 08 Aug 2025 04:08: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 1ukI9U-00073p-BU for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:36 -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 1ukI9S-0006U6-Lr for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:36 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-37-IXfNtXw6NtCKghThBOYIvQ-1; Fri, 08 Aug 2025 04:08:30 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C4EB4180034F; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7241719560B4; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6B35721E66D2; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640513; 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=0a8mAgbX2PYqZidFDUyDRO19lWaXvm1R8I1vvmw2cEs=; b=GSiwyBpKPD1vK/wyy4QW80MBzk/OuQdwz5m0Vaxe9SUfX8Wbp+6eyau+aNqWBeVaMtN0bB YxoFjo/c5nZZJ0L34BxEz6mqVhSCtT0PgqJ5JbxKz9SqOrTSYyX3UTTLt2rvZYbCyEDLcL wydv7JWL1KhjZfn+92Hnj62+CBEYitQ= X-MC-Unique: IXfNtXw6NtCKghThBOYIvQ-1 X-Mimecast-MFC-AGG-ID: IXfNtXw6NtCKghThBOYIvQ_1754640509 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com Subject: [PATCH 10/12] ui/dbus: Clean up dbus_update_gl_cb() error checking Date: Fri, 8 Aug 2025 10:08:21 +0200 Message-ID: <20250808080823.2638861-11-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640597618124100 From GLib "Rules for use of GError": A GError* must be initialized to NULL before passing its address to a function that can report errors. dbus_update_gl_cb() seemingly violates this rule: it passes &err to qemu_dbus_display1_listener_call_update_dmabuf_finish() and to qemu_dbus_display1_listener_win32_d3d11_call_update_texture2d_finish() without clearing it in between. Harmless, because the first call is guarded by #ifdef CONFIG_GBM, the second by #ifdef WIN32, and the two are mutually exclusive. I think. Clean this up to be obviously correct. Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/dbus-listener.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 42875b8eed..09d7a319b1 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -221,18 +221,21 @@ static void dbus_update_gl_cb(GObject *source_object, #ifdef CONFIG_GBM success =3D qemu_dbus_display1_listener_call_update_dmabuf_finish( ddl->proxy, res, &err); + if (!success) { + error_report("Failed to call update: %s", err->message); + } #endif =20 #ifdef WIN32 success =3D qemu_dbus_display1_listener_win32_d3d11_call_update_textur= e2d_finish( ddl->d3d11_proxy, res, &err); - d3d_texture2d_acquire0(ddl->d3d_texture, &error_warn); -#endif - if (!success) { error_report("Failed to call update: %s", err->message); } =20 + d3d_texture2d_acquire0(ddl->d3d_texture, &error_warn); +#endif + graphic_hw_gl_block(ddl->dcl.con, false); g_object_unref(ddl); } --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640673; cv=none; d=zohomail.com; s=zohoarc; b=NqQ7oDA+mCi27I3SaXG5E/7gtZQdE3oPiIAyiSr9/szArjKKithomlSv5s+qrdr8xETQEOQFqt6gvspe76xzYunuy6wP8MouFY9n23pM5ucVLXqoRpQQu7pN9Zn+FLlavPmXkJniCeAKpG31m41XVJKV2HWZ0+N39uMCVCiyR4s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640673; 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=V/cu/OvFWiBSGsogoGPDIWg0xj9ceLPQHP67cHpkWjo=; b=mvlYKm+3NwUAkhFdJhHSSO/dmCcxcB/JgTat8ROjgDEvCXTkAEtTo6hPg6zGDP4pI9PBGCXeqaXNPxbGkUwycamF6Yr+2A6fZBv3PZLaAk1X2OTcB4wu2E8wlJwhEWpBYIFsypk/yJmZeIwAva/erSb8tRaZmTTkB5l0NAIttLk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175464067311970.15793089240776; Fri, 8 Aug 2025 01:11:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9X-00078V-8a; Fri, 08 Aug 2025 04:08:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukI9U-00073w-F0 for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:36 -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 1ukI9S-0006UL-VI for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:36 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-210-Mw4zy1XMOVucZ_I-R5tuEw-1; Fri, 08 Aug 2025 04:08:30 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F295018003FC; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76A4C30002C0; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6F17521E66D3; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640514; 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=V/cu/OvFWiBSGsogoGPDIWg0xj9ceLPQHP67cHpkWjo=; b=iPuBD7/AAsiuqXdzm8ejRD9ucTqlvn2osR52NdpjCiOYEnk/sfu6/2jxdsYhUJA32aMnVS eCrDMM//RmdpjEL3o3zK9PB9l0Fj7ZVs7j4zCzcTTpeEcwWGybIQzeLh1QGRdha60QhITn qYMsvSho4//kguHdMz0QgpdmmXZBTwg= X-MC-Unique: Mw4zy1XMOVucZ_I-R5tuEw-1 X-Mimecast-MFC-AGG-ID: Mw4zy1XMOVucZ_I-R5tuEw_1754640510 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com Subject: [PATCH 11/12] ui/dbus: Consistent handling of texture mutex failure Date: Fri, 8 Aug 2025 10:08:22 +0200 Message-ID: <20250808080823.2638861-12-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640674552124100 We report d3d_texture2d_acquire0() and d3d_texture2d_release0() failure as error, except in dbus_update_gl_cb(), where we report it as warning. Report it as error there as well. Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/dbus-listener.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 09d7a319b1..b82e7c7115 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -214,26 +214,31 @@ static void dbus_update_gl_cb(GObject *source_object, GAsyncResult *res, gpointer user_data) { - g_autoptr(GError) err =3D NULL; + g_autoptr(GError) gerr =3D NULL; +#ifdef WIN32 + Error **err =3D NULL; +#endif DBusDisplayListener *ddl =3D user_data; bool success; =20 #ifdef CONFIG_GBM success =3D qemu_dbus_display1_listener_call_update_dmabuf_finish( - ddl->proxy, res, &err); + ddl->proxy, res, &gerr); if (!success) { - error_report("Failed to call update: %s", err->message); + error_report("Failed to call update: %s", gerr->message); } #endif =20 #ifdef WIN32 success =3D qemu_dbus_display1_listener_win32_d3d11_call_update_textur= e2d_finish( - ddl->d3d11_proxy, res, &err); + ddl->d3d11_proxy, res, &gerr); if (!success) { - error_report("Failed to call update: %s", err->message); + error_report("Failed to call update: %s", gerr->message); } =20 - d3d_texture2d_acquire0(ddl->d3d_texture, &error_warn); + if (!d3d_texture2d_acquire0(ddl->d3d_texture, &err)) { + error_report_err(err); + } #endif =20 graphic_hw_gl_block(ddl->dcl.con, false); --=20 2.49.0 From nobody Sun Dec 14 02:02:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1754640636; cv=none; d=zohomail.com; s=zohoarc; b=BzV25C35JW21rtBdSIU5n73zXhgUpvhou1GFXk7YmQOH6lRporQoBh8ciBAgFKQISgVEiEXMB2zBl4ow6Nj6EuK0lHdLISAYRqZkrXFcwZP1srCQKWyZpF5Lopj37eA4A3PNGCjlJmTFA9co4+v9sTfj1qjkK0TsSH4G+3VXQUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754640636; h=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=pgEpW0y9TI+gD23yhFgp5yoS/SwDLMATrdE13Y4CIb0=; b=K2W7dFZFXiImITOUILQ7bfM9aNzeFMORNUarXOnQSh1Ve3BL/qqGhjnBrfhpAsoefXt7SuDoOdvlm9PEfMx6qCvHy0xL3X62oMFF/1zMfCANhtBbTSKsHLhT8AHfNeQPRp23puEnB8fBe0zSZteGKJJ6TJlzvrT59MRK+8rIgrw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754640636001536.9592077556338; Fri, 8 Aug 2025 01:10:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukI9W-00078D-AE; Fri, 08 Aug 2025 04:08: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 1ukI9U-00073n-AN for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:36 -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 1ukI9R-0006Ta-Gr for qemu-devel@nongnu.org; Fri, 08 Aug 2025 04:08:36 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-39-bOGkBJr-MqKtl8eCtM9gEg-1; Fri, 08 Aug 2025 04:08:31 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 495A91800289; Fri, 8 Aug 2025 08:08:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8D19019560B6; Fri, 8 Aug 2025 08:08:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 72EEF21E66E0; Fri, 08 Aug 2025 10:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754640512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pgEpW0y9TI+gD23yhFgp5yoS/SwDLMATrdE13Y4CIb0=; b=LNjv31pF4zdcFkWFon0wz9Y+KZsW6yz8knVcmxhjNgJMSdA5SiUj1op5Ua9ipm0wteB4+l BElf0FXMygnqOTAwC2QUih41h3+t7FGFe5IXFTeY/1xq7X+KlhnB2daQ1cbM+W/mY/OT6a TigBC58zHwceA3xKaKxl4G5Fj+fesJ4= X-MC-Unique: bOGkBJr-MqKtl8eCtM9gEg-1 X-Mimecast-MFC-AGG-ID: bOGkBJr-MqKtl8eCtM9gEg_1754640510 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, marcandre.lureau@redhat.com Subject: [PATCH 12/12] error: Kill @error_warn Date: Fri, 8 Aug 2025 10:08:23 +0200 Message-ID: <20250808080823.2638861-13-armbru@redhat.com> In-Reply-To: <20250808080823.2638861-1-armbru@redhat.com> References: <20250808080823.2638861-1-armbru@redhat.com> MIME-Version: 1.0 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1754640638140124100 Content-Type: text/plain; charset="utf-8" We added @error_warn some two years ago in commit 3ffef1a55ca (error: add global &error_warn destination). It has multiple issues: * error.h's big comment was not updated for it. * Function contracts were not updated for it. * ERRP_GUARD() is unaware of @error_warn, and fails to mask it from error_prepend() and such. These crash on @error_warn, as pointed out by Akihiko Odaki. All fixable. However, after more than two years, we had just of 15 uses, of which the last few patches removed eight as unclean or otherwise undesirable. I didn't look closely enough at the remaining seven to decide whether they are desirable or not. I don't think this feature earns its keep. Drop it. Thanks-to: Akihiko Odaki Signed-off-by: Markus Armbruster --- include/qapi/error.h | 6 ------ hw/display/virtio-gpu.c | 8 ++++++-- hw/net/virtio-net.c | 8 +++++++- tests/unit/test-error-report.c | 17 ----------------- ui/gtk.c | 6 +++++- util/error.c | 5 +---- 6 files changed, 19 insertions(+), 31 deletions(-) diff --git a/include/qapi/error.h b/include/qapi/error.h index 41e3816380..b16c6303f8 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -533,12 +533,6 @@ static inline void error_propagator_cleanup(ErrorPropa= gator *prop) =20 G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(ErrorPropagator, error_propagator_cleanup= ); =20 -/* - * Special error destination to warn on error. - * See error_setg() and error_propagate() for details. - */ -extern Error *error_warn; - /* * Special error destination to abort on error. * See error_setg() and error_propagate() for details. diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 0a1a625b0e..de35902213 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -242,6 +242,7 @@ static uint32_t calc_image_hostmem(pixman_format_code_t= pformat, static void virtio_gpu_resource_create_2d(VirtIOGPU *g, struct virtio_gpu_ctrl_command *= cmd) { + Error *err =3D NULL; pixman_format_code_t pformat; struct virtio_gpu_simple_resource *res; struct virtio_gpu_resource_create_2d c2d; @@ -293,7 +294,8 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *g, c2d.width, c2d.height, c2d.height ? res->hostmem / c2d.height : 0, - &error_warn)) { + &err)) { + warn_report_err(err); goto end; } } @@ -1282,6 +1284,7 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque,= size_t size, const VMStateField *field) { VirtIOGPU *g =3D opaque; + Error *err =3D NULL; struct virtio_gpu_simple_resource *res; uint32_t resource_id, pformat; int i; @@ -1317,7 +1320,8 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque,= size_t size, res->width, res->height, res->height ? res->hostmem / = res->height : 0, - &error_warn)) { + &err)) { + warn_report_err(err); g_free(res); return -EINVAL; } diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 6b5b5dace3..7848e26278 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1289,6 +1289,8 @@ exit: =20 static bool virtio_net_load_ebpf(VirtIONet *n, Error **errp) { + Error *err =3D NULL; + if (!virtio_net_attach_ebpf_to_backend(n->nic, -1)) { return true; } @@ -1306,7 +1308,11 @@ static bool virtio_net_load_ebpf(VirtIONet *n, Error= **errp) return virtio_net_load_ebpf_fds(n, errp); } =20 - ebpf_rss_load(&n->ebpf_rss, &error_warn); + ebpf_rss_load(&n->ebpf_rss, &err); + /* Beware, ebpf_rss_load() can return false with @err unset */ + if (err) { + warn_report_err(err); + } return true; } =20 diff --git a/tests/unit/test-error-report.c b/tests/unit/test-error-report.c index 54319c86c9..0cbde3c4cf 100644 --- a/tests/unit/test-error-report.c +++ b/tests/unit/test-error-report.c @@ -104,22 +104,6 @@ test_error_report_timestamp(void) "); } =20 -static void -test_error_warn(void) -{ - if (g_test_subprocess()) { - error_setg(&error_warn, "Testing &error_warn"); - return; - } - - g_test_trap_subprocess(NULL, 0, 0); - g_test_trap_assert_passed(); - g_test_trap_assert_stderr("\ -test-error-report: warning: Testing &error_warn*\ -"); -} - - int main(int argc, char *argv[]) { @@ -133,7 +117,6 @@ main(int argc, char *argv[]) g_test_add_func("/error-report/glog", test_error_report_glog); g_test_add_func("/error-report/once", test_error_report_once); g_test_add_func("/error-report/timestamp", test_error_report_timestamp= ); - g_test_add_func("/error-report/warn", test_error_warn); =20 return g_test_run(); } diff --git a/ui/gtk.c b/ui/gtk.c index e91d093a49..9a08cadc88 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1181,6 +1181,7 @@ static gboolean gd_touch_event(GtkWidget *widget, Gdk= EventTouch *touch, void *opaque) { VirtualConsole *vc =3D opaque; + Error *err =3D NULL; uint64_t num_slot =3D GPOINTER_TO_UINT(touch->sequence); int type =3D -1; =20 @@ -1203,7 +1204,10 @@ static gboolean gd_touch_event(GtkWidget *widget, Gd= kEventTouch *touch, console_handle_touch_event(vc->gfx.dcl.con, touch_slots, num_slot, surface_width(vc->gfx.ds), surface_height(vc->gfx.ds), touch->x, - touch->y, type, &error_warn); + touch->y, type, &err); + if (err) { + warn_report_err(err); + } return TRUE; } =20 diff --git a/util/error.c b/util/error.c index daea2142f3..0ae08225c0 100644 --- a/util/error.c +++ b/util/error.c @@ -19,7 +19,6 @@ =20 Error *error_abort; Error *error_fatal; -Error *error_warn; =20 static void error_handle(Error **errp, Error *err) { @@ -41,9 +40,7 @@ static void error_handle(Error **errp, Error *err) error_report_err(err); exit(1); } - if (errp =3D=3D &error_warn) { - warn_report_err(err); - } else if (errp && !*errp) { + if (errp && !*errp) { *errp =3D err; } else { error_free(err); --=20 2.49.0