From nobody Sun Dec 14 11:16:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1763727325; cv=none; d=zohomail.com; s=zohoarc; b=fO14cZWZjAQ/7tseVamcy5MG1djnIo28nGbUHacVFhxyE7utmgginVafDvaYphXEApUPyeOWi9IEzOIUZX0uOhSR8vA2MrP7scTUqv5vhatoSOApJleSdlP2khpOAcKUQ8gF7PypTT58q+fxNWKVcmb9RwNRqADlIeaV+XpbLc4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763727325; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ntoFJE6ZYqJ4DvoW2xAiFU9EOotBPF/P3xBSz1dTmbg=; b=kbhr5zHM3LYUZ4D8QIUksYuXZkSyPqPjOxB2Auc98Qi5XTf+4I2sYIe8dYct2JDPCAeMujnwZ+fNHYXJBAFrWci7xJBxAtju7VeKfxyUq4Wi7CxjBnW7Cc/7GTCnkgT9hD2A2F7PDBK2Sw9boSBUuowOfz0nCrYImzb2dKvBQZY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 176372732558559.22022151965143; Fri, 21 Nov 2025 04:15:25 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1168987.1494854 (Exim 4.92) (envelope-from ) id 1vMQ2S-0001I4-Os; Fri, 21 Nov 2025 12:14:56 +0000 Received: by outflank-mailman (output) from mailman id 1168987.1494854; Fri, 21 Nov 2025 12:14:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vMQ2S-0001HN-HF; Fri, 21 Nov 2025 12:14:56 +0000 Received: by outflank-mailman (input) for mailman id 1168987; Fri, 21 Nov 2025 12:14:55 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vMQ2R-000110-5i for xen-devel@lists.xenproject.org; Fri, 21 Nov 2025 12:14:55 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ae9a15c8-c6d3-11f0-980a-7dc792cee155; Fri, 21 Nov 2025 13:14:52 +0100 (CET) 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-563-_S2sFyzUNkyrsijPiS4IYQ-1; Fri, 21 Nov 2025 07:14:48 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 29D471954B11; Fri, 21 Nov 2025 12:14:43 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 010191940E88; Fri, 21 Nov 2025 12:14:41 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 89C0021E6741; Fri, 21 Nov 2025 13:14:38 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ae9a15c8-c6d3-11f0-980a-7dc792cee155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763727291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ntoFJE6ZYqJ4DvoW2xAiFU9EOotBPF/P3xBSz1dTmbg=; b=bOlYG1dXNZsSCeE6JNxyx3UPQSobJnD9LKSlFNeuKnGjUnRcNdmlnzvLhTVqDnH21+tMXb fcjmzsuUhetXFNBSvulc7bQdArSHrydqK4DKmv6xwCzgqk66puAnUNFbflaovsQbsohvjR 7j63LBwekxjSa7Q1Yma8fcb73K5/Yk0= X-MC-Unique: _S2sFyzUNkyrsijPiS4IYQ-1 X-Mimecast-MFC-AGG-ID: _S2sFyzUNkyrsijPiS4IYQ_1763727283 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: arei.gonglei@huawei.com, zhenwei.pi@linux.dev, alistair.francis@wdc.com, stefanb@linux.vnet.ibm.com, kwolf@redhat.com, hreitz@redhat.com, sw@weilnetz.de, qemu_oss@crudebyte.com, groug@kaod.org, mst@redhat.com, imammedo@redhat.com, anisinha@redhat.com, kraxel@redhat.com, shentey@gmail.com, npiggin@gmail.com, harshpb@linux.ibm.com, sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, edgar.iglesias@gmail.com, elena.ufimtseva@oracle.com, jag.raman@oracle.com, sgarzare@redhat.com, pbonzini@redhat.com, fam@euphon.net, philmd@linaro.org, alex@shazbot.org, clg@redhat.com, peterx@redhat.com, farosas@suse.de, lizhijian@fujitsu.com, dave@treblig.org, jasowang@redhat.com, samuel.thibault@ens-lyon.org, michael.roth@amd.com, kkostiuk@redhat.com, zhao1.liu@intel.com, mtosatti@redhat.com, rathc@linux.ibm.com, palmer@dabbelt.com, liwei1518@gmail.com, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, marcandre.lureau@redhat.com, qemu-block@nongnu.org, qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, qemu-riscv@nongnu.org Subject: [PATCH v2 02/15] hw/usb: Convert to qemu_create() for a better error message Date: Fri, 21 Nov 2025 13:14:25 +0100 Message-ID: <20251121121438.1249498-3-armbru@redhat.com> In-Reply-To: <20251121121438.1249498-1-armbru@redhat.com> References: <20251121121438.1249498-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1763727327666018900 Content-Type: text/plain; charset="utf-8" The error message changes from open FILENAME failed to Could not create 'FILENAME': REASON where REASON is the value of strerror(errno). Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/usb/bus.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 8dd2ce415e..714e33989f 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -259,10 +259,9 @@ static void usb_qdev_realize(DeviceState *qdev, Error = **errp) } =20 if (dev->pcap_filename) { - int fd =3D qemu_open_old(dev->pcap_filename, - O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 06= 66); + int fd =3D qemu_create(dev->pcap_filename, + O_WRONLY | O_TRUNC | O_BINARY, 0666, errp); if (fd < 0) { - error_setg(errp, "open %s failed", dev->pcap_filename); usb_qdev_unrealize(qdev); return; } --=20 2.49.0