From: Maxim Levitsky <mlevitsk@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
Michael Tokarev <mjt@tls.msk.ru>,
Laurent Vivier <laurent@vivier.eu>,
qemu-trivial@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH 2/2] qemu-img: better error message when opening a backing file fails
Date: Mon, 22 Jul 2019 12:46:24 +0300 [thread overview]
Message-ID: <a8979dcc4affa9adc50c54e9c1b640dee3d09b83.camel@redhat.com> (raw)
In-Reply-To: <20190722094103.GA6583@localhost.localdomain>
On Mon, 2019-07-22 at 11:41 +0200, Kevin Wolf wrote:
> Am 21.07.2019 um 20:15 hat Maxim Levitsky geschrieben:
> > Currently we print message like that:
> >
> > "
> > new_file.qcow2 : error message
> > "
> >
> > However the error could have come from opening the backing file (e.g when it missing encryption keys),
> > thus try to clarify this by using this format:
> >
> > "
> > qemu-img: error creating new_file.qcow2: base_file.qcow2: error message
> > Could not open backing image to determine size.
> > "
>
> The old error message was just unspecific. Your new error message can be
> actively misleading because you just unconditionally print the filename
> of the direct backing file, even though the error could have occurred
> while opening the backing file of the backing file (or even further down
> the backing chain).
>
> It's a common problem we have with backing files and error messages: We
> either don't print the filename where the error actually happened (like
> in this case), or we print all of the backing files in the chain (such
> as "Could not open top.qcow2: Could not open mid.qcow2: Could not open
> base.qcow2: Invalid something").
>
> Ideally, we'd find a way to print only the backing filename in such
> cases ("Could not open base.qcow2: Invalid something"). I'd gladly
> accept a patch that fixes error messages in this way for both open and
> create, but I'm afraid that your approach in this patch is too
> simplistic and not an improvement
You raise a very good point, I didn't thought about this.
Thanks,
Best regards,
Maxim Levitsky
prev parent reply other threads:[~2019-07-22 9:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-21 18:15 [Qemu-trivial] [PATCH 0/2] RFC: Trivial error message fixes for luks format Maxim Levitsky
2019-07-21 18:15 ` [Qemu-trivial] [PATCH 1/2] LUKS: better error message when creating too large files Maxim Levitsky
2019-07-22 9:05 ` [Qemu-trivial] [Qemu-devel] " Daniel P. Berrangé
2019-09-12 22:44 ` Maxim Levitsky
2020-04-30 12:18 ` Maxim Levitsky
2020-04-30 13:03 ` Maxim Levitsky
2019-07-21 18:15 ` [Qemu-trivial] [PATCH 2/2] qemu-img: better error message when opening a backing file fails Maxim Levitsky
2019-07-22 9:15 ` [Qemu-trivial] [Qemu-devel] " Daniel P. Berrangé
2019-07-22 10:01 ` Maxim Levitsky
2019-07-22 9:41 ` [Qemu-trivial] " Kevin Wolf
2019-07-22 9:46 ` Maxim Levitsky [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=a8979dcc4affa9adc50c54e9c1b640dee3d09b83.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=kwolf@redhat.com \
--cc=laurent@vivier.eu \
--cc=mjt@tls.msk.ru \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).