[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/36] block: fix NetBSD qemu-iotests failure
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 08/36] block: fix NetBSD qemu-iotests failure |
Date: |
Tue, 20 Aug 2019 08:59:27 +0200 |
Opening a block device on NetBSD has an additional step compared to other OSes,
corresponding to raw_normalize_devicepath. The error message in that function
is slightly different from that in raw_open_common and this was causing spurious
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 message
contains the fairly unequivocal "No such file or directory" text from strerror.
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 <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
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 **filename,
Error **errp)
fname = *filename;
dp = 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;
}
@@ -547,7 +547,7 @@ static int raw_open_common(BlockDriverState *bs, QDict
*options,
ret = fd < 0 ? -errno : 0;
if (ret < 0) {
- error_setg_errno(errp, -ret, "Could not open '%s'", filename);
+ error_setg_file_open(errp, -ret, filename);
if (ret == -EROFS) {
ret = -EACCES;
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/36] QEMU patches for 2018-08-20, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 01/36] kvm: i386: halt poll control MSR support, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 02/36] target-i386: adds PV_SCHED_YIELD CPUID feature bit, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 03/36] loader: Handle memory-mapped ELFs, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 04/36] elf-ops.h: Map into memory the ELF to load, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 05/36] hw/i386/pc: Map into memory the initrd, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 07/36] configure: Define target access alignment in configure, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 06/36] memory: assert on out of scope notification, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 08/36] block: fix NetBSD qemu-iotests failure,
Paolo Bonzini <=
- [Qemu-devel] [PULL 10/36] target-i386: kvm: 'kvm_get_supported_msrs' cleanup, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 11/36] test-throttle: Fix uninitialized use of burst_length, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 09/36] 9p: simplify source file selection, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 13/36] i386/kvm: initialize struct at full before ioctl call, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 21/36] replay: add missing fix for internal function, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 24/36] replay: fix replay shutdown, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 22/36] replay: document development rules, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 30/36] cpus-common: assert BQL nesting within cpu-exclusive sections, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 31/36] kvm: vmxcap: Enhance with latest features, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 16/36] mc146818rtc: Remove reset notifiers, Paolo Bonzini, 2019/08/20