From: Fam Zheng <famz@redhat.com>
To: Eric Blake <eblake@redhat.com>, Nir Soffer <nsoffer@redhat.com>
Cc: Nir Soffer <nirsof@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-io: Return non-zero exit code on failure
Date: Thu, 12 Jan 2017 11:01:48 +0800 [thread overview]
Message-ID: <20170112030148.GC26504@lemon> (raw)
In-Reply-To: <750c2d41-dac2-61f7-29c3-82d8d13a0de6@redhat.com>
On Wed, 01/11 15:51, Eric Blake wrote:
> On 01/11/2017 12:24 PM, Nir Soffer wrote:
> > From: Nir Soffer <nsoffer@redhat.com>
> >
> > The result of openfile was not checked, leading to failure deep in the
> > actual command with confusing error message, and exiting with exit code 0.
> >
> > Here is one example - trying to read a pattern from an invalid chain:
> >
> > $ qemu-io -c 'read -P 1 0 1024' top.qcow2; echo $?
>
> As written, you have to guess some context about how top.qcow2 was
> created. The example can be made a bit more reproducible with:
>
> $ : > file
> $ qemu-io -f qcow2 -c ... file
Nir, thank you for the fix. Could you also add a regression test in
tests/qemu-iotests?
Reviewed-by: Fam Zheng <famz@redhat.com>
>
> > can't open device top.qcow2: Could not open backing file: Image is not in qcow2 format
> > no file open, try 'help open'
> > 0
> >
> > With this patch, we fail earlier with exit code 1:
> >
> > $ ./qemu-io -c 'read -P 1 0 1024' top.qcow2; echo $?
> > can't open device top.qcow2: Could not open backing file: Image is not
> > in qcow2 format
> > 1
> >
> > Signed-off-by: Nir Soffer <nirsof@gmail.com>
> > ---
> > qemu-io.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Whether or not the commit message is improved,
> Reviewed-by: Eric Blake <eblake@redhat.com>
next prev parent reply other threads:[~2017-01-12 3:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-11 18:24 [Qemu-devel] [PATCH] qemu-io: Return non-zero exit code on failure Nir Soffer
2017-01-11 21:51 ` Eric Blake
2017-01-12 3:01 ` Fam Zheng [this message]
2017-01-12 20:04 ` Nir Soffer
2017-01-12 19:56 ` Nir Soffer
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=20170112030148.GC26504@lemon \
--to=famz@redhat.com \
--cc=eblake@redhat.com \
--cc=nirsof@gmail.com \
--cc=nsoffer@redhat.com \
--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).