From nobody Tue Nov 11 22:37:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566032170; cv=none; d=zoho.com; s=zohoarc; b=ia1xIMXOsygIc2Y8v0EVjOWVYRPoCAvIlQss6fiJ17vBhp8T8Fwod8VBDMk9DVaa7XKW+53xai44UJTiabYUFo0P0AFvJlRmVjYQWFGRt5JTUPtLFCn9JtJY8R6UI+E+jMWRNn4PWZXTgxU6YCfTq75bcmxTVIS9boZRNIgCoo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566032170; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Btd8Is41IpC8jCtrBq/HpHz8Na2D7KwrXaDA1nb5n0s=; b=bRsqhA4hSNKoWqdeQuiD7tx+0/NyAWTn6JxwBEX+qfqVz+hQD/f8K7/19gKMVX9vnjt2vQKyhdbyWi/HNnenH45eMl57j1Wtc7izsp57lSbAayKA9VZ/TNvKdDl3FmQUOVNhFh5wy9Vj20RuRuO8xdcFZ4TpKv2HLfev8oCCk8w= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566032170076127.07853298203293; Sat, 17 Aug 2019 01:56:10 -0700 (PDT) Received: from localhost ([::1]:35016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyuVM-0002S4-Qq for importer@patchew.org; Sat, 17 Aug 2019 04:56:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49079) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyuUA-0001BW-An for qemu-devel@nongnu.org; Sat, 17 Aug 2019 04:54:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyuU9-0006rU-AF for qemu-devel@nongnu.org; Sat, 17 Aug 2019 04:54:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45214) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hyuU7-0006pt-1E; Sat, 17 Aug 2019 04:54:51 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5DC70189DACA; Sat, 17 Aug 2019 08:54:50 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B163A4FAB; Sat, 17 Aug 2019 08:54:48 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sat, 17 Aug 2019 10:54:41 +0200 Message-Id: <20190817085443.11471-2-thuth@redhat.com> In-Reply-To: <20190817085443.11471-1-thuth@redhat.com> References: <20190817085443.11471-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Sat, 17 Aug 2019 08:54:50 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/3] block: fix NetBSD qemu-iotests failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Opening a block device on NetBSD has an additional step compared to other O= Ses, corresponding to raw_normalize_devicepath. The error message in that funct= ion is slightly different from that in raw_open_common and this was causing spu= rious failures in qemu-iotests. However, in general it is not important to know = what exact step was failing, for example in the qemu-iotests case the error mess= age contains the fairly unequivocal "No such file or directory" text from strer= ror. We can thus fix the failures by standardizing on a single error message for both raw_open_common and raw_normalize_devicepath; in fact, we can even use error_setg_file_open to make sure the error message is the same as in the rest of QEMU. Message-Id: <20190725095920.28419-1-pbonzini@redhat.com> Tested-by: Thomas Huth Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- block/file-posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index b8b4dad553..e41e91e075 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -217,7 +217,7 @@ static int raw_normalize_devicepath(const char **filena= me, Error **errp) fname =3D *filename; dp =3D strrchr(fname, '/'); if (lstat(fname, &sb) < 0) { - error_setg_errno(errp, errno, "%s: stat failed", fname); + error_setg_file_open(errp, errno, fname); return -errno; } =20 @@ -561,7 +561,7 @@ static int raw_open_common(BlockDriverState *bs, QDict = *options, ret =3D fd < 0 ? -errno : 0; =20 if (ret < 0) { - error_setg_errno(errp, -ret, "Could not open '%s'", filename); + error_setg_file_open(errp, -ret, filename); if (ret =3D=3D -EROFS) { ret =3D -EACCES; } --=20 2.18.1