[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 10/18] iotests: add qemu_img_map() function
From: |
Eric Blake |
Subject: |
Re: [PATCH v4 10/18] iotests: add qemu_img_map() function |
Date: |
Mon, 21 Mar 2022 09:24:37 -0500 |
User-agent: |
NeoMutt/20211029-454-6adf99 |
On Thu, Mar 17, 2022 at 07:49:29PM -0400, John Snow wrote:
> Add a qemu_img_map() function by analogy with qemu_img_measure(),
> qemu_img_check(), and qemu_img_info() that all return JSON information.
>
> Replace calls to qemu_img_pipe('map', '--output=json', ...) with this
> new function, which provides better diagnostic information on failure.
>
> Note: The output for iotest 211 changes, because logging JSON after it
> was deserialized by Python behaves a little differently than logging the
> raw JSON document string itself.
> (iotests.log() sorts the keys for Python 3.6 support.)
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> +++ b/tests/qemu-iotests/211.out
> @@ -55,9 +53,7 @@ file format: IMGFMT
> virtual size: 32 MiB (33554432 bytes)
> cluster_size: 1048576
>
> -[{ "start": 0, "length": 3072, "depth": 0, "present": true, "zero": false,
> "data": true, "offset": 1024},
> -{ "start": 3072, "length": 33551360, "depth": 0, "present": true, "zero":
> true, "data": true, "offset": 4096}]
> -
> +[{"data": true, "depth": 0, "length": 3072, "offset": 1024, "present": true,
> "start": 0, "zero": false}, {"data": true, "depth": 0, "length": 33551360,
> "offset": 4096, "present": true, "start": 3072, "zero": true}]
The change in format can produce really long lines for a more complex
map, which can introduce its own problems in legibility. But I can
live with it.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [PATCH v4 00/18] iotests: add enhanced debugging info to qemu-img failures, John Snow, 2022/03/17
- [PATCH v4 03/18] iotests: Remove explicit checks for qemu_img() == 0, John Snow, 2022/03/17
- [PATCH v4 02/18] python/utils: add VerboseProcessError, John Snow, 2022/03/17
- [PATCH v4 05/18] iotests: fortify compare_images() against crashes, John Snow, 2022/03/17
- [PATCH v4 06/18] iotests: add qemu_img_json(), John Snow, 2022/03/17
- [PATCH v4 08/18] iotests: add qemu_img_info(), John Snow, 2022/03/17
- [PATCH v4 07/18] iotests: use qemu_img_json() when applicable, John Snow, 2022/03/17
- [PATCH v4 10/18] iotests: add qemu_img_map() function, John Snow, 2022/03/17
- Re: [PATCH v4 10/18] iotests: add qemu_img_map() function,
Eric Blake <=
- [PATCH v4 15/18] iotests: use qemu_img() in has_working_luks(), John Snow, 2022/03/17
- [PATCH v4 01/18] python/utils: add add_visual_margin() text decoration utility, John Snow, 2022/03/17
- [PATCH v4 09/18] iotests/remove-bitmap-from-backing: use qemu_img_info(), John Snow, 2022/03/17
- [PATCH v4 12/18] iotests: replace unchecked calls to qemu_img_pipe(), John Snow, 2022/03/17
- [PATCH v4 18/18] iotests: make qemu_img_log and img_info_log raise on error, John Snow, 2022/03/17
- [PATCH v4 04/18] iotests: make qemu_img raise on non-zero rc by default, John Snow, 2022/03/17
- [PATCH v4 17/18] iotests: remove qemu_img_pipe_and_status(), John Snow, 2022/03/17
- [PATCH v4 16/18] iotests: replace qemu_img_log('create', ...) calls, John Snow, 2022/03/17
- [PATCH v4 11/18] iotests: change supports_quorum to use qemu_img, John Snow, 2022/03/17