All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>, "Max Reitz" <mreitz@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [PATCH v3 4/4] block: switch to use qemu_open/qemu_create for improved errors
Date: Mon, 27 Jul 2020 09:43:06 +0200	[thread overview]
Message-ID: <875za9769h.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20200724132510.3250311-5-berrange@redhat.com> ("Daniel P. Berrangé"'s message of "Fri, 24 Jul 2020 14:25:10 +0100")

Daniel P. Berrangé <berrange@redhat.com> writes:

> 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"
>   }
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Subject promises slightly more than the patch actually provides:

    block/vvfat.c:1355:        int fd = qemu_open(mapping->path, O_RDONLY | O_BINARY | O_LARGEFILE);
    block/vvfat.c:2516:    fd = qemu_open(mapping->path, O_RDWR | O_CREAT | O_BINARY, 0666);

If you'd rather not touch block/vvfat.c (I understand), consider
tweaking the subject to say

    block/file: ...



      parent reply	other threads:[~2020-07-27  7:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 13:25 [PATCH v3 0/4] block: improve error reporting for unsupported O_DIRECT Daniel P. Berrangé
2020-07-24 13:25 ` [PATCH v3 1/4] util: rename qemu_open() to qemu_open_old() Daniel P. Berrangé
2020-07-24 13:54   ` Eric Blake
2020-07-24 14:24   ` Philippe Mathieu-Daudé
2020-07-24 13:25 ` [PATCH v3 2/4] util: introduce qemu_open and qemu_create with error reporting Daniel P. Berrangé
2020-07-24 14:02   ` Eric Blake
2020-07-24 14:33   ` Philippe Mathieu-Daudé
2020-07-27  7:37   ` Markus Armbruster
2020-07-24 13:25 ` [PATCH v3 3/4] util: give a specific error message when O_DIRECT doesn't work Daniel P. Berrangé
2020-07-24 14:05   ` Eric Blake
2020-07-24 13:25 ` [PATCH v3 4/4] block: switch to use qemu_open/qemu_create for improved errors Daniel P. Berrangé
2020-07-24 14:10   ` Eric Blake
2020-07-24 14:26     ` Daniel P. Berrangé
2020-07-24 14:37   ` Philippe Mathieu-Daudé
2020-07-27  7:43   ` Markus Armbruster [this message]

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=875za9769h.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.