Skip to content

iotests: ensure all qemu-img calls are either checked or logged

John Snow qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 25 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14iotests: add qemu_img_json()tests/qemu-iotests/iotests.py+38 -04 replies
2/14iotests: use qemu_img_json() when applicabletests/qemu-iotests/iotests.py+4 -41 reply
3/14iotests: add qemu_img_info()tests/qemu-iotests/065 tests/qemu-iotests/242 tests/qemu-iotests/iotests.py+15 -102 replies
4/14iotests/remove-bitmap-from-backing: use qemu_img_info()tests/qemu-iotests/tests/remove-bitmap-from-backing+3 -31 reply
5/14iotests: add qemu_img_map() functiontests/qemu-iotests/041 tests/qemu-iotests/211 tests/qemu-iotests/iotests.py +2 more+14 -171 reply
6/14iotests: change supports_quorum to use qemu_imgtests/qemu-iotests/iotests.py+2 -21 reply
7/14iotests: replace unchecked calls to qemu_img_pipe()tests/qemu-iotests/194 tests/qemu-iotests/202 tests/qemu-iotests/203 +3 more+10 -101 reply
8/14iotests/149: Remove qemu_img_pipe() calltests/qemu-iotests/149 tests/qemu-iotests/149.out+5 -231 reply
9/14iotests: remove remaining calls to qemu_img_pipe()tests/qemu-iotests/065 tests/qemu-iotests/237 tests/qemu-iotests/237.out +1 more+9 -131 reply
10/14iotests: use qemu_img() in has_working_luks()tests/qemu-iotests/iotests.py+9 -91 reply
11/14iotests: replace qemu_img_log('create', ...) callstests/qemu-iotests/255 tests/qemu-iotests/255.out tests/qemu-iotests/274 +3 more+13 -481 reply
12/14iotests: remove qemu_img_pipe_and_status()tests/qemu-iotests/iotests.py+7 -194 replies
13/14iotests: make qemu_img_log() check log leveltests/qemu-iotests/iotests.py+18 -11 reply
14/14iotests: make img_info_log() call qemu_img_log()tests/qemu-iotests/iotests.py+9 -45 replies

Reviews trailers per patch

10 of 14 patches have a Reviewed-by or Acked-by.

PatchHanna Reitz
1/14
2/14R-b
3/14R-b
4/14R-b
5/14
6/14R-b
7/14R-b
8/14R-b
9/14R-b
10/14R-b
11/14R-b
12/14
13/14R-b
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/14] iotests: ensure all qemu-img calls are either checked or logged

Based-On: [email protected]

Hi, this series ensures all calls to qemu-img ultimately go through qemu_img(). After the previous series, qemu_img() is a function that defaults to raising a VerboseProcessError exception when qemu-img returns a non-zero exit code.

After this series, all qemu-img invocations from the iotests suite are guaranteed to go through either qemu_img_log(), which allows non-zero exit codes (but logs its output), or qemu_img().

Some callsites manually disable the error checking with check=False, which is a good visual reminder directly at the callsite that additional verification must be performed. The callsites utilizing this are very few and far between.

The VerboseProcessError exception will print the command line, return code, and all console output to the terminal if it goes unhandled. In effect, all non-logging calls to qemu-img are now guaranteed to print detailed failure information to the terminal on any unanticipated behavior.

(Even logging calls will still raise this exception if the exit code was negative, so you get all of the same failure output whenever qemu-img crashes *anywhere* in iotests now.)

As a result of this change, some of the helpers change. Here's a summary of the changes between the last series and this one:

qemu_img()                   => qemu_img().returncode
qemu_img_pipe()              => qemu_img().stdout
qemu_img_pipe_and_status()   => qemu_img()

json.loads(qemu_img_pipe())) => qemu_img_json()
qemu_img_log() => qemu_img_log()

John Snow (14):
iotests: add qemu_img_json()
iotests: use qemu_img_json() when applicable
iotests: add qemu_img_info() iotests/remove-bitmap-from-backing: use qemu_img_info()
iotests: add qemu_img_map() function
iotests: change supports_quorum to use qemu_img
iotests: replace unchecked calls to qemu_img_pipe() iotests/149: Remove qemu_img_pipe() call
iotests: remove remaining calls to qemu_img_pipe()
iotests: use qemu_img() in has_working_luks()
iotests: replace qemu_img_log('create', ...) calls
iotests: remove qemu_img_pipe_and_status()
iotests: make qemu_img_log() check log level
iotests: make img_info_log() call qemu_img_log()

 tests/qemu-iotests/041                        |   5 +-
 tests/qemu-iotests/065                        |   7 +-
 tests/qemu-iotests/149                        |   7 +-
 tests/qemu-iotests/149.out                    |  21 ---
 tests/qemu-iotests/194                        |   4 +-
 tests/qemu-iotests/202                        |   4 +-
 tests/qemu-iotests/203                        |   4 +-
 tests/qemu-iotests/211                        |   6 +-
 tests/qemu-iotests/234                        |   4 +-
 tests/qemu-iotests/237                        |   3 +-
 tests/qemu-iotests/237.out                    |   3 -
 tests/qemu-iotests/242                        |   5 +-
 tests/qemu-iotests/255                        |   8 +-
 tests/qemu-iotests/255.out                    |   4 -
 tests/qemu-iotests/262                        |   2 +-
 tests/qemu-iotests/274                        |  17 ++-
 tests/qemu-iotests/274.out                    |  29 ----
 tests/qemu-iotests/280                        |   2 +-
 tests/qemu-iotests/280.out                    |   1 -
 tests/qemu-iotests/296                        |  12 +-
 tests/qemu-iotests/303                        |   2 +-
 tests/qemu-iotests/iotests.py                 | 134 +++++++++++++-----
 tests/qemu-iotests/tests/block-status-cache   |  11 +-
 .../qemu-iotests/tests/parallels-read-bitmap  |   6 +-
 .../tests/remove-bitmap-from-backing          |   6 +-
 25 files changed, 150 insertions(+), 157 deletions(-)
Signature · 1 line
2.34.1