qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 20/23] vhdx: Fix "log that needs to be replay


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 20/23] vhdx: Fix "log that needs to be replayed" error message
Date: Thu, 17 Dec 2015 14:52:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/17/2015 09:50 AM, Markus Armbruster wrote:
> The arguments of error_setg_errno() should yield a short error string
> without newlines.
> 
> Here, we try to append additional help to the error message by
> embedding newlines in the error string.  That's nice, but it's doesn't
> play nicely with the errno part.  tests/qemu-iotests/070.out shows the
> resulting mess:
> 
>     can't open device TEST_DIR/iotest-dirtylog-10G-4M.vhdx: VHDX image file 
> 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx' opened read-only, but contains a log 
> that needs to be replayed.  To replay the log, execute:
>      qemu-img check -r all 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx': Operation 
> not permitted
> 
> Switch to error_setg() and error_append_hint().  Result:
> 
>     can't open device TEST_DIR/iotest-dirtylog-10G-4M.vhdx: VHDX image file 
> 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx' opened read-only, but contains a log 
> that needs to be replayed
>     To replay the log, run:
>     qemu-img check -r all 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx'

The loss of the strerror() text isn't too bad; particularly since it is
probably always going to be 'Operation not permitted' and redundant with
the text about being read-only with a replay that requires write access.

> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  block/vhdx-log.c           | 13 +++++++------
>  tests/qemu-iotests/070.out |  5 +++--
>  2 files changed, 10 insertions(+), 8 deletions(-)
> 

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]