From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>, "P J P" <ppandit@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
qemu-block@nongnu.org, "Max Reitz" <mreitz@redhat.com>
Subject: [PATCH 0/3] block: improve error reporting for unsupported O_DIRECT
Date: Wed, 1 Jul 2020 17:05:06 +0100 [thread overview]
Message-ID: <20200701160509.1523847-1-berrange@redhat.com> (raw)
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
next reply other threads:[~2020-07-01 16:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 16:05 Daniel P. Berrangé [this message]
2020-07-01 16:05 ` [PATCH 1/3] util: validate whether O_DIRECT is supported after failure Daniel P. Berrangé
2020-07-02 10:10 ` Philippe Mathieu-Daudé
2020-07-01 16:05 ` [PATCH 2/3] util: support detailed error reporting for qemu_open Daniel P. Berrangé
2020-07-02 5:13 ` Markus Armbruster
2020-07-02 9:30 ` Daniel P. Berrangé
2020-07-01 16:05 ` [PATCH 3/3] block: switch to use qemu_open_err for improved errors Daniel P. Berrangé
2020-07-01 16:58 ` [PATCH 0/3] block: improve error reporting for unsupported O_DIRECT no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200701160509.1523847-1-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=ppandit@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).