[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 0/3] block: improve error reporting for unsupported O_DIRECT
From: |
Daniel P . Berrangé |
Subject: |
[PATCH 0/3] block: improve error reporting for unsupported O_DIRECT |
Date: |
Wed, 1 Jul 2020 17:05:06 +0100 |
To repeat the commit message from patch 3...
Currently at startup if using cache=none on a filesystem lacking
O_DIRECT such as tmpfs, at startup QEMU prints
qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: file system may not
support O_DIRECT
qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: Could not open
'/tmp/foo.img': Invalid argument
while at QMP level the hint is missing, so QEMU reports just
"error": {
"class": "GenericError",
"desc": "Could not open '/tmp/foo.img': Invalid argument"
}
which is close to useless for the end user trying to figure out what
they did wrong
With this change at startup QEMU prints
qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: Unable to open
'/tmp/foo.img' flags 0x4000: filesystem does not support O_DIRECT
while at the QMP level QEMU reports a massively more informative
"error": {
"class": "GenericError",
"desc": "Unable to open '/tmp/foo.img' flags 0x4002: filesystem does not
support O_DIRECT"
}
qemu_open is used in many more places besides block layer, but
converting those to qemu_open_err is left as an exercise for
other maintainers.
Daniel P. Berrangé (3):
util: validate whether O_DIRECT is supported after failure
util: support detailed error reporting for qemu_open
block: switch to use qemu_open_err for improved errors
block/file-posix.c | 10 +++----
include/qemu/osdep.h | 1 +
util/osdep.c | 70 ++++++++++++++++++++++++++++++++++++++------
3 files changed, 66 insertions(+), 15 deletions(-)
--
2.26.2
- [PATCH 0/3] block: improve error reporting for unsupported O_DIRECT,
Daniel P . Berrangé <=