qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] block: improve error reporting for unsupported O_DIRECT
@ 2020-07-01 16:05 Daniel P. Berrangé
  2020-07-01 16:05 ` [PATCH 1/3] util: validate whether O_DIRECT is supported after failure Daniel P. Berrangé
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Daniel P. Berrangé @ 2020-07-01 16:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, P J P, Daniel P. Berrangé, qemu-block, Max Reitz

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




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-02 10:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-01 16:05 [PATCH 0/3] block: improve error reporting for unsupported O_DIRECT Daniel P. Berrangé
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

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).