[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
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v2 05/23] error: Improve documentation around error_append_hint(), (continued)
[Qemu-devel] [PATCH v2 07/23] qemu-nbd: Clean up "Failed to load snapshot" error message, Markus Armbruster, 2015/12/17
[Qemu-devel] [PATCH v2 12/23] error: Use error_prepend() where it makes obvious sense, Markus Armbruster, 2015/12/17
[Qemu-devel] [PATCH v2 11/23] error: Use error_reportf_err() where it makes obvious sense, Markus Armbruster, 2015/12/17
[Qemu-devel] [PATCH v2 20/23] vhdx: Fix "log that needs to be replayed" error message, Markus Armbruster, 2015/12/17
- Re: [Qemu-devel] [PATCH v2 20/23] vhdx: Fix "log that needs to be replayed" error message,
Eric Blake <=
[Qemu-devel] [PATCH v2 19/23] pci-assign: Clean up "Failed to assign" error messages, Markus Armbruster, 2015/12/17
[Qemu-devel] [PATCH v2 10/23] error: Don't decorate original error message when adding to it, Markus Armbruster, 2015/12/17
[Qemu-devel] [PATCH v2 15/23] qemu-io qemu-nbd: Use error_report() etc. instead of fprintf(), Markus Armbruster, 2015/12/17
[Qemu-devel] [PATCH v2 14/23] migration: Use error_reportf_err() instead of monitor_printf(), Markus Armbruster, 2015/12/17
[Qemu-devel] [PATCH v2 17/23] vmdk: Clean up control flow in vmdk_parse_extents() a bit, Markus Armbruster, 2015/12/17