From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792144; cv=none; d=zohomail.com; s=zohoarc; b=LvGGnrwoDKAU0c011BAw4eH1QjqOoXUnOATqO9UJtYMFoZS0jj91SPzylnNTPSVU7M1EAHDMlEJT+ORRgfoNOkXCS+LQhyOwyJWJMUD6p8gEDNT2GNlfjUbJb/C2KT9fJ3NUyH080Bfr07qxkldN0xD7P5kF0E+S/GPc3FaD7QE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792144; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Bcl23ps/bK4EauZ2W48nVvpVqg5Y5Ps47IeSDNjIedc=; b=VF3++mo/C5dPtFvC22mY80zcgfDh/TxmpE9X/p5r2ppCzynuIR1+bJOFCCu2vPCm3IV/lc7Weu01N0kbgv2dDdxutgQpJqKansjl3ammKONqj2mNwarHeuKdVBxN+OmT49XKh3emNJ0OCDpwxYQKZDsg3bPKLWb05kCuFOIFfwQ= 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 1767792144804202.61433833635056; Wed, 7 Jan 2026 05:22:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTTy-0003MO-Ot; Wed, 07 Jan 2026 08:21:50 -0500 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 1vdTTx-0003MB-EQ for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:21:49 -0500 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 1vdTTv-0004nc-Vi for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:21:49 -0500 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-623-2DOyQakjMDyDaEQVm5R41g-1; Wed, 07 Jan 2026 08:21:43 -0500 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 4E2B61954B14; Wed, 7 Jan 2026 13:21:42 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9C52E19560A2; Wed, 7 Jan 2026 13:21:41 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 41C7F21E6934; Wed, 07 Jan 2026 14:21:39 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3268121E61A5; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792107; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=Bcl23ps/bK4EauZ2W48nVvpVqg5Y5Ps47IeSDNjIedc=; b=gJaSD5IA7HfarGm5qb+EEBPxtjPPlZw/phSXLsAF6EgodiWeS1dyOKDKlAS3M1lCpwn+Aa B3OrPVGyILxBaDHx68aP9WhvhOFuuCxqMPRuKvPig4/nzvlnrjrlegsQKIJH8dajeaEvbb nkn2AgTI9TguhPvBX4okkadep1n2/+Q= X-MC-Unique: 2DOyQakjMDyDaEQVm5R41g-1 X-Mimecast-MFC-AGG-ID: 2DOyQakjMDyDaEQVm5R41g_1767792102 Resent-To: zhao1.liu@intel.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, dbarboza@ventanamicro.com, vsementsov@yandex-team.ru Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:21:39 +0100 Resent-Message-ID: <87eco1k17g.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Vladimir Sementsov-Ogievskiy , Peter Xu , Daniel Henrique Barboza , Zhao Liu Subject: [PULL 01/17] hw/core/loader: Make load_elf_hdr() return bool, simplify caller Date: Wed, 7 Jan 2026 13:43:25 +0100 Message-ID: <20260107124341.1093312-2-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 113 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 (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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792146474158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Message-ID: <20251119130855.105479-2-armbru@redhat.com> Reviewed-by: Richard Henderson Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Peter Xu Reviewed-by: Daniel Henrique Barboza Reviewed-by: Zhao Liu --- include/hw/core/loader.h | 4 +++- hw/arm/boot.c | 6 +----- hw/core/loader.c | 8 ++++++-- hw/riscv/spike.c | 10 +--------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/include/hw/core/loader.h b/include/hw/core/loader.h index d035e72748..6f91703503 100644 --- a/include/hw/core/loader.h +++ b/include/hw/core/loader.h @@ -188,8 +188,10 @@ ssize_t load_elf(const char *filename, * * Inspect an ELF file's header. Read its full header contents into a * buffer and/or determine if the ELF is 64bit. + * + * Returns true on success, false on failure. */ -void load_elf_hdr(const char *filename, void *hdr, bool *is64, Error **err= p); +bool load_elf_hdr(const char *filename, void *hdr, bool *is64, Error **err= p); =20 ssize_t load_aout(const char *filename, hwaddr addr, int max_sz, bool big_endian, hwaddr target_page_size); diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 0ba3adaf81..e22609de93 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -766,16 +766,12 @@ static ssize_t arm_load_elf(struct arm_boot_info *inf= o, uint64_t *pentry, int data_swab =3D 0; int elf_data_order; ssize_t ret; - Error *err =3D NULL; =20 - - load_elf_hdr(info->kernel_filename, &elf_header, &elf_is64, &err); - if (err) { + if (!load_elf_hdr(info->kernel_filename, &elf_header, &elf_is64, NULL)= ) { /* * If the file is not an ELF file we silently return. * The caller will fall back to try other formats. */ - error_free(err); return -1; } =20 diff --git a/hw/core/loader.c b/hw/core/loader.c index 8252616fdd..89d67d2760 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -364,8 +364,9 @@ const char *load_elf_strerror(ssize_t error) } } =20 -void load_elf_hdr(const char *filename, void *hdr, bool *is64, Error **err= p) +bool load_elf_hdr(const char *filename, void *hdr, bool *is64, Error **err= p) { + bool ok =3D false; int fd; uint8_t e_ident_local[EI_NIDENT]; uint8_t *e_ident; @@ -380,7 +381,7 @@ void load_elf_hdr(const char *filename, void *hdr, bool= *is64, Error **errp) fd =3D open(filename, O_RDONLY | O_BINARY); if (fd < 0) { error_setg_errno(errp, errno, "Failed to open file: %s", filename); - return; + return false; } if (read(fd, hdr, EI_NIDENT) !=3D EI_NIDENT) { error_setg_errno(errp, errno, "Failed to read file: %s", filename); @@ -415,8 +416,11 @@ void load_elf_hdr(const char *filename, void *hdr, boo= l *is64, Error **errp) off +=3D br; } =20 + ok =3D true; + fail: close(fd); + return ok; } =20 /* return < 0 if error, otherwise the number of bytes loaded in memory */ diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index 1493b928da..35c696f891 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -180,15 +180,7 @@ static void create_fdt(SpikeState *s, const MemMapEntr= y *memmap, =20 static bool spike_test_elf_image(char *filename) { - Error *err =3D NULL; - - load_elf_hdr(filename, NULL, NULL, &err); - if (err) { - error_free(err); - return false; - } else { - return true; - } + return load_elf_hdr(filename, NULL, NULL, NULL); } =20 static void spike_board_init(MachineState *machine) --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792131; cv=none; d=zohomail.com; s=zohoarc; b=R0XdfdnCMeq5uWfmtzCUHz0Z0hdRClWYylpnjb4GgTDlqE+LbS4lugK9RC2FoVEopsfKNscBaPyu+k1igWsl12Z/XccrGAFj8B+YqkSWpgYymr5ftUMfaHMBcVttgG+4pA5OIyTIQf3A4oCGs//wt0iC1qw6UsNdRSYhKBJ/dWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792131; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Y4a0cYuav1Vio+9dWkD0CtDvJQ580nj+0sRoB4k30nI=; b=mysMHNJq1IOGM7iKJ8M4CIN2WTNwKykUzKq1edFKlGscK7MpQy4rTuCRwNCGUpU3p0OgFYSrfKGW9jeTN6xyx0ZIcDLroGnOy3Rfg0omHYGNakmS9/FFXnSqKUXxtsGPzX6cPjOZWvusnloz+ktqEARyXZ1LzfZVuJo78p9Vqg8= 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 1767792131086299.63396216667934; Wed, 7 Jan 2026 05:22:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTUC-0003mc-F6; Wed, 07 Jan 2026 08:22:04 -0500 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 1vdTUA-0003bp-CZ for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:22:02 -0500 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 1vdTU8-0004xm-Ql for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:22:02 -0500 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-449-NeI4mHd3OHy7nJ7_IUfzWQ-1; Wed, 07 Jan 2026 08:21:56 -0500 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 5FA961956094; Wed, 7 Jan 2026 13:21:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 060A91956048; Wed, 7 Jan 2026 13:21:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DA14121E6937; Wed, 07 Jan 2026 14:21:52 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 36F3F21E61A8; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792120; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=Y4a0cYuav1Vio+9dWkD0CtDvJQ580nj+0sRoB4k30nI=; b=gENmgjCoJxInq+o2HkltS6p3oqP7zQDCREsuti6Q0PPHk9flLE2Qeu+N6fiqzT4pVfdTZr nVR5P7rZp+g9HBadU/5uCDEwKjQccmk7LULBTznDo5i69axisMYsMzDcR70fJ2l55zPdFl ZLsnQ1IJWl/i+zFLk0WUHL1KjoPhXGo= X-MC-Unique: NeI4mHd3OHy7nJ7_IUfzWQ-1 X-Mimecast-MFC-AGG-ID: NeI4mHd3OHy7nJ7_IUfzWQ_1767792115 Resent-To: luc.michel@amd.com, zhao1.liu@intel.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, vsementsov@yandex-team.ru Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:21:52 +0100 Resent-Message-ID: <87a4ypk173.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Vladimir Sementsov-Ogievskiy , Peter Xu , Luc Michel , Zhao Liu Subject: [PULL 02/17] hw/nvram/xlnx-bbram: More idiomatic and simpler error reporting Date: Wed, 7 Jan 2026 13:43:26 +0100 Message-ID: <20260107124341.1093312-3-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 69 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 (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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792132515158500 Content-Type: text/plain; charset="utf-8" bbram_bdrv_error() interpolates a "detail" string into a template with error_setg_errno(), then reports the result with error_report(). Produces error messages with an unwanted '.': BLK-NAME: BBRAM backstore DETAIL failed.: STERROR Replace both calls of bbram_bdrv_error() by straightforward error_report(), and drop the function. This is less code, easier to read, and the error message is more greppable. Also delete the unwanted '.'. Signed-off-by: Markus Armbruster Message-ID: <20251119130855.105479-3-armbru@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Peter Xu Reviewed-by: Luc Michel Reviewed-by: Zhao Liu --- hw/nvram/xlnx-bbram.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/hw/nvram/xlnx-bbram.c b/hw/nvram/xlnx-bbram.c index 60ede7e40f..edfb592a5e 100644 --- a/hw/nvram/xlnx-bbram.c +++ b/hw/nvram/xlnx-bbram.c @@ -88,18 +88,6 @@ static bool bbram_pgm_enabled(XlnxBBRam *s) return ARRAY_FIELD_EX32(s->regs, BBRAM_STATUS, PGM_MODE) !=3D 0; } =20 -static void bbram_bdrv_error(XlnxBBRam *s, int rc, gchar *detail) -{ - Error *errp =3D NULL; - - error_setg_errno(&errp, -rc, "%s: BBRAM backstore %s failed.", - blk_name(s->blk), detail); - error_report("%s", error_get_pretty(errp)); - error_free(errp); - - g_free(detail); -} - static void bbram_bdrv_read(XlnxBBRam *s, Error **errp) { uint32_t *ram =3D &s->regs[R_BBRAM_0]; @@ -162,7 +150,8 @@ static void bbram_bdrv_sync(XlnxBBRam *s, uint64_t hwad= dr) offset =3D hwaddr - A_BBRAM_0; rc =3D blk_pwrite(s->blk, offset, 4, &le32, 0); if (rc < 0) { - bbram_bdrv_error(s, rc, g_strdup_printf("write to offset %u", offs= et)); + error_report("%s: BBRAM backstore write to offset %u failed: %s", + blk_name(s->blk), offset, strerror(-rc)); } } =20 @@ -178,7 +167,8 @@ static void bbram_bdrv_zero(XlnxBBRam *s) =20 rc =3D blk_make_zero(s->blk, 0); if (rc < 0) { - bbram_bdrv_error(s, rc, g_strdup("zeroizing")); + error_report("%s: BBRAM backstore zeroizing failed: %s", + blk_name(s->blk), strerror(-rc)); } =20 /* Restore bbram8 if it is non-zero */ --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792193; cv=none; d=zohomail.com; s=zohoarc; b=gYgYAJCvhZAhGma/xc/V+6Zim9RlvyUbfsTkur6ceC9keCDokYxB5Uw4ubU8k2YIpjWD2jjYk9QwJCiEVwGNwDs/6pfguqCeg9cESCqmurerIir7PvCtAhhif9EgEPdqCsCI7oUQkhSoy2SYpLGYAYNpJJgf1AORHmBxQFWWQMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792193; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2eQIJicwswPhegRn6v45nU97TjUCKBDRACnnAImYw58=; b=EUMxcAGSGIVr6q8vtDCJexZZMH/aW4aPjdhP1tfH0mvIR8cJPuHG/lpLSO3+pxd1eMXwMgk+WeAV4aRxo/OBg3dftkWafrUOC+CNKcSd7OzSHahTrOSZsUwBzCfWuDLcB3kT4WHc2GAeRwghgD1hhc7ua34x07Kl6dPAnYuHmEY= 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 1767792193795648.5368922647745; Wed, 7 Jan 2026 05:23:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTUu-0004Qn-Fj; Wed, 07 Jan 2026 08:22:49 -0500 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 1vdTUV-0004OA-VN for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:22:24 -0500 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 1vdTUU-000521-BY for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:22:23 -0500 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-662-9muwXhahPl6V8QVpuTsGgA-1; Wed, 07 Jan 2026 08:22:15 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 00C06195608D; Wed, 7 Jan 2026 13:22:14 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B25791800B7F; Wed, 7 Jan 2026 13:22:13 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5733121E6934; Wed, 07 Jan 2026 14:22:11 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3B19421E61A9; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792140; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=2eQIJicwswPhegRn6v45nU97TjUCKBDRACnnAImYw58=; b=K6lu57BJaCX7kWWtBwLfnHBU3BPYM4hZWMzMCy6Kd+v09Gd7JRxvWqAXClY8M4b00liGVE ThG8EynnLWyvh9ONaIlJuw3ODZiHCbCz1Qo3CJQublvrBibaymTyA4qnA1oudPO4B7MXNQ ZgH9COCCXFIgIb+lJ1H9Bh3Jw3SQ//c= X-MC-Unique: 9muwXhahPl6V8QVpuTsGgA-1 X-Mimecast-MFC-AGG-ID: 9muwXhahPl6V8QVpuTsGgA_1767792134 Resent-To: zhao1.liu@intel.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, vsementsov@yandex-team.ru Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:22:11 +0100 Resent-Message-ID: <875x9dk16k.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Vladimir Sementsov-Ogievskiy , Peter Xu , Zhao Liu Subject: [PULL 03/17] nbd/client-connection: Replace error_propagate() by assignment Date: Wed, 7 Jan 2026 13:43:27 +0100 Message-ID: <20260107124341.1093312-4-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 31 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 (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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792194824158500 Content-Type: text/plain; charset="utf-8" connect_thread_func() sets a variable to null, then error_propagate()s an Error * to it. This is a roundabout way to assign the Error * to it, so replace it by just that. Signed-off-by: Markus Armbruster Message-ID: <20251119130855.105479-4-armbru@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Peter Xu Reviewed-by: Zhao Liu --- nbd/client-connection.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nbd/client-connection.c b/nbd/client-connection.c index 79ea97e4cc..6a4f080717 100644 --- a/nbd/client-connection.c +++ b/nbd/client-connection.c @@ -207,8 +207,7 @@ static void *connect_thread_func(void *opaque) qemu_mutex_lock(&conn->mutex); =20 error_free(conn->err); - conn->err =3D NULL; - error_propagate(&conn->err, local_err); + conn->err =3D local_err; =20 if (ret < 0) { object_unref(OBJECT(conn->sioc)); --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792197; cv=none; d=zohomail.com; s=zohoarc; b=bhEMobb3m7TvzMXxj1NZ6YOOjiyPStFmH/kwViQCqZ4FlzdO8/nmyVSTZTvsIUimxasuqdFA9RW/uiDKR5HHxWI3+lHFRgw9XUWPJMgOdDzRGfCkNUhlmJR2lrejDaBXnGP07daJnXZ2vHFWYktLLimIvfFI1rDQs0ccQ7dR2js= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792197; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oQeg/ax1yqZCNF/kck2njGvRd7LL1zM9VleD8rDKBvQ=; b=nbuhhAVwma4QyHjiNuUZEJE1wVQYFgaHwY1EUs+eEmp4JeUUkSVV3xqc/UBTxkAwvvVmSAtoga0BohwZWF4QsDSZesJNhXIbbhPyWFx648bg8o8q1Napzu9jQm9vcmgBDgFQAEAWuL33uXTqID/naTgubeojFaca3aALkcFh1No= 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 1767792197925495.6888379853499; Wed, 7 Jan 2026 05:23:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTV8-0004Yi-NZ; Wed, 07 Jan 2026 08:23:04 -0500 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 1vdTUk-0004Rh-7Z for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:22:41 -0500 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 1vdTUg-00053E-Dv for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:22:37 -0500 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-361-ZYLnzWUfPTiiytBiLyOFEA-1; Wed, 07 Jan 2026 08:22:31 -0500 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 34CC11800447; Wed, 7 Jan 2026 13:22:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BB123180066A; Wed, 7 Jan 2026 13:22:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9F90A21E6937; Wed, 07 Jan 2026 14:22:26 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3F2C621E61AA; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792152; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=oQeg/ax1yqZCNF/kck2njGvRd7LL1zM9VleD8rDKBvQ=; b=Ah7MScwx1A6WS1dAOlL0reHqeELavp6xK8xwAG9Gv5ibLUIQM6/+w9toIdAr5xevdkIfKB iD09hA3BQcL4qQzy/Nu6euwk+gqZtz/QhSmfZ0Ze7UbBCMOF7UnnNwkR4z0P58GwdnY6ef C0XCG7C1WtDX9EyA2+psCJNmcLFlE0g= X-MC-Unique: ZYLnzWUfPTiiytBiLyOFEA-1 X-Mimecast-MFC-AGG-ID: ZYLnzWUfPTiiytBiLyOFEA_1767792149 Resent-To: zhao1.liu@intel.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, vsementsov@yandex-team.ru Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:22:26 +0100 Resent-Message-ID: <871pk1k165.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Vladimir Sementsov-Ogievskiy , Peter Xu , Zhao Liu Subject: [PULL 04/17] error: error_free(NULL) is safe, drop unnecessary conditionals Date: Wed, 7 Jan 2026 13:43:28 +0100 Message-ID: <20260107124341.1093312-5-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 96 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 (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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792198723158501 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Message-ID: <20251119130855.105479-5-armbru@redhat.com> Reviewed-by: Richard Henderson Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Peter Xu Reviewed-by: Zhao Liu --- hw/acpi/pcihp.c | 4 +--- io/channel-websock.c | 4 +--- io/task.c | 4 +--- migration/migration.c | 6 ++---- tests/unit/test-smp-parse.c | 5 +---- 5 files changed, 6 insertions(+), 17 deletions(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 4922bbc778..87162ff2c0 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -62,9 +62,7 @@ static int acpi_pcihp_get_bsel(PCIBus *bus) &local_err); =20 if (local_err || bsel >=3D ACPI_PCIHP_MAX_HOTPLUG_BUS) { - if (local_err) { - error_free(local_err); - } + error_free(local_err); return -1; } else { return bsel; diff --git a/io/channel-websock.c b/io/channel-websock.c index cb4dafdebb..d0929ba232 100644 --- a/io/channel-websock.c +++ b/io/channel-websock.c @@ -932,9 +932,7 @@ static void qio_channel_websock_finalize(Object *obj) if (ioc->io_tag) { g_source_remove(ioc->io_tag); } - if (ioc->io_err) { - error_free(ioc->io_err); - } + error_free(ioc->io_err); object_unref(OBJECT(ioc->master)); } =20 diff --git a/io/task.c b/io/task.c index 451f26f8b4..da79d31782 100644 --- a/io/task.c +++ b/io/task.c @@ -91,9 +91,7 @@ static void qio_task_free(QIOTask *task) if (task->destroyResult) { task->destroyResult(task->result); } - if (task->err) { - error_free(task->err); - } + error_free(task->err); object_unref(task->source); =20 qemu_mutex_unlock(&task->thread_lock); diff --git a/migration/migration.c b/migration/migration.c index 9d1bf5d276..1c34d8d432 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1568,10 +1568,8 @@ bool migrate_has_error(MigrationState *s) static void migrate_error_free(MigrationState *s) { QEMU_LOCK_GUARD(&s->error_mutex); - if (s->error) { - error_free(s->error); - s->error =3D NULL; - } + error_free(s->error); + s->error =3D NULL; } =20 static void migration_connect_error_propagate(MigrationState *s, Error *er= ror) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 28ea9158e7..1b6450e7d8 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -875,10 +875,7 @@ static void check_parse(MachineState *ms, const SMPCon= figuration *config, config_str, expect_err, output_topo_str); =20 end: - if (err !=3D NULL) { - error_free(err); - } - + error_free(err); abort(); } =20 --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792194; cv=none; d=zohomail.com; s=zohoarc; b=TbE9odJFMsDM5oYP/yPuBs0NGKMJUgiI+ODAj5cH4DPrwtkpBBImmN/JSTbec4ZoJ9R06wQikyVtVwNRUDWBQnKUKaP8IBPbEuDcB6wPWx9XAJgl38gE7tnfIcIW80ApMNHTCc2sTJKCKvkGRU4S/gM0c9gyvYF7zRnEOg1dBD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792194; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qkfNWyL3vVuiztaDBd6iakYD+1JHNCPUXMngEiTpW8k=; b=W9CeKovj+YyzGUekPPCtvjVRUT+KDFKQvZKtnLnZIOcJlS6T6XqY35hmTpY+BdbIKIpvQ2Pr8ka7xho/tyuJaYuJseOb9mlRja4wtB2z5XCEJoLctOD8LmndzAgaccji8elfQK/yHNIZecoNapbK579RMkpe6bIOS6j7UX4pvE0= 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 1767792194131966.6511869923314; Wed, 7 Jan 2026 05:23:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTVG-0004gT-GN; Wed, 07 Jan 2026 08:23:10 -0500 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 1vdTUw-0004Td-1B for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:22:52 -0500 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 1vdTUu-00055W-DG for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:22:49 -0500 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-685-HjIBPxnbMH2r1PnEecifkA-1; Wed, 07 Jan 2026 08:22:44 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B3776195609E; Wed, 7 Jan 2026 13:22:43 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3102530002D1; Wed, 7 Jan 2026 13:22:43 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E7B0121E6937; Wed, 07 Jan 2026 14:22:40 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4316F21E61AD; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792167; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=qkfNWyL3vVuiztaDBd6iakYD+1JHNCPUXMngEiTpW8k=; b=BZ1hihbXLD0VPag6GJgyiB5IsPk97UF6TOmaGYlYlCWBDuVuLfzFFwhdZlrUQ90VOPnD9i n+siTB5GHpDV3aLtQMaoS+SwCKcAUpmwuIiXjCKh+Xe6xKCJzy8US+8uxH7CRorgmV4WCx qLLkXSpfs37djhiSDex2gOhirH6o9i4= X-MC-Unique: HjIBPxnbMH2r1PnEecifkA-1 X-Mimecast-MFC-AGG-ID: HjIBPxnbMH2r1PnEecifkA_1767792163 Resent-To: zhao1.liu@intel.com, richard.henderson@linaro.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:22:40 +0100 Resent-Message-ID: <87wm1timlb.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Zhao Liu Subject: [PULL 05/17] error: Consistently name Error * objects err, and not errp Date: Wed, 7 Jan 2026 13:43:29 +0100 Message-ID: <20260107124341.1093312-6-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 173 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 (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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792194872158500 Content-Type: text/plain; charset="utf-8" This touches code in xen_enable_tpm() that is obviously wrong. Since I don't know how to fix it properly, I'm adding a FIXME there. Signed-off-by: Markus Armbruster Message-ID: <20251119130855.105479-6-armbru@redhat.com> Reviewed-by: Zhao Liu --- block/crypto.c | 8 ++++---- hw/acpi/ghes.c | 8 ++++---- hw/ppc/spapr.c | 16 ++++++++-------- hw/xen/xen-pvh-common.c | 13 ++++++++++--- nbd/common.c | 6 +++--- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/block/crypto.c b/block/crypto.c index b97d027444..36abb7af46 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -938,14 +938,14 @@ static void GRAPH_RDLOCK block_crypto_amend_cleanup(BlockDriverState *bs) { BlockCrypto *crypto =3D bs->opaque; - Error *errp =3D NULL; + Error *err =3D NULL; =20 /* release exclusive read/write permissions to the underlying file */ crypto->updating_keys =3D false; - bdrv_child_refresh_perms(bs, bs->file, &errp); + bdrv_child_refresh_perms(bs, bs->file, &err); =20 - if (errp) { - error_report_err(errp); + if (err) { + error_report_err(err); } } =20 diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index 365156dff9..5445dc11bd 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -564,7 +564,7 @@ int acpi_ghes_memory_errors(AcpiGhesState *ags, uint16_= t source_id, const uint8_t guid[] =3D UUID_LE(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \ 0xED, 0x7C, 0x83, 0xB1); - Error *errp =3D NULL; + Error *err =3D NULL; int data_length; GArray *block; =20 @@ -584,12 +584,12 @@ int acpi_ghes_memory_errors(AcpiGhesState *ags, uint1= 6_t source_id, acpi_ghes_build_append_mem_cper(block, physical_address); =20 /* Report the error */ - ghes_record_cper_errors(ags, block->data, block->len, source_id, &errp= ); + ghes_record_cper_errors(ags, block->data, block->len, source_id, &err); =20 g_array_free(block, true); =20 - if (errp) { - error_report_err(errp); + if (err) { + error_report_err(err); return -1; } =20 diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index bcf6aa560f..b3c5097bf8 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2848,7 +2848,7 @@ static void spapr_machine_init(MachineState *machine) int i; MemoryRegion *sysmem =3D get_system_memory(); long load_limit, fw_size; - Error *errp =3D NULL; + Error *err =3D NULL; NICInfo *nd; =20 if (!filename) { @@ -2872,7 +2872,7 @@ static void spapr_machine_init(MachineState *machine) /* Determine capabilities to run with */ spapr_caps_init(spapr); =20 - kvmppc_check_papr_resize_hpt(&errp); + kvmppc_check_papr_resize_hpt(&err); if (spapr->resize_hpt =3D=3D SPAPR_RESIZE_HPT_DEFAULT) { /* * If the user explicitly requested a mode we should either @@ -2880,10 +2880,10 @@ static void spapr_machine_init(MachineState *machin= e) * it's not set explicitly, we reset our mode to something * that works */ - if (errp) { + if (err) { spapr->resize_hpt =3D SPAPR_RESIZE_HPT_DISABLED; - error_free(errp); - errp =3D NULL; + error_free(err); + err =3D NULL; } else { spapr->resize_hpt =3D smc->resize_hpt_default; } @@ -2891,14 +2891,14 @@ static void spapr_machine_init(MachineState *machin= e) =20 assert(spapr->resize_hpt !=3D SPAPR_RESIZE_HPT_DEFAULT); =20 - if ((spapr->resize_hpt !=3D SPAPR_RESIZE_HPT_DISABLED) && errp) { + if ((spapr->resize_hpt !=3D SPAPR_RESIZE_HPT_DISABLED) && err) { /* * User requested HPT resize, but this host can't supply it. Bail= out */ - error_report_err(errp); + error_report_err(err); exit(1); } - error_free(errp); + error_free(err); =20 spapr->rma_size =3D spapr_rma_size(spapr, &error_fatal); =20 diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index f365222019..1381310fc7 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -101,7 +101,7 @@ static void xen_create_virtio_mmio_devices(XenPVHMachin= eState *s) #ifdef CONFIG_TPM static void xen_enable_tpm(XenPVHMachineState *s) { - Error *errp =3D NULL; + Error *err =3D NULL; DeviceState *dev; SysBusDevice *busdev; =20 @@ -111,8 +111,15 @@ static void xen_enable_tpm(XenPVHMachineState *s) return; } dev =3D qdev_new(TYPE_TPM_TIS_SYSBUS); - object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp); - object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp); + /* + * FIXME This use of &err is is wrong. If both calls fail, the + * second will trip error_setv()'s assertion. If just one call + * fails, we leak an Error object. Setting the same property + * twice (first to a QOM path, then to an ID string) is almost + * certainly wrong, too. + */ + object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &err); + object_property_set_str(OBJECT(dev), "tpmdev", be->id, &err); busdev =3D SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(busdev, &error_fatal); sysbus_mmio_map(busdev, 0, s->cfg.tpm.base); diff --git a/nbd/common.c b/nbd/common.c index 2a133a66c3..f43cbaa15b 100644 --- a/nbd/common.c +++ b/nbd/common.c @@ -282,10 +282,10 @@ void nbd_set_socket_send_buffer(QIOChannelSocket *sio= c) #ifdef UNIX_STREAM_SOCKET_SEND_BUFFER_SIZE if (sioc->localAddr.ss_family =3D=3D AF_UNIX) { size_t size =3D UNIX_STREAM_SOCKET_SEND_BUFFER_SIZE; - Error *errp =3D NULL; + Error *err =3D NULL; =20 - if (qio_channel_socket_set_send_buffer(sioc, size, &errp) < 0) { - warn_report_err(errp); + if (qio_channel_socket_set_send_buffer(sioc, size, &err) < 0) { + warn_report_err(err); } } #endif /* UNIX_STREAM_SOCKET_SEND_BUFFER_SIZE */ --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792194; cv=none; d=zohomail.com; s=zohoarc; b=bWNCoqcoeCuOgvjVgbT39HFsDWg+j4ZlYJQMJ7GY2BT5vK0Z7Gwu1HJIyUxhpCerWnWLhu5IkBUAhRxpdFP3kAi+gFmi+vwiK4//hsnYtGeIx92Dvn+YKJivyXjHJiZxuqnat9+DwjsZZsj7sVd9QYWM1uEu/6jMhZsYBQBTmto= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792194; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yeKFGZB9+gJSq195IaW/Pt1I2thdpGCpcsFHPG8zrPU=; b=TB9GKz7yECRBGdcqV0qH5Ug8kb4FtwIfCpRwOws6+kVetNh0/TWjjkMhkTWsxdXJ5fD/wdg9lFYHxZqrt2ZRTtxfKJbH5vPQl6v5DEWCdmomCk7bEwu20B9RxKlAi4da/Vi1kjbc71FxeGrpCq4WRoETk+eYjn2aS0jx7IK/bNI= 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 1767792194817421.7309049340714; Wed, 7 Jan 2026 05:23:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTVH-0004rI-P1; Wed, 07 Jan 2026 08:23:11 -0500 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 1vdTVA-0004ex-39 for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:04 -0500 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 1vdTV6-00056r-Tn for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:02 -0500 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-596-Za9l_g-jOcqZ8YlX56m8vA-1; Wed, 07 Jan 2026 08:22:58 -0500 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 A0D7E1800350; Wed, 7 Jan 2026 13:22:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5DBCD19560B4; Wed, 7 Jan 2026 13:22:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3BCD821E6934; Wed, 07 Jan 2026 14:22:55 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4708421E61AE; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792180; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=yeKFGZB9+gJSq195IaW/Pt1I2thdpGCpcsFHPG8zrPU=; b=JMRwrLiSSeJeYb3heKqAH5BmU38iYXRc5wpML4TbgYW8RAPBO/2rlS7uNR04VOlfmT05zZ m8hO+q93r1AIngdOfeJK1dhUf5Cy0tCxhQyvR8s4bsgwBzQ/EaErXi1IXModVfuEeulS2U 7s7y+WDbX7BRAcG8DOAH6EnTgZaKZGk= X-MC-Unique: Za9l_g-jOcqZ8YlX56m8vA-1 X-Mimecast-MFC-AGG-ID: Za9l_g-jOcqZ8YlX56m8vA_1767792177 Resent-To: philmd@linaro.org, richard.henderson@linaro.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:22:55 +0100 Resent-Message-ID: <87sechimkw.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 06/17] error: Strip trailing '\n' from error string arguments (again) Date: Wed, 7 Jan 2026 13:43:30 +0100 Message-ID: <20260107124341.1093312-7-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Lines: 40 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 (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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792196667158500 Tracked down with scripts/coccinelle/err-bad-newline.cocci. Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/es1370.c | 2 +- ui/gtk.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 9873ffadab..566f93f1ea 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -228,7 +228,7 @@ static void print_sctl(uint32_t val) #undef a error_report("es1370: " "%s p2_end_inc %d, p2_st_inc %d," - " r1_fmt %s, p2_fmt %s, p1_fmt %s\n", + " r1_fmt %s, p2_fmt %s, p1_fmt %s", buf, (val & SCTRL_P2ENDINC) >> SCTRL_SH_P2ENDINC, (val & SCTRL_P2STINC) >> SCTRL_SH_P2STINC, diff --git a/ui/gtk.c b/ui/gtk.c index 48571bedbf..e83a366625 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1197,7 +1197,7 @@ static gboolean gd_touch_event(GtkWidget *widget, Gdk= EventTouch *touch, type =3D INPUT_MULTI_TOUCH_TYPE_END; break; default: - warn_report("gtk: unexpected touch event type\n"); + warn_report("gtk: unexpected touch event type"); return FALSE; } =20 --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792206; cv=none; d=zohomail.com; s=zohoarc; b=IomYegwei2LFKmdeMUdbNP6mZU3QZgqLN7Qc6y6EtaAhE8Gu9WxNw+BTjFvFXlBvWjBARSb43UnRIgMWB19/ij0IgzP8FglLlqu4OgvSsvRvOkWbhCSTgh6Zc8f25kXgcI1kbv7z+l4WS/fpkUs6LVta+DVBthTebWLJHeKuHuM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792206; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gmvPlwKEeCyvXjYhqrp6IAqZIl+goYekY4R4ZTuUKtY=; b=PbnjmQLqq0LQSa7UZVnj6aX2BUN0yx9JgUUEezk7z0Zd5Jh/fDhsN/bkxB71NdAhQ3Wlu+cii4JxPs9XFEXrGft/Esxzw1Xk6Mdtsh2TU+fToHX1GVm6aq4XW7TYvVJ+M+fFJ0mJtrCITP7Ee7XSZNbVAY9lSQLsg+zaYCnEKjY= 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 1767792206073269.29010845692164; Wed, 7 Jan 2026 05:23:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTVS-0006F1-Q1; Wed, 07 Jan 2026 08:23:22 -0500 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 1vdTVQ-0005ze-Dr for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:20 -0500 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 1vdTVO-00059i-VA for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:20 -0500 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-247-r8za39ELOvGePB6FTyXIdA-1; Wed, 07 Jan 2026 08:23:14 -0500 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 DE771195605A; Wed, 7 Jan 2026 13:23:12 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9D16B180066A; Wed, 7 Jan 2026 13:23:12 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 43FA521E6934; Wed, 07 Jan 2026 14:23:10 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4ADA921E61B2; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792198; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=gmvPlwKEeCyvXjYhqrp6IAqZIl+goYekY4R4ZTuUKtY=; b=gSxp9xNQ7lFIeqiGOmN04SkdxQ7guY8VqD4toBK8M/OuUXigkH1K4LuhLccG6NGB8qbWa8 InbyqPFKBWi1KilGbbHRULo0+FaseN1OI/EUSJgE+sytBeczPmPNKhSNEeTk9YimtYdpi2 BS9OqaRbQCSwfjbxt4gPxTizHqOB2Es= X-MC-Unique: r8za39ELOvGePB6FTyXIdA-1 X-Mimecast-MFC-AGG-ID: r8za39ELOvGePB6FTyXIdA_1767792193 Resent-To: richard.henderson@linaro.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:23:10 +0100 Resent-Message-ID: <87o6n5imkh.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org Subject: [PULL 07/17] ui: Convert to qemu_create() for simplicity and consistency Date: Wed, 7 Jan 2026 13:43:31 +0100 Message-ID: <20260107124341.1093312-8-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 34 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 (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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792206681158500 Content-Type: text/plain; charset="utf-8" The error message changes from failed to open file 'FILENAME': REASON to Could not create 'FILENAME': REASON Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-4-armbru@redhat.com> --- ui/ui-qmp-cmds.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/ui-qmp-cmds.c b/ui/ui-qmp-cmds.c index 74fa6c6ec5..b49b636152 100644 --- a/ui/ui-qmp-cmds.c +++ b/ui/ui-qmp-cmds.c @@ -369,10 +369,8 @@ qmp_screendump(const char *filename, const char *devic= e, } image =3D pixman_image_ref(surface->image); =20 - fd =3D qemu_open_old(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY= , 0666); + fd =3D qemu_create(filename, O_WRONLY | O_TRUNC | O_BINARY, 0666, errp= ); if (fd =3D=3D -1) { - error_setg(errp, "failed to open file '%s': %s", filename, - strerror(errno)); return; } =20 --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792221; cv=none; d=zohomail.com; s=zohoarc; b=J5VWDvvZmZxZJlI/pVgbK+XEp3pZlatSN8/xTySktEYkRBYEMe3hXLfkQTwi1GdaR0Mbmcwen2uyb3a494GaXzIH0Kzrt9N42ul3qsllXCB2M2K0ABe3e8RD0IedZl4PPRH0RLwwNUxbKstOh5dFwBFHXKhIrNv9Dd3Os1jeP0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792221; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gONgRn/GNyBGob63kNT426dkqmiq4qN/s3arf4kHFSI=; b=iaIZLmmoGo3HoFjubvolpc3t7ER2x2gmDKxQm8mOJ33kHgVh/ij2mAIyazfKyI6ZBvml1Kyb3+g5hT9dlBHN+GrySOvYgmVyzw+F5Apc4dqZj8cJOJfCfJC62SJM/hCh9CgauhM8A/dPSXsJozTmLGpr7nDl3eqI9k7jf2XoZrg= 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 1767792221226354.2673872577276; Wed, 7 Jan 2026 05:23:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTVj-0006ss-4F; Wed, 07 Jan 2026 08:23:39 -0500 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 1vdTVi-0006sa-Au for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:38 -0500 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 1vdTVe-0005Bo-Qr for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:36 -0500 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-561-FKJ20vT4O5G4wcrUmLUQOw-1; Wed, 07 Jan 2026 08:23:31 -0500 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 C0F0C1955DC7; Wed, 7 Jan 2026 13:23:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 68AB71800240; Wed, 7 Jan 2026 13:23:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4BB1B21E6937; Wed, 07 Jan 2026 14:23:27 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4F1D321E61B3; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792214; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=gONgRn/GNyBGob63kNT426dkqmiq4qN/s3arf4kHFSI=; b=iOGx6mDi6I7JWQkCqxKA1Sf5CXyrCtH9rA/SLFpRUsQJh3iH48H10F1N1wfDXnZ+A46iUI Lp2XiuQIfdDXoGh0mkI19OMR7i2MI2LltmQLgf6DDVC6TN78zyEK5a92R4lBeTv1hOq4w/ f2lzboewNcXt4mU1OP81/ZdeFbDFOYg= X-MC-Unique: FKJ20vT4O5G4wcrUmLUQOw-1 X-Mimecast-MFC-AGG-ID: FKJ20vT4O5G4wcrUmLUQOw_1767792210 Resent-To: philmd@linaro.org, richard.henderson@linaro.org, qemu-devel@nongnu.org, dave@treblig.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:23:27 +0100 Resent-Message-ID: <87jyxtimk0.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, "Dr. David Alan Gilbert" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 08/17] tap-solaris: Use error_setg_file_open() for better error messages Date: Wed, 7 Jan 2026 13:43:32 +0100 Message-ID: <20260107124341.1093312-9-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Lines: 54 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 (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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792222783158500 Error messages change from Can't open /dev/ip (actually /dev/udp) Can't open /dev/tap Can't open /dev/tap (2) to Could not open '/dev/udp': REASON Could not open '/dev/tap': REASON where REASON is the value of strerror(errno). Signed-off-by: Markus Armbruster Reviewed-by: Dr. David Alan Gilbert Message-ID: <20251121121438.1249498-5-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- net/tap-solaris.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/tap-solaris.c b/net/tap-solaris.c index 75397e6c54..faf7922ea8 100644 --- a/net/tap-solaris.c +++ b/net/tap-solaris.c @@ -87,13 +87,13 @@ static int tap_alloc(char *dev, size_t dev_size, Error = **errp) =20 ip_fd =3D RETRY_ON_EINTR(open("/dev/udp", O_RDWR, 0)); if (ip_fd < 0) { - error_setg(errp, "Can't open /dev/ip (actually /dev/udp)"); + error_setg_file_open(errp, errno, "/dev/udp"); return -1; } =20 tap_fd =3D RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0)); if (tap_fd < 0) { - error_setg(errp, "Can't open /dev/tap"); + error_setg_file_open(errp, errno, "/dev/tap"); return -1; } =20 @@ -107,7 +107,7 @@ static int tap_alloc(char *dev, size_t dev_size, Error = **errp) =20 if_fd =3D RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0)); if (if_fd < 0) { - error_setg(errp, "Can't open /dev/tap (2)"); + error_setg_file_open(errp, errno, "/dev/tap"); return -1; } if(ioctl(if_fd, I_PUSH, "ip") < 0){ --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792245; cv=none; d=zohomail.com; s=zohoarc; b=WcbKF9DgaDtH3g6VBWeF15b163kDOKHeI3zTZ0cjSfTdCEuEVAfqp7BGdxZeQf9XUeAx4kiaVCInHpDmlJgdYuTGnphQl606+Y90ileBODHmey+zVpYBm/m0DoLKWAs5ikOSi2CrbhF0sfdGaMZ7g/MhIOD8FJwlLZ3DdDTjHa0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792245; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5rBT0wM/0nCOtv8moP8RiQX1LfyxaSmtC3iGS80HRSU=; b=gTqlyVZRFxfeI6o+w9jOUlqqK/Z7VQsMhSKME05lR2e9NQMgosytGmCuR/oQ3YHE/CG5RzvRrd5dSMquw2aU47xrbIwsH3ife4Lq5aG53BXVjSltyWtd2pv/HJMY1YP+14Cq8dJJdkM+sEn4JT3y/rMB5PIrvD1fAZU0xhaxeHc= 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 1767792245843903.61868514489; Wed, 7 Jan 2026 05:24:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTVy-00075r-Cg; Wed, 07 Jan 2026 08:23:54 -0500 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 1vdTVp-00071F-Jl for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:46 -0500 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 1vdTVo-0005DR-7F for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:45 -0500 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-128-Pe8uxP-gODWvgLy-76Pgeg-1; Wed, 07 Jan 2026 08:23:40 -0500 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 905FE1800371; Wed, 7 Jan 2026 13:23:39 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 37DB319560A2; Wed, 7 Jan 2026 13:23:39 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 14CB421E6934; Wed, 07 Jan 2026 14:23:37 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5340621E61B5; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792223; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=5rBT0wM/0nCOtv8moP8RiQX1LfyxaSmtC3iGS80HRSU=; b=HED4CS5ifFOVggGiBqUFbIgfvsdYZkBsaJX9MZNle3/+ghZH0P9c4VW4dIL5sFKom4bU7A N6lBSTYryiG9kGK3G/1c892f8aj/oqBxQ5whOQQssCPW/C1rU39anNpP2W1gvSB1Y5Wwqz AzLsiLsUYf81w3RnrBKKwAu8PIhVPn8= X-MC-Unique: Pe8uxP-gODWvgLy-76Pgeg-1 X-Mimecast-MFC-AGG-ID: Pe8uxP-gODWvgLy-76Pgeg_1767792219 Resent-To: richard.henderson@linaro.org, qemu-devel@nongnu.org, dave@treblig.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:23:37 +0100 Resent-Message-ID: <87fr8himjq.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, "Dr. David Alan Gilbert" , Kostiantyn Kostiuk Subject: [PULL 09/17] qga: Use error_setg_file_open() for better error messages Date: Wed, 7 Jan 2026 13:43:33 +0100 Message-ID: <20260107124341.1093312-10-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 69 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 (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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792246841158500 Content-Type: text/plain; charset="utf-8" Error messages change from open("FNAME"): REASON to Could not open 'FNAME': REASON Signed-off-by: Markus Armbruster Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Kostiantyn Kostiuk Message-ID: <20251121121438.1249498-6-armbru@redhat.com> --- qga/commands-linux.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/qga/commands-linux.c b/qga/commands-linux.c index c639a60a94..ae2c4d442a 100644 --- a/qga/commands-linux.c +++ b/qga/commands-linux.c @@ -1503,14 +1503,15 @@ static void transfer_vcpu(GuestLogicalProcessor *vc= pu, bool sys2vcpu, =20 dirfd =3D open(dirpath, O_RDONLY | O_DIRECTORY); if (dirfd =3D=3D -1) { - error_setg_errno(errp, errno, "open(\"%s\")", dirpath); + error_setg_file_open(errp, errno, dirpath); return; } =20 fd =3D openat(dirfd, fn, sys2vcpu ? O_RDONLY : O_RDWR); if (fd =3D=3D -1) { if (errno !=3D ENOENT) { - error_setg_errno(errp, errno, "open(\"%s/%s\")", dirpath, fn); + error_setg_errno(errp, errno, "could not open %s/%s", + dirpath, fn); } else if (sys2vcpu) { vcpu->online =3D true; vcpu->can_offline =3D false; @@ -1712,7 +1713,7 @@ static void transfer_memory_block(GuestMemoryBlock *m= em_blk, bool sys2memblk, dirfd =3D open(dirpath, O_RDONLY | O_DIRECTORY); if (dirfd =3D=3D -1) { if (sys2memblk) { - error_setg_errno(errp, errno, "open(\"%s\")", dirpath); + error_setg_file_open(errp, errno, dirpath); } else { if (errno =3D=3D ENOENT) { result->response =3D GUEST_MEMORY_BLOCK_RESPONSE_TYPE_NOT_= FOUND; @@ -1937,7 +1938,7 @@ static GuestDiskStatsInfoList *guest_get_diskstats(Er= ror **errp) =20 fp =3D fopen(diskstats, "r"); if (fp =3D=3D NULL) { - error_setg_errno(errp, errno, "open(\"%s\")", diskstats); + error_setg_file_open(errp, errno, diskstats); return NULL; } =20 @@ -2048,7 +2049,7 @@ GuestCpuStatsList *qmp_guest_get_cpustats(Error **err= p) =20 fp =3D fopen(cpustats, "r"); if (fp =3D=3D NULL) { - error_setg_errno(errp, errno, "open(\"%s\")", cpustats); + error_setg_file_open(errp, errno, cpustats); return NULL; } =20 --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792251; cv=none; d=zohomail.com; s=zohoarc; b=DQ83vGBpLdJOQlQ3wDS9VWoM13AqSYiggCtJkAd7QKl2GHvYLvuH2rtRJ609Ua4J/HaLOvuAxXvn5YjHpSs4ZClMBd3afFZp0MZneOeIxA9kPOxUfUeK7Ens5aDAb7RCh/HDYC26/ixMlpkVBvZIgIAqQcw+UOhpJ+Ci1LDWkSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792251; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=keBXidDCLkwGrt3l6TpJ6ATfVbhpZVBVBE23uCa133Y=; b=T8l4uFJTzVsVRZWEvimPw8qNIgENsJkx1KbBFn2MRVvzH4BYngmXym3cuYxY2oG0duKEN9l3yogPKPZvcsAxAeIYr+wutSCq+nnvmKoSVr1qVypHoz12c5eHMwvDTEqQcxIvCpl3v86RoQeTMudJL9ugry0hy3KzFL3vK9o4tdM= 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 1767792251173392.57469809562417; Wed, 7 Jan 2026 05:24:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTW4-00079g-EO; Wed, 07 Jan 2026 08:24:00 -0500 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 1vdTVy-00076E-6s for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:54 -0500 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 1vdTVw-0005FJ-S1 for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:23:53 -0500 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-500-B1uvFgX8NaeMPzXkmoW3pw-1; Wed, 07 Jan 2026 08:23:51 -0500 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 15D50180045C; Wed, 7 Jan 2026 13:23:50 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C6A311956048; Wed, 7 Jan 2026 13:23:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8FD3F21E6937; Wed, 07 Jan 2026 14:23:47 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 571D221E61B7; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792232; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=keBXidDCLkwGrt3l6TpJ6ATfVbhpZVBVBE23uCa133Y=; b=bPFoEe+mpa5c/pJ6tNpSDxPb8p/hcLp43VWmbm4OFj4jqAci6yAo60ZLKZVKXLbWi87OTV ejK84PoiCzLCl5K3QnHkH5fstGYliX/Rl4lCCYlvSB78j7H3Mca1iqfMT1Kq6VerNM7S0O cJ8CMC0vgtT2CFz00+1TZ4aZE81mQJ0= X-MC-Unique: B1uvFgX8NaeMPzXkmoW3pw-1 X-Mimecast-MFC-AGG-ID: B1uvFgX8NaeMPzXkmoW3pw_1767792230 Resent-To: philmd@linaro.org, richard.henderson@linaro.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:23:47 +0100 Resent-Message-ID: <87bjj5imjg.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 10/17] net/tap: Use error_setg_file_open() for a better error message Date: Wed, 7 Jan 2026 13:43:34 +0100 Message-ID: <20260107124341.1093312-11-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Lines: 39 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 (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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792252912158500 The error message changes from tap: open vhost char device failed to Could not open '/dev/vhost-net': REASON I think the exact file name is more useful to know than the file's purpose. We could put back the "tap: " prefix with error_prepend(). Not worth the bother. Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-9-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- net/tap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/tap.c b/net/tap.c index abe3b2d036..bfba3fd7a7 100644 --- a/net/tap.c +++ b/net/tap.c @@ -747,8 +747,7 @@ static void net_init_tap_one(const NetdevTapOptions *ta= p, NetClientState *peer, } else { vhostfd =3D open("/dev/vhost-net", O_RDWR); if (vhostfd < 0) { - error_setg_errno(errp, errno, - "tap: open vhost char device failed"); + error_setg_file_open(errp, errno, "/dev/vhost-net"); goto failed; } if (!qemu_set_blocking(vhostfd, false, errp)) { --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792259; cv=none; d=zohomail.com; s=zohoarc; b=MPtkt97ABPsmGzSi+P71J14eJsVG2AebvjUYHuPYJHE498alKVrjs76yGWkgfd3dcrOd0g1yZh5+1NfdSdbcsZzKmJUF6d2bcwW9/Eky+c9Fokwtfwbuzya9q/d96OVBje0rkNBpwT3Scx4RL694WfL9fAmm1abzjqL+uoaw6So= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792259; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+24QtW0IOqJ/TCWGYCOGIexrTZX+Dhgygc6Vsp4mfbI=; b=Y4QMVpI+Llj6wdMSvhZrtLpRbHU0fdL8nHCxkAfoJJ2dFH2GQcLRroDSTq1lYFP5tcMWmY6FOp+11HKhP57bRteUVZCvB9sjc/OZnD5X58oXGyQEo654l+kHjxx2SAtvTx5h4mXcAdGd19b/5nXddOEc7fptICgVd8/L4y8B2G4= 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 1767792259191659.07016649255; Wed, 7 Jan 2026 05:24:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTWE-0007ah-Un; Wed, 07 Jan 2026 08:24:10 -0500 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 1vdTWC-0007R3-Lb for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:24:08 -0500 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 1vdTWB-0005IF-8F for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:24:08 -0500 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-681-bMB30eXXN0eRlpBsl3ml7Q-1; Wed, 07 Jan 2026 08:24:03 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 86E7C18005B3; Wed, 7 Jan 2026 13:24:02 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 45837180066A; Wed, 7 Jan 2026 13:24:02 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0936D21E6934; Wed, 07 Jan 2026 14:24:00 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5AFFC21E61B8; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792246; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=+24QtW0IOqJ/TCWGYCOGIexrTZX+Dhgygc6Vsp4mfbI=; b=L6ZXBohLtOHzR8F+hQvY8vLkUEVFYzoa9iI61cMqJIe887rbpOmkZ1kgunSV3FML/QU9/+ um92qs8ePnG3yHCOuUAJGJe05MELPdDYkeW9j8T5Up9YO4B+UmYPXqG6GxLVF2Z4rJRHpN HlUQiT5KSBnyVRzlFejtnDmtC+9WHJ0= X-MC-Unique: bMB30eXXN0eRlpBsl3ml7Q-1 X-Mimecast-MFC-AGG-ID: bMB30eXXN0eRlpBsl3ml7Q_1767792242 Resent-To: richard.henderson@linaro.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:24:00 +0100 Resent-Message-ID: <877bttimj3.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org Subject: [PULL 11/17] blkdebug: Use error_setg_file_open() for a better error message Date: Wed, 7 Jan 2026 13:43:35 +0100 Message-ID: <20260107124341.1093312-12-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 34 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 (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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792260956158500 Content-Type: text/plain; charset="utf-8" The error message changes from Could not read blkdebug config file: REASON to Could not open 'FNAME': REASON I think the exact file name is more useful to know than the file's purpose. Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-10-armbru@redhat.com> --- block/blkdebug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index c54aee0c84..8a4a8cb85e 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -288,7 +288,7 @@ static int read_config(BDRVBlkdebugState *s, const char= *filename, if (filename) { f =3D fopen(filename, "r"); if (f =3D=3D NULL) { - error_setg_errno(errp, errno, "Could not read blkdebug config = file"); + error_setg_file_open(errp, errno, filename); return -errno; } =20 --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792274; cv=none; d=zohomail.com; s=zohoarc; b=EtyvAI/Aficrozc06JZKrRsQRFhAFr3u6nDd/dxE/H0BfjxlAHqjeTJpyAAjXrdTioMCqblugeGHAQrTXUNixu5CcbQnbNbZyf37znV4luVSzG06glZqTnSwQ9c97KqAlXnJ1BvJugfqnsmczDc8bMxPe9+wdBxb/wPLk4+DhJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792274; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kHXcfqUpdUadtzjstg1lmm3/GgEIWG1dn0oWD2mhTp0=; b=cmx4XMw8KD2//AhF4YnbGmxidbhuWoyWSQw5n+/pX1vpExOwRN6FjKr4i/r3zUvWs8gZnZI1Z+k6ENu/ZCfQyeVjdPkU7KSvuaPPaShmaN4BjefPDJz3FmETx1aWL+uRU+r1uVzONxB+RXq3/gOUS+eGP/9f/oxwlbQcQ6s1hC4= 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 1767792274060207.05195886803438; Wed, 7 Jan 2026 05:24:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTWX-00005c-6i; Wed, 07 Jan 2026 08:24:29 -0500 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 1vdTWT-0008QB-9S for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:24:25 -0500 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 1vdTWQ-0005Vv-MF for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:24:24 -0500 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-266-bKOuzTQ4MFyE5M2BSUfRZA-1; Wed, 07 Jan 2026 08:24:17 -0500 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 B94251955E77; Wed, 7 Jan 2026 13:24:16 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 365F230002D1; Wed, 7 Jan 2026 13:24:16 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CEEC921E6934; Wed, 07 Jan 2026 14:24:13 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5F00321E61BB; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792261; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=kHXcfqUpdUadtzjstg1lmm3/GgEIWG1dn0oWD2mhTp0=; b=HlUq41huGHuGGv+0RNWqw8CorkncMxDsSOqZMov//dG8g6MK1JakEcuhkxqXsEXBT3fkgH bO2m2OKuvL1UUfI0YpYGHJtKGk1OTL1Eb7kel+nCG1Fo+BaO0FsaYQaa1LmzFAIYQ6AuS5 m+AA0kMazOKH3Ut7mvTWw46egEm+piQ= X-MC-Unique: bKOuzTQ4MFyE5M2BSUfRZA-1 X-Mimecast-MFC-AGG-ID: bKOuzTQ4MFyE5M2BSUfRZA_1767792257 Resent-To: richard.henderson@linaro.org, qemu-devel@nongnu.org, dave@treblig.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:24:13 +0100 Resent-Message-ID: <87344himiq.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, "Dr. David Alan Gilbert" Subject: [PULL 12/17] error: Use error_setg_file_open() for simplicity and consistency Date: Wed, 7 Jan 2026 13:43:36 +0100 Message-ID: <20260107124341.1093312-13-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 206 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 (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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792275132158500 Content-Type: text/plain; charset="utf-8" Replace error_setg_errno(errp, errno, MSG, FNAME); by error_setg_file_open(errp, errno, FNAME); where MSG is "Could not open '%s'" or similar. Also replace equivalent uses of error_setg(). A few messages lose prefixes ("net dump: ", "SEV: ", __func__ ": "). We could put them back with error_prepend(). Not worth the bother. Signed-off-by: Markus Armbruster Reviewed-by: Dr. David Alan Gilbert Message-ID: <20251121121438.1249498-11-armbru@redhat.com> [Conflict with commit 26b4a6ffe7f (monitor/hmp: Merge hmp-cmds-target.c within hmp-cmds.c) resolved] --- hw/9pfs/9p-local.c | 2 +- hw/acpi/core.c | 2 +- hw/core/loader.c | 2 +- hw/pci-host/xen_igd_pt.c | 2 +- monitor/hmp-cmds.c | 2 +- net/dump.c | 2 +- net/tap-bsd.c | 6 +++--- net/tap-linux.c | 2 +- target/i386/sev.c | 6 ++---- util/vfio-helpers.c | 5 ++--- 10 files changed, 14 insertions(+), 17 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 31e216227c..376b377698 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1456,7 +1456,7 @@ static int local_init(FsContext *ctx, Error **errp) =20 data->mountfd =3D open(ctx->fs_root, O_DIRECTORY | O_RDONLY); if (data->mountfd =3D=3D -1) { - error_setg_errno(errp, errno, "failed to open '%s'", ctx->fs_root); + error_setg_file_open(errp, errno, ctx->fs_root); goto err; } =20 diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 2b74bed882..4e030d8e3b 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -277,7 +277,7 @@ void acpi_table_add(const QemuOpts *opts, Error **errp) int fd =3D open(*cur, O_RDONLY | O_BINARY); =20 if (fd < 0) { - error_setg(errp, "can't open file %s: %s", *cur, strerror(errn= o)); + error_setg_file_open(errp, errno, *cur); goto out; } =20 diff --git a/hw/core/loader.c b/hw/core/loader.c index 89d67d2760..16c11a4643 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -380,7 +380,7 @@ bool load_elf_hdr(const char *filename, void *hdr, bool= *is64, Error **errp) =20 fd =3D open(filename, O_RDONLY | O_BINARY); if (fd < 0) { - error_setg_errno(errp, errno, "Failed to open file: %s", filename); + error_setg_file_open(errp, errno, filename); return false; } if (read(fd, hdr, EI_NIDENT) !=3D EI_NIDENT) { diff --git a/hw/pci-host/xen_igd_pt.c b/hw/pci-host/xen_igd_pt.c index 5dd17ef236..f6016f2cd5 100644 --- a/hw/pci-host/xen_igd_pt.c +++ b/hw/pci-host/xen_igd_pt.c @@ -55,7 +55,7 @@ static void host_pci_config_read(int pos, int len, uint32= _t *val, Error **errp) =20 config_fd =3D open(path, O_RDWR); if (config_fd < 0) { - error_setg_errno(errp, errno, "Failed to open: %s", path); + error_setg_file_open(errp, errno, path); goto out; } =20 diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index f7ff6ec90e..5a673cddb2 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -740,7 +740,7 @@ static uint64_t vtop(void *ptr, Error **errp) =20 fd =3D open("/proc/self/pagemap", O_RDONLY); if (fd =3D=3D -1) { - error_setg_errno(errp, errno, "Cannot open /proc/self/pagemap"); + error_setg_file_open(errp, errno, "/proc/self/pagemap"); return -1; } =20 diff --git a/net/dump.c b/net/dump.c index 581234b775..0c39f09892 100644 --- a/net/dump.c +++ b/net/dump.c @@ -111,7 +111,7 @@ static int net_dump_state_init(DumpState *s, const char= *filename, =20 fd =3D open(filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0644); if (fd < 0) { - error_setg_errno(errp, errno, "net dump: can't open %s", filename); + error_setg_file_open(errp, errno, filename); return -1; } =20 diff --git a/net/tap-bsd.c b/net/tap-bsd.c index bbf84d1828..3fd300d46f 100644 --- a/net/tap-bsd.c +++ b/net/tap-bsd.c @@ -68,7 +68,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, } } if (fd < 0) { - error_setg_errno(errp, errno, "could not open %s", dname); + error_setg_file_open(errp, errno, dname); return -1; } =20 @@ -118,7 +118,7 @@ static int tap_open_clone(char *ifname, int ifname_size= , Error **errp) =20 fd =3D RETRY_ON_EINTR(open(PATH_NET_TAP, O_RDWR)); if (fd < 0) { - error_setg_errno(errp, errno, "could not open %s", PATH_NET_TAP); + error_setg_file_open(errp, errno, PATH_NET_TAP); return -1; } =20 @@ -166,7 +166,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_h= dr, snprintf(dname, sizeof dname, "/dev/%s", ifname); fd =3D RETRY_ON_EINTR(open(dname, O_RDWR)); if (fd < 0 && errno !=3D ENOENT) { - error_setg_errno(errp, errno, "could not open %s", dname); + error_setg_file_open(errp, errno, dname); return -1; } } diff --git a/net/tap-linux.c b/net/tap-linux.c index 2a90b58467..909c4f1fcf 100644 --- a/net/tap-linux.c +++ b/net/tap-linux.c @@ -57,7 +57,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, if (fd < 0) { fd =3D RETRY_ON_EINTR(open(PATH_NET_TUN, O_RDWR)); if (fd < 0) { - error_setg_errno(errp, errno, "could not open %s", PATH_NET_TU= N); + error_setg_file_open(errp, errno, PATH_NET_TUN); return -1; } } diff --git a/target/i386/sev.c b/target/i386/sev.c index fb5a3b5d77..1d70f96ec1 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -892,8 +892,7 @@ static SevCapability *sev_get_capabilities(Error **errp) =20 fd =3D open(sev_device, O_RDWR); if (fd < 0) { - error_setg_errno(errp, errno, "SEV: Failed to open %s", - sev_device); + error_setg_file_open(errp, errno, sev_device); g_free(sev_device); return NULL; } @@ -1820,8 +1819,7 @@ static int sev_common_kvm_init(ConfidentialGuestSuppo= rt *cgs, Error **errp) devname =3D object_property_get_str(OBJECT(sev_common), "sev-device", = NULL); sev_common->sev_fd =3D open(devname, O_RDWR); if (sev_common->sev_fd < 0) { - error_setg(errp, "%s: Failed to open %s '%s'", __func__, - devname, strerror(errno)); + error_setg_file_open(errp, errno, devname); g_free(devname); return -1; } diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index 44b457c442..c619516163 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -309,7 +309,7 @@ static int qemu_vfio_init_pci(QEMUVFIOState *s, const c= har *device, s->container =3D open("/dev/vfio/vfio", O_RDWR); =20 if (s->container =3D=3D -1) { - error_setg_errno(errp, errno, "Failed to open /dev/vfio/vfio"); + error_setg_file_open(errp, errno, "/dev/vfio/vfio"); return -errno; } if (ioctl(s->container, VFIO_GET_API_VERSION) !=3D VFIO_API_VERSION) { @@ -333,8 +333,7 @@ static int qemu_vfio_init_pci(QEMUVFIOState *s, const c= har *device, =20 s->group =3D open(group_file, O_RDWR); if (s->group =3D=3D -1) { - error_setg_errno(errp, errno, "Failed to open VFIO group file: %s", - group_file); + error_setg_file_open(errp, errno, group_file); g_free(group_file); ret =3D -errno; goto fail_container; --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792304; cv=none; d=zohomail.com; s=zohoarc; b=d4irT0+iDaVu4E63s/tZmI+rPYjBTs9DYfcdT8St4fn0tiHoxePYDue/wdsCsFSDwONGNfhwrgTHE5oRbxk81sFAVwBM4eP2tRQqQHsx82HFCxJsnE1JvVw8T/ngtMYC7ngPN131BDASKxUJkVpDvrRseFTDp+jMJZmn9ngWUDk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792304; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZPKCPUUR4fzGWdFpXlfe46sZ0bt7B0rWoFCl24emMc4=; b=GB2CUTd0AoF5ZDAwIWBkcmB2lOcIGKhq9lz0ZN2PiByEi7ymw5CQF3RucbJXowlDhuHxbKMJkukGFTdmBjITuO4dppggVLx1hpEa6MK8QtoIk5cFfKndW5c2E3Pcvt+evOpdins5FZwc4S18Iy5J4wZEtKWdFDpmzkspPWpL5j4= 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 1767792304277916.9002453539038; Wed, 7 Jan 2026 05:25:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTWx-0000ht-Uy; Wed, 07 Jan 2026 08:24:57 -0500 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 1vdTWe-0000cH-Mm for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:24:36 -0500 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 1vdTWc-0005aK-VJ for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:24:36 -0500 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-76-kdnY-g6yPo-OVIprE9q7IA-1; Wed, 07 Jan 2026 08:24:32 -0500 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 75E76180034A; Wed, 7 Jan 2026 13:24:31 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3325C30002D1; Wed, 7 Jan 2026 13:24:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id ED4D021E6937; Wed, 07 Jan 2026 14:24:28 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6310521E61BD; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792274; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=ZPKCPUUR4fzGWdFpXlfe46sZ0bt7B0rWoFCl24emMc4=; b=Yv2vWnjtfuEZRcS3O9Zj6uQ9tP2WLIKQqAoG5qUuw0r4p2p0FHFG8wKlFUP6+yN6AAZlGc hXooKr/5JcLGdbzuYCZAvFfN5sWmBLNwpao2qVj1WJD3WotL6bm4dxEglhOMFacJCke4PW n7NuLcUbrU6O2qBSnRYCF+MS4qLCaPM= X-MC-Unique: kdnY-g6yPo-OVIprE9q7IA-1 X-Mimecast-MFC-AGG-ID: kdnY-g6yPo-OVIprE9q7IA_1767792271 Resent-To: philmd@linaro.org, richard.henderson@linaro.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:24:28 +0100 Resent-Message-ID: <87y0m9h7xv.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 13/17] net/slirp: Improve file open error message Date: Wed, 7 Jan 2026 13:43:37 +0100 Message-ID: <20260107124341.1093312-14-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Lines: 31 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 (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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792305215158501 This error reports failure to create a temporary file, and error_setg_file_open() would probably be too terse, so merely switch to error_setg_errno() to add errno information. Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-12-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- net/slirp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/slirp.c b/net/slirp.c index 120eef6122..5996fec512 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -1034,8 +1034,10 @@ static int slirp_smb(SlirpState* s, const char *expo= rted_dir, =20 f =3D fopen(smb_conf, "w"); if (!f) { + int eno =3D errno; + slirp_smb_cleanup(s); - error_setg(errp, + error_setg_errno(errp, eno, "Could not create samba server configuration file '%s'", smb_conf); g_free(smb_conf); --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792313; cv=none; d=zohomail.com; s=zohoarc; b=dxmzHppg5l6naGOx83wQrZaV/TbjFCiCNDntv77ZUykWzjKQ03UGCiKEM/QhzZ4tNvjqLy9upvEFfD6y4egR4xk9mRs9/OXXyBXS1JgSvR0oE6r/Gu6VJmnB/Oxgpsw84D9q6mtDYJB5k2KzSzdI3nGCpgRUH1OettME7oDjb6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792313; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PMrGxDUOw+6egKZEjcoDkB5NFB8+8OyvW2jMhK9If/o=; b=nTJ7pXFjrVgLHCruGLKrSNcTWfowvmV6SOGpgh4AM8YD04F732g36mG7RBlF50wUOQFLSr/B4o2XIH2MRbK4hAT0203njYCXkPMTK6QG4enr24naxslWL8wZZ9NlcV2acCw6aCwM3PB6xOv0mheubNa6uk37SAHsaB5Oidu6v9o= 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 1767792313782692.6493823363193; Wed, 7 Jan 2026 05:25:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTX7-0000xB-JA; Wed, 07 Jan 2026 08:25:09 -0500 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 1vdTWs-0000kB-S3 for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:24:54 -0500 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 1vdTWq-0005eA-FX for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:24:49 -0500 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-688-Sqt4pDzgPkGaI_wepIfKkA-1; Wed, 07 Jan 2026 08:24:44 -0500 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 B8AB21956050; Wed, 7 Jan 2026 13:24:43 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 358D530002D1; Wed, 7 Jan 2026 13:24:43 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F39A421E6934; Wed, 07 Jan 2026 14:24:40 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6707A21E6934; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792287; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=PMrGxDUOw+6egKZEjcoDkB5NFB8+8OyvW2jMhK9If/o=; b=UY7cjo8focNRgjdW5QVA4zvD49k9M2asfeHBlB4pMvh7mK1Tsg2+AvHcfpP2oZwaH7CFfV jKi+IdQb4sohRTAVs6bse+YYGmVcKHRdfV6LvtGXl7Gef7APs3zh3KdwbJQFrAnWqImlMy PdnP7BmH2fuToi/KvOFUDeG6Pwaq8sU= X-MC-Unique: Sqt4pDzgPkGaI_wepIfKkA-1 X-Mimecast-MFC-AGG-ID: Sqt4pDzgPkGaI_wepIfKkA_1767792283 Resent-To: philmd@linaro.org, richard.henderson@linaro.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:24:40 +0100 Resent-Message-ID: <87tswxh7xj.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 14/17] error: Use error_setg_errno() to improve error messages Date: Wed, 7 Jan 2026 13:43:38 +0100 Message-ID: <20260107124341.1093312-15-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Lines: 142 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 (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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792315179158500 A few error messages show numeric errno codes. Use error_setg_errno() to show human-readable text instead. Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-13-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- backends/cryptodev-lkcf.c | 2 +- hw/ppc/spapr.c | 6 +++--- hw/vfio/migration-multifd.c | 5 +++-- migration/rdma.c | 3 +-- net/l2tpv3.c | 6 ++---- target/riscv/kvm/kvm-cpu.c | 11 ++++++----- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/backends/cryptodev-lkcf.c b/backends/cryptodev-lkcf.c index 97a8a8812c..40c7bd3c5a 100644 --- a/backends/cryptodev-lkcf.c +++ b/backends/cryptodev-lkcf.c @@ -218,7 +218,7 @@ static void cryptodev_lkcf_init(CryptoDevBackend *backe= nd, Error **errp) } lkcf->eventfd =3D eventfd(0, 0); if (lkcf->eventfd < 0) { - error_setg(errp, "Failed to create eventfd: %d", errno); + error_setg_errno(errp, errno, "Failed to create eventfd"); return; } =20 diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index b3c5097bf8..f129e4ec39 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2700,9 +2700,9 @@ static void spapr_set_vsmt_mode(SpaprMachineState *sp= apr, Error **errp) ret =3D kvmppc_set_smt_threads(spapr->vsmt); if (ret) { /* Looks like KVM isn't able to change VSMT mode */ - error_setg(&local_err, - "Failed to set KVM's VSMT mode to %d (errno %d)", - spapr->vsmt, ret); + error_setg_errno(&local_err, -ret, + "Failed to set KVM's VSMT mode to %d", + spapr->vsmt); /* We can live with that if the default one is big enough * for the number of threads, and a submultiple of the one * we want. In this case we'll waste some vcpu ids, but diff --git a/hw/vfio/migration-multifd.c b/hw/vfio/migration-multifd.c index e4785031a7..4a855f4e12 100644 --- a/hw/vfio/migration-multifd.c +++ b/hw/vfio/migration-multifd.c @@ -725,8 +725,9 @@ vfio_multifd_save_complete_precopy_thread(SaveCompleteP= recopyThreadData *d, data_size =3D read(migration->data_fd, &packet->data, migration->data_buffer_size); if (data_size < 0) { - error_setg(errp, "%s: reading state buffer %" PRIu32 " failed:= %d", - vbasedev->name, idx, errno); + error_setg_errno(errp, errno, + "%s: reading state buffer %" PRIu32 " failed", + vbasedev->name, idx); goto thread_exit; } else if (data_size =3D=3D 0) { break; diff --git a/migration/rdma.c b/migration/rdma.c index 337b415889..9e301cf917 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -2349,8 +2349,7 @@ static int qemu_get_cm_event_timeout(RDMAContext *rdm= a, error_setg(errp, "RDMA ERROR: poll cm event timeout"); return -1; } else if (ret < 0) { - error_setg(errp, "RDMA ERROR: failed to poll cm event, errno=3D%i", - errno); + error_setg_errno(errp, errno, "RDMA ERROR: failed to poll cm event= "); return -1; } else if (poll_fd.revents & POLLIN) { if (rdma_get_cm_event(rdma->channel, cm_event) < 0) { diff --git a/net/l2tpv3.c b/net/l2tpv3.c index cdfc641aa6..3044fa4608 100644 --- a/net/l2tpv3.c +++ b/net/l2tpv3.c @@ -639,13 +639,11 @@ int net_init_l2tpv3(const Netdev *netdev, } fd =3D socket(result->ai_family, result->ai_socktype, result->ai_proto= col); if (fd =3D=3D -1) { - fd =3D -errno; - error_setg(errp, "socket creation failed, errno =3D %d", - -fd); + error_setg_errno(errp, errno, "socket creation failed"); goto outerr; } if (bind(fd, (struct sockaddr *) result->ai_addr, result->ai_addrlen))= { - error_setg(errp, "could not bind socket err=3D%i", errno); + error_setg_errno(errp, errno, "could not bind socket"); goto outerr; } if (!qemu_set_blocking(fd, false, errp)) { diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 5d792563b9..99284abbc6 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -1996,8 +1996,8 @@ static bool kvm_cpu_realize(CPUState *cs, Error **err= p) if (riscv_has_ext(&cpu->env, RVV)) { ret =3D prctl(PR_RISCV_V_SET_CONTROL, PR_RISCV_V_VSTATE_CTRL_ON); if (ret) { - error_setg(errp, "Error in prctl PR_RISCV_V_SET_CONTROL, code:= %s", - strerrorname_np(errno)); + error_setg_errno(errp, errno, + "Error in prctl PR_RISCV_V_SET_CONTROL"); return false; } } @@ -2032,7 +2032,8 @@ void riscv_kvm_cpu_finalize_features(RISCVCPU *cpu, E= rror **errp) reg.addr =3D (uint64_t)&val; ret =3D ioctl(kvmcpu.cpufd, KVM_GET_ONE_REG, ®); if (ret !=3D 0) { - error_setg(errp, "Unable to read cbom_blocksize, error %d", er= rno); + error_setg(errp, errno, + "Unable to read cbom_blocksize"); return; } =20 @@ -2051,7 +2052,7 @@ void riscv_kvm_cpu_finalize_features(RISCVCPU *cpu, E= rror **errp) reg.addr =3D (uint64_t)&val; ret =3D ioctl(kvmcpu.cpufd, KVM_GET_ONE_REG, ®); if (ret !=3D 0) { - error_setg(errp, "Unable to read cboz_blocksize, error %d", er= rno); + error_setg_errno(errp, errno, "Unable to read cboz_blocksize"); return; } =20 @@ -2073,7 +2074,7 @@ void riscv_kvm_cpu_finalize_features(RISCVCPU *cpu, E= rror **errp) reg.addr =3D (uint64_t)&val; ret =3D ioctl(kvmcpu.cpufd, KVM_GET_ONE_REG, ®); if (ret !=3D 0) { - error_setg(errp, "Unable to read vlenb register, error %d", er= rno); + error_setg_errno(errp, errno, "Unable to read vlenb register"); return; } =20 --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792362; cv=none; d=zohomail.com; s=zohoarc; b=S835hqD4xOYkaMZwsSruckPNkjYdD7uVsqzfHV6Dmc4TpkykvQQqWb1myQOZy4SFjKSSqFaUKnY6654D/POhQdXUcsTXH4oJl9DLunSogSSDRl5jESDIix+le6tmY+y0jCI1onESzpfS67epGefrpKw+j0fwr9NMPblA4jmsguM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792362; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lfrf2Vh7y/59XVqNRaeDs87uvCGai5ZnCtsqsvw3gto=; b=nGQA1hqsmU1EkyNjj15AnjzP9kfueWRToDaoEUtyyqpIXAbZ68aSfLqlhg/NzkpgZCtTmFML44A1kgjTEqHAVzuKTr/XtaqTI/CMsxg4QD+gd55NFg+LTbnkIGkeffgK3KMCl5vvLFu8UCt4/FBItKSKw6/RVneXjciyKuclR4g= 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 1767792362815861.2253690624714; Wed, 7 Jan 2026 05:26:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTXi-0001Cb-1P; Wed, 07 Jan 2026 08:25:45 -0500 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 1vdTX7-0000y1-NQ for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:25:09 -0500 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 1vdTX5-0005g4-7m for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:25:05 -0500 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-296-LZHONa8fO1eFec2UWvzQwg-1; Wed, 07 Jan 2026 08:24:57 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0D9511956058; Wed, 7 Jan 2026 13:24:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8544C1800285; Wed, 7 Jan 2026 13:24:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5CF5821E6934; Wed, 07 Jan 2026 14:24:53 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6B5C321E61BF; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792302; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=lfrf2Vh7y/59XVqNRaeDs87uvCGai5ZnCtsqsvw3gto=; b=O/KKKlOeutjDGh8xRpJk/feGduVI+kypz/bwJx3rW/qub5GG4mF7OceTbyFAlEOPdJqfzQ 7pjv13j+oIV/u9hXte+/IIlqjfJ+wgbxt3nJzXR5hzZBBl9tgRPyJDQpp7X+m27C4MtI2H lTYfG7jh3rrkVm0EcCVllzu0PjcDAmE= X-MC-Unique: LZHONa8fO1eFec2UWvzQwg-1 X-Mimecast-MFC-AGG-ID: LZHONa8fO1eFec2UWvzQwg_1767792296 Resent-To: philmd@linaro.org, richard.henderson@linaro.org, qemu-devel@nongnu.org, jag.raman@oracle.com Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:24:53 +0100 Resent-Message-ID: <87pl7lh7x6.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 15/17] error: Use error_setg_errno() for simplicity and consistency Date: Wed, 7 Jan 2026 13:43:39 +0100 Message-ID: <20260107124341.1093312-16-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Lines: 428 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 (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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792363588158500 Use error_setg_errno() instead of passing the value of strerror() or g_strerror() to error_setg(). The separator between the error message proper and the value of strerror() changes from " : ", "", " - ", "- " to ": " in places. Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-14-armbru@redhat.com> Acked-by: Jagannathan Raman Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- backends/spdm-socket.c | 4 ++-- backends/tpm/tpm_emulator.c | 13 +++++-------- hw/9pfs/9p.c | 3 +-- hw/acpi/core.c | 3 +-- hw/intc/openpic_kvm.c | 3 +-- hw/intc/xics_kvm.c | 5 +++-- hw/remote/vfio-user-obj.c | 18 +++++++++--------- hw/sensor/emc141x.c | 4 ++-- hw/sensor/tmp421.c | 4 ++-- hw/smbios/smbios.c | 4 ++-- hw/virtio/vdpa-dev.c | 4 ++-- migration/postcopy-ram.c | 10 +++++----- net/slirp.c | 5 +++-- qga/commands-posix-ssh.c | 23 +++++++++++++---------- system/vl.c | 2 +- target/ppc/kvm.c | 5 ++--- 16 files changed, 54 insertions(+), 56 deletions(-) diff --git a/backends/spdm-socket.c b/backends/spdm-socket.c index bc5c7afb3c..b625a65d28 100644 --- a/backends/spdm-socket.c +++ b/backends/spdm-socket.c @@ -167,7 +167,7 @@ int spdm_socket_connect(uint16_t port, Error **errp) =20 client_socket =3D socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (client_socket < 0) { - error_setg(errp, "cannot create socket: %s", strerror(errno)); + error_setg_errno(errp, errno, "cannot create socket"); return -1; } =20 @@ -179,7 +179,7 @@ int spdm_socket_connect(uint16_t port, Error **errp) =20 if (connect(client_socket, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { - error_setg(errp, "cannot connect: %s", strerror(errno)); + error_setg_errno(errp, errno, "cannot connect"); close(client_socket); return -1; } diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c index f10b9074fb..f52cb4d435 100644 --- a/backends/tpm/tpm_emulator.c +++ b/backends/tpm/tpm_emulator.c @@ -225,8 +225,7 @@ static int tpm_emulator_set_locality(TPMEmulator *tpm_e= mu, uint8_t locty_number, if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_LOCALITY, &loc, sizeof(loc), sizeof(loc.u.resp.tpm_result), sizeof(loc)) < 0) { - error_setg(errp, "tpm-emulator: could not set locality : %s", - strerror(errno)); + error_setg_errno(errp, errno, "tpm-emulator: could not set localit= y"); return -1; } =20 @@ -315,8 +314,7 @@ static int tpm_emulator_stop_tpm(TPMBackend *tb, Error = **errp) =20 if (tpm_emulator_ctrlcmd(tpm_emu, CMD_STOP, &res, 0, sizeof(ptm_res), sizeof(res)) < 0) { - error_setg(errp, "tpm-emulator: Could not stop TPM: %s", - strerror(errno)); + error_setg_errno(errp, errno, "tpm-emulator: Could not stop TPM"); return -1; } =20 @@ -377,8 +375,8 @@ static int tpm_emulator_set_buffer_size(TPMBackend *tb, if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_BUFFERSIZE, &psbs, sizeof(psbs.u.req), sizeof(psbs.u.resp.tpm_re= sult), sizeof(psbs.u.resp)) < 0) { - error_setg(errp, "tpm-emulator: Could not set buffer size: %s", - strerror(errno)); + error_setg_errno(errp, errno, + "tpm-emulator: Could not set buffer size"); return -1; } =20 @@ -426,8 +424,7 @@ static int tpm_emulator_startup_tpm_resume(TPMBackend *= tb, size_t buffersize, if (tpm_emulator_ctrlcmd(tpm_emu, CMD_INIT, &init, sizeof(init), sizeof(init.u.resp.tpm_result), sizeof(init)) < 0) { - error_setg(errp, "tpm-emulator: could not send INIT: %s", - strerror(errno)); + error_setg_errno(errp, errno, "tpm-emulator: could not send INIT"); goto err_exit; } =20 diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index bc4a016ee3..6fbe604ce8 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -4345,8 +4345,7 @@ int v9fs_device_realize_common(V9fsState *s, const V9= fsTransport *t, * use co-routines here. */ if (s->ops->name_to_path(&s->ctx, NULL, "/", &path) < 0) { - error_setg(errp, - "error in converting name to path %s", strerror(errno)); + error_setg_errno(errp, errno, "error in converting name to path"); goto out; } if (s->ops->lstat(&s->ctx, &path, &stat)) { diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 4e030d8e3b..d9979b0da9 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -293,8 +293,7 @@ void acpi_table_add(const QemuOpts *opts, Error **errp) memcpy(blob + bloblen, data, r); bloblen +=3D r; } else if (errno !=3D EINTR) { - error_setg(errp, "can't read file %s: %s", *cur, - strerror(errno)); + error_setg_errno(errp, errno, "can't read file %s", *cur); close(fd); goto out; } diff --git a/hw/intc/openpic_kvm.c b/hw/intc/openpic_kvm.c index 9aafef5d9e..fbf0bdbe07 100644 --- a/hw/intc/openpic_kvm.c +++ b/hw/intc/openpic_kvm.c @@ -223,8 +223,7 @@ static void kvm_openpic_realize(DeviceState *dev, Error= **errp) cd.type =3D kvm_openpic_model; ret =3D kvm_vm_ioctl(s, KVM_CREATE_DEVICE, &cd); if (ret < 0) { - error_setg(errp, "Can't create device %d: %s", - cd.type, strerror(errno)); + error_setg_errno(errp, errno, "Can't create device %d", cd.type); return; } opp->fd =3D cd.fd; diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index ee72969f5f..61f66d1019 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -165,8 +165,9 @@ void icp_kvm_realize(DeviceState *dev, Error **errp) if (ret < 0) { Error *local_err =3D NULL; =20 - error_setg(&local_err, "Unable to connect CPU%ld to kernel XICS: %= s", - vcpu_id, strerror(errno)); + error_setg_errno(&local_err, errno, + "Unable to connect CPU%ld to kernel XICS", + vcpu_id); if (errno =3D=3D ENOSPC) { error_append_hint(&local_err, "Try -smp maxcpus=3DN with N < %= u\n", MACHINE(qdev_get_machine())->smp.max_cpus); diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 4eb036a546..12ecdab6de 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -751,7 +751,7 @@ static void vfu_object_init_ctx(VfuObject *o, Error **e= rrp) LIBVFIO_USER_FLAG_ATTACH_NB, o, VFU_DEV_TYPE_PCI); if (o->vfu_ctx =3D=3D NULL) { - error_setg(errp, "vfu: Failed to create context - %s", strerror(er= rno)); + error_setg_errno(errp, errno, "vfu: Failed to create context"); return; } =20 @@ -776,9 +776,9 @@ static void vfu_object_init_ctx(VfuObject *o, Error **e= rrp) =20 ret =3D vfu_pci_init(o->vfu_ctx, pci_type, PCI_HEADER_TYPE_NORMAL, 0); if (ret < 0) { - error_setg(errp, - "vfu: Failed to attach PCI device %s to context - %s", - o->device, strerror(errno)); + error_setg_errno(errp, errno, + "vfu: Failed to attach PCI device %s to context", + o->device); goto fail; } =20 @@ -792,9 +792,9 @@ static void vfu_object_init_ctx(VfuObject *o, Error **e= rrp) VFU_REGION_FLAG_RW | VFU_REGION_FLAG_ALWAYS_CB, NULL, 0, -1, 0); if (ret < 0) { - error_setg(errp, - "vfu: Failed to setup config space handlers for %s- %s", - o->device, strerror(errno)); + error_setg_errno(errp, errno, + "vfu: Failed to setup config space handlers for %= s", + o->device); goto fail; } =20 @@ -822,8 +822,8 @@ static void vfu_object_init_ctx(VfuObject *o, Error **e= rrp) =20 ret =3D vfu_realize_ctx(o->vfu_ctx); if (ret < 0) { - error_setg(errp, "vfu: Failed to realize device %s- %s", - o->device, strerror(errno)); + error_setg_errno(errp, errno, "vfu: Failed to realize device %s", + o->device); goto fail; } =20 diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c index 7b2ce383a1..a51fc44395 100644 --- a/hw/sensor/emc141x.c +++ b/hw/sensor/emc141x.c @@ -59,7 +59,7 @@ static void emc141x_get_temperature(Object *obj, Visitor = *v, const char *name, unsigned tempid; =20 if (sscanf(name, "temperature%u", &tempid) !=3D 1) { - error_setg(errp, "error reading %s: %s", name, g_strerror(errno)); + error_setg_errno(errp, errno, "error reading %s", name); return; } =20 @@ -86,7 +86,7 @@ static void emc141x_set_temperature(Object *obj, Visitor = *v, const char *name, } =20 if (sscanf(name, "temperature%u", &tempid) !=3D 1) { - error_setg(errp, "error reading %s: %s", name, g_strerror(errno)); + error_setg_errno(errp, errno, "error reading %s", name); return; } =20 diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c index 3421c44086..127edd0ba5 100644 --- a/hw/sensor/tmp421.c +++ b/hw/sensor/tmp421.c @@ -117,7 +117,7 @@ static void tmp421_get_temperature(Object *obj, Visitor= *v, const char *name, int tempid; =20 if (sscanf(name, "temperature%d", &tempid) !=3D 1) { - error_setg(errp, "error reading %s: %s", name, g_strerror(errno)); + error_setg_errno(errp, errno, "error reading %s", name); return; } =20 @@ -154,7 +154,7 @@ static void tmp421_set_temperature(Object *obj, Visitor= *v, const char *name, } =20 if (sscanf(name, "temperature%d", &tempid) !=3D 1) { - error_setg(errp, "error reading %s: %s", name, g_strerror(errno)); + error_setg_errno(errp, errno, "error reading %s", name); return; } =20 diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index be97a5effc..7d7141851b 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -1281,8 +1281,8 @@ static int save_opt_one(void *opaque, break; } if (ret < 0) { - error_setg(errp, "Unable to read from %s: %s", - value, strerror(errno)); + error_setg_errno(errp, errno, "Unable to read from %s", + value); qemu_close(fd); return -1; } diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index f2377d2d50..4532d63653 100644 --- a/hw/virtio/vdpa-dev.c +++ b/hw/virtio/vdpa-dev.c @@ -41,8 +41,8 @@ vhost_vdpa_device_get_u32(int fd, unsigned long int cmd, = Error **errp) uint32_t val =3D (uint32_t)-1; =20 if (ioctl(fd, cmd, &val) < 0) { - error_setg(errp, "vhost-vdpa-device: cmd 0x%lx failed: %s", - cmd, strerror(errno)); + error_setg_errno(errp, errno, "vhost-vdpa-device: cmd 0x%lx failed= ", + cmd); } =20 return val; diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 98a98138be..ac410676ef 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -582,7 +582,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingSt= ate *mis, Error **errp) =20 ufd =3D uffd_open(O_CLOEXEC); if (ufd =3D=3D -1) { - error_setg(errp, "Userfaultfd not available: %s", strerror(errno)); + error_setg_errno(errp, errno, "Userfaultfd not available"); goto out; } =20 @@ -620,7 +620,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingSt= ate *mis, Error **errp) * it was enabled. */ if (munlockall()) { - error_setg(errp, "munlockall() failed: %s", strerror(errno)); + error_setg_errno(errp, errno, "munlockall() failed"); goto out; } =20 @@ -632,7 +632,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingSt= ate *mis, Error **errp) testarea =3D mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (testarea =3D=3D MAP_FAILED) { - error_setg(errp, "Failed to map test area: %s", strerror(errno)); + error_setg_errno(errp, errno, "Failed to map test area"); goto out; } g_assert(QEMU_PTR_IS_ALIGNED(testarea, pagesize)); @@ -642,14 +642,14 @@ bool postcopy_ram_supported_by_host(MigrationIncoming= State *mis, Error **errp) reg_struct.mode =3D UFFDIO_REGISTER_MODE_MISSING; =20 if (ioctl(ufd, UFFDIO_REGISTER, ®_struct)) { - error_setg(errp, "UFFDIO_REGISTER failed: %s", strerror(errno)); + error_setg_errno(errp, errno, "UFFDIO_REGISTER failed"); goto out; } =20 range_struct.start =3D (uintptr_t)testarea; range_struct.len =3D pagesize; if (ioctl(ufd, UFFDIO_UNREGISTER, &range_struct)) { - error_setg(errp, "UFFDIO_UNREGISTER failed: %s", strerror(errno)); + error_setg_errno(errp, errno, "UFFDIO_UNREGISTER failed"); goto out; } =20 diff --git a/net/slirp.c b/net/slirp.c index 5996fec512..04925f3318 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -1020,8 +1020,9 @@ static int slirp_smb(SlirpState* s, const char *expor= ted_dir, } =20 if (access(exported_dir, R_OK | X_OK)) { - error_setg(errp, "Error accessing shared directory '%s': %s", - exported_dir, strerror(errno)); + error_setg_errno(errp, errno, + "Error accessing shared directory '%s'", + exported_dir); return -1; } =20 diff --git a/qga/commands-posix-ssh.c b/qga/commands-posix-ssh.c index 246171d323..661972e34e 100644 --- a/qga/commands-posix-ssh.c +++ b/qga/commands-posix-ssh.c @@ -61,20 +61,22 @@ mkdir_for_user(const char *path, const struct passwd *p, mode_t mode, Error **errp) { if (g_mkdir(path, mode) =3D=3D -1) { - error_setg(errp, "failed to create directory '%s': %s", - path, g_strerror(errno)); + error_setg_errno(errp, errno, "failed to create directory '%s'", + path); return false; } =20 if (chown(path, p->pw_uid, p->pw_gid) =3D=3D -1) { - error_setg(errp, "failed to set ownership of directory '%s': %s", - path, g_strerror(errno)); + error_setg_errno(errp, errno, + "failed to set ownership of directory '%s'", + path); return false; } =20 if (chmod(path, mode) =3D=3D -1) { - error_setg(errp, "failed to set permissions of directory '%s': %s", - path, g_strerror(errno)); + error_setg_errno(errp, errno, + "failed to set permissions of directory '%s'", + path); return false; } =20 @@ -95,14 +97,15 @@ write_authkeys(const char *path, const GStrv keys, } =20 if (chown(path, p->pw_uid, p->pw_gid) =3D=3D -1) { - error_setg(errp, "failed to set ownership of directory '%s': %s", - path, g_strerror(errno)); + error_setg_errno(errp, errno, + "failed to set ownership of directory '%s'", + path); return false; } =20 if (chmod(path, 0600) =3D=3D -1) { - error_setg(errp, "failed to set permissions of '%s': %s", - path, g_strerror(errno)); + error_setg_errno(errp, errno, "failed to set permissions of '%s'", + path); return false; } =20 diff --git a/system/vl.c b/system/vl.c index b60b883050..aa9a155041 100644 --- a/system/vl.c +++ b/system/vl.c @@ -618,7 +618,7 @@ static int parse_add_fd(void *opaque, QemuOpts *opts, E= rror **errp) } #endif if (dupfd =3D=3D -1) { - error_setg(errp, "error duplicating fd: %s", strerror(errno)); + error_setg_errno(errp, errno, "error duplicating fd"); return -1; } =20 diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 3b2f1077da..1521787b3f 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -2699,9 +2699,8 @@ int kvmppc_get_htab_fd(bool write, uint64_t index, Er= ror **errp) =20 ret =3D kvm_vm_ioctl(kvm_state, KVM_PPC_GET_HTAB_FD, &s); if (ret < 0) { - error_setg(errp, "Unable to open fd for %s HPT %s KVM: %s", - write ? "writing" : "reading", write ? "to" : "from", - strerror(errno)); + error_setg_errno(errp, errno, "Unable to open fd for %s HPT %s KVM= ", + write ? "writing" : "reading", write ? "to" : "from"); return -errno; } =20 --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792363; cv=none; d=zohomail.com; s=zohoarc; b=YDXCalFoDUsEeWFE0tQi5of2FxoQzdexAsW5cVYHdrq8NIJ6JRztsXF4E0wr/Y2lEfxFpajB2fOgakPWllGgIdDjqVYaLCtXAbvWUpGbzAQfJ5asVAjFzq4szhJslJ6a5RaajgilVqJOueZmirlzpzvVmAn2Bgvl/h4qAFVS1q0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792363; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LQtRUV903LPCNVI5wTzSTshNcU6NvgG8VOOQh3qtDJM=; b=iEHWoU9FXgE1yZRoqOv/lGPXfcV8gmcVBwe/esw/fZNxo8EbImm8B47GyFi8jELF3I7haK8MpTIOEilL/bQvWkubHI9Q6O5eHa0q9vAtdMZ75pSINkDf4DNtq74Gm6sAD/6wvUXrdOeCMLdza7Fh/esHTTtMhGg4BrR2uWc/pRo= 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 1767792363577725.6032438841319; Wed, 7 Jan 2026 05:26:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTXz-0001Uk-Mh; Wed, 07 Jan 2026 08:25:59 -0500 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 1vdTXH-00017l-TK for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:25:18 -0500 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 1vdTXG-00062a-8U for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:25:15 -0500 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-587-vNoycAzWOQCeqFn5tUMsNg-1; Wed, 07 Jan 2026 08:25:10 -0500 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 45E40180045C; Wed, 7 Jan 2026 13:25:09 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 03A191956048; Wed, 7 Jan 2026 13:25:09 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DB99021E6934; Wed, 07 Jan 2026 14:25:06 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6F46021E6143; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792313; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=LQtRUV903LPCNVI5wTzSTshNcU6NvgG8VOOQh3qtDJM=; b=XfgywkhyNyd5SUCmUnSrVawuUu3qUlmLeC6X4+OU8iNlBO21hDDWZCTGMlw52d6srG95x9 /VDdCD4bhie1SVYdIpQgPbcUz+d8HREf5rrcdOLjCrIQmo+9GX+Njt8JcK3IdUuFVrXe+S wlv4GkixjiYtMq/uAOx2+EcIojOYkkw= X-MC-Unique: vNoycAzWOQCeqFn5tUMsNg-1 X-Mimecast-MFC-AGG-ID: vNoycAzWOQCeqFn5tUMsNg_1767792309 Resent-To: philmd@linaro.org, richard.henderson@linaro.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:25:06 +0100 Resent-Message-ID: <87ldi9h7wt.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Kostiantyn Kostiuk , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 16/17] qga/commands-win32: Use error_setg_win32() for better error messages Date: Wed, 7 Jan 2026 13:43:40 +0100 Message-ID: <20260107124341.1093312-17-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Lines: 64 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 (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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792365613158500 We include numeric GetLastError() codes in error messages in a few places, like this: error_setg(errp, "GRIPE: %d", (int)GetLastError()); Show text instead, like this: error_setg_win32(errp, GetLastError(), "GRIPE"); Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-15-armbru@redhat.com> Reviewed-by: Kostiantyn Kostiuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- qga/commands-win32.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index acc2c11589..0fd0c966e4 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -1798,8 +1798,8 @@ void qmp_guest_set_time(bool has_time, int64_t time_n= s, Error **errp) tf.dwHighDateTime =3D (DWORD) (time >> 32); =20 if (!FileTimeToSystemTime(&tf, &ts)) { - error_setg(errp, "Failed to convert system time %d", - (int)GetLastError()); + error_setg_win32(errp, GetLastError(), + "Failed to convert system time"); return; } =20 @@ -1810,7 +1810,8 @@ void qmp_guest_set_time(bool has_time, int64_t time_n= s, Error **errp) } =20 if (!SetSystemTime(&ts)) { - error_setg(errp, "Failed to set time to guest: %d", (int)GetLastEr= ror()); + error_setg_win32(errp, GetLastError(), + "Failed to set time to guest"); return; } } @@ -1834,13 +1835,12 @@ GuestLogicalProcessorList *qmp_guest_get_vcpus(Erro= r **errp) (length > sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION))) { ptr =3D pslpi =3D g_malloc0(length); if (GetLogicalProcessorInformation(pslpi, &length) =3D=3D FALSE) { - error_setg(&local_err, "Failed to get processor information: %= d", - (int)GetLastError()); + error_setg_win32(&local_err, GetLastError(), + "Failed to get processor information"); } } else { - error_setg(&local_err, - "Failed to get processor information buffer length: %d", - (int)GetLastError()); + error_setg_win32(&local_err, GetLastError(), + "Failed to get processor information buffer lengt= h"); } =20 while ((local_err =3D=3D NULL) && (length > 0)) { --=20 2.52.0 From nobody Sat Feb 7 08:45:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767792395; cv=none; d=zohomail.com; s=zohoarc; b=NDWrMHeR3Yb4jIIhbwkt+Zx5/o09KPfXA1/zXX6hrFQgj2e0mp/vvY9tYdLmOFVNdb5Ffv7jjXEPopvryQq8LS/eUEUo+JiGU7PA12V1DVq80iBuEDhw+z1ZZy/SEVNwGALTCBkhJi1ZWt+zKorMSBHcpqi2stUHWCM+vo5XkVU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767792395; 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:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jBdzRkZameKTVyrA0KTWn3oMxDovyCVEyuheC2ocBx0=; b=WAmN6i7GX/FaiJNB95DVM/YynO1MMoug+RnnD+JJ3W34KUSkrUHhHUdQ5im08uQEPAvW+Kqo1yAQB83q67prg9bHQheoeWfRc3i8Nu3kbGdvaWqDHHcR1o48u1KaNufK1+Jfl9rceswhwZFOhUKk6JHwtvhggtGC+9CoDFGGhFQ= 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 1767792395265257.2498306472868; Wed, 7 Jan 2026 05:26:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdTY3-0001h2-1e; Wed, 07 Jan 2026 08:26:03 -0500 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 1vdTXO-00018p-1a for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:25:26 -0500 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 1vdTXM-00063B-G3 for qemu-devel@nongnu.org; Wed, 07 Jan 2026 08:25:21 -0500 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-184-vwhyWA10NjyDM-c3EwYObA-1; Wed, 07 Jan 2026 08:25:16 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B861D195608D; Wed, 7 Jan 2026 13:25:15 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 77048180066A; Wed, 7 Jan 2026 13:25:15 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 40F0B21E6934; Wed, 07 Jan 2026 14:25:13 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 732A721E614A; Wed, 07 Jan 2026 13:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767792320; 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:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=jBdzRkZameKTVyrA0KTWn3oMxDovyCVEyuheC2ocBx0=; b=ASSinr8+P91a9GLesxbsKoXB3y58i5UrJOw8g4UAN1EBdm4OQ+AiFzyRb4+vt/sHsG3aJ2 /yEp/3PxFABMPGpTd+xpw3NqukwU3xWXQo4rAaf6lxZetr4tTaQucZW0kw5TSemwWI4hjq bjBFmqM93VQB91QpjcCJnse7d2FLqTQ= X-MC-Unique: vwhyWA10NjyDM-c3EwYObA-1 X-Mimecast-MFC-AGG-ID: vwhyWA10NjyDM-c3EwYObA_1767792315 Resent-To: philmd@linaro.org, richard.henderson@linaro.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Wed, 07 Jan 2026 14:25:13 +0100 Resent-Message-ID: <87h5sxh7wm.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Wed Jan 7 13:43:41 2026 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 17/17] block/file-win32: Improve an error message Date: Wed, 7 Jan 2026 13:43:41 +0100 Message-ID: <20260107124341.1093312-18-armbru@redhat.com> In-Reply-To: <20260107124341.1093312-1-armbru@redhat.com> References: <20260107124341.1093312-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Lines: 29 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 (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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1767792395567158501 Two out of three calls of CreateFile() use error_setg_win32() to report errors. The third uses error_setg_errno(), mapping ERROR_ACCESS_DENIED to EACCES, and everything else to EINVAL, throwing away detail. Switch it to error_setg_win32(). Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-16-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- block/file-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-win32.c b/block/file-win32.c index b00039bf94..b63ce1c189 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -872,7 +872,7 @@ static int hdev_open(BlockDriverState *bs, QDict *optio= ns, int flags, } else { ret =3D -EINVAL; } - error_setg_errno(errp, -ret, "Could not open device"); + error_setg_win32(errp, err, "Could not open device"); goto done; } =20 --=20 2.52.0