[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/2] qemu-io: Return non-zero ex
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/2] qemu-io: Return non-zero exit code on failure |
Date: |
Tue, 31 Jan 2017 08:43:08 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
On 01/31/2017 07:57 AM, Nir Soffer wrote:
> From: Nir Soffer <address@hidden>
>
> 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 a simple example - trying to read with the wrong format:
>
> $ touch file
> $ qemu-io -f qcow2 -c 'read -P 1 0 1024' file; echo $?
> can't open device 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 -f qcow2 -c 'read -P 1 0 1024' file; echo $?
> can't open device file: Image is not in qcow2 format
> 1
>
> Failing earlier, we don't log this error now:
>
> no file open, try 'help open'
>
> But some tests expected it; the line was removed from the test output.
>
> Signed-off-by: Nir Soffer <address@hidden>
> ---
Yay - v4 is a lot nicer! Thanks for putting up with our advice on making
your submission better.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature