From nobody Mon Feb 9 17:59:23 2026 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=1566284606; cv=none; d=zoho.com; s=zohoarc; b=P/Nyg3oahaAnSLRweRIV+IR574DaxEHnf+oAUyP1rdmR5+z7EBvd+NFf5bDTl4xqe/u2rXrkqz2L4qG9eNgq3uKn7XGh2El3OvU/1bDgiHXLQWkhB7jmSr6dfvjiMkFrp6FOR6iNh0K7kxyl4YRU6sxIlc/CZjGZf6InKst+QRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566284606; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=OJDyPbNZhzg5ufpgfm9e2paeVZGFdouQFYAjzO2Gg24=; b=iD4viKZMNQCHw83mMTtwL+khyzr4rXjIuYUBLATJBiTLK9BXBZwZX6f0A3jh/rJ1CWd8SEldkmuQTu+XpAm8W1LCCIuh3xV2sAtAXxZtWYCdzf731lu39tegyCaLxMyrxODnGmvHUsJQnf3kklPVTon79lut1VKOnIujkNrf0s0= 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 1566284606656999.3108903287854; Tue, 20 Aug 2019 00:03:26 -0700 (PDT) Received: from localhost ([::1]:33794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzyAt-0007Xq-D5 for importer@patchew.org; Tue, 20 Aug 2019 03:03:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42509) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzy8D-0005Qp-CE for qemu-devel@nongnu.org; Tue, 20 Aug 2019 03:00:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzy88-00031k-GB for qemu-devel@nongnu.org; Tue, 20 Aug 2019 03:00:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38678) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzy88-00031I-Aa for qemu-devel@nongnu.org; Tue, 20 Aug 2019 03:00:32 -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 9DFB1309174E for ; Tue, 20 Aug 2019 07:00:31 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-20.ams2.redhat.com [10.36.112.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id D76359F70 for ; Tue, 20 Aug 2019 07:00:30 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 20 Aug 2019 08:59:27 +0200 Message-Id: <1566284395-30287-9-git-send-email-pbonzini@redhat.com> In-Reply-To: <1566284395-30287-1-git-send-email-pbonzini@redhat.com> References: <1566284395-30287-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 20 Aug 2019 07:00:31 +0000 (UTC) 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 08/36] 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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. Tested-by: Thomas Huth Signed-off-by: Paolo Bonzini --- 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 4479cc7..da1fde1 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 @@ -547,7 +547,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 1.8.3.1