[PATCH 08/14] iotests/149: Remove qemu_img_pipe() call

2022-03-08 Thread John Snow
to inspect the actual output to see if we want to retroactively skip the test due to missing cipher support. Signed-off-by: John Snow --- tests/qemu-iotests/149 | 7 +-- tests/qemu-iotests/149.out | 21 - 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/tests

[PATCH 10/14] iotests: use qemu_img() in has_working_luks()

2022-03-08 Thread John Snow
Admittedly a mostly lateral move, but qemu_img() is essentially the replacement for qemu_img_pipe_and_status(). It will give slightly better diagnostics on crash. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions

[PATCH 03/14] iotests: add qemu_img_info()

2022-03-08 Thread John Snow
Add qemu_img_info() by analogy with qemu_img_measure() and qemu_img_check(). Modify image_size() to use this function instead to take advantage of the better diagnostic information on failure provided (ultimately) by qemu_img(). Signed-off-by: John Snow --- tests/qemu-iotests/065| 5

[PATCH 05/14] iotests: add qemu_img_map() function

2022-03-08 Thread John Snow
-by: John Snow --- tests/qemu-iotests/041 | 5 ++--- tests/qemu-iotests/211 | 6 +++--- tests/qemu-iotests/iotests.py | 3 +++ tests/qemu-iotests/tests/block-status-cache| 11 --- tests/qemu-iotests/tests/parallels-read

[PATCH 02/14] iotests: use qemu_img_json() when applicable

2022-03-08 Thread John Snow
qemu_img_json() gives better diagnostic information on failure. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 546b142a6c..7b37938d45

[PATCH 04/14] iotests/remove-bitmap-from-backing: use qemu_img_info()

2022-03-08 Thread John Snow
This removes two more usages of qemu_img_pipe() and replaces them with calls to qemu_img(), which provides better diagnostic information on failure. Signed-off-by: John Snow --- tests/qemu-iotests/tests/remove-bitmap-from-backing | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

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

2022-03-08 Thread John Snow
emu_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

[PATCH 01/14] iotests: add qemu_img_json()

2022-03-08 Thread John Snow
by qemu_img() is re-raised. In the event that the return code is zero but we can't parse valid JSON, allow the JSON deserialization error to be raised. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 38 +++ 1 file changed, 38 insertions(+) diff

Re: [PATCH v3 3/5] iotests: Remove explicit checks for qemu_img() == 0

2022-03-08 Thread John Snow
On Tue, Mar 8, 2022, 10:16 AM Eric Blake wrote: > On Mon, Mar 07, 2022 at 08:57:26PM -0500, John Snow wrote: > > qemu_img() returning zero ought to be the rule, not the > > exception. Remove all explicit checks against the condition in > > preparation for making non-zero

[PATCH v3 4/5] iotests: make qemu_img raise on non-zero rc by default

2022-03-07 Thread John Snow
-img. Signed-off-by: John Snow Reviewed-by: Eric Blake --- tests/qemu-iotests/257| 8 +++-- tests/qemu-iotests/iotests.py | 56 ++- 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index

[PATCH v3 1/5] python/utils: add add_visual_margin() text decoration utility

2022-03-07 Thread John Snow
label may be given, and any of the individual glyphs used to draw the ┃ box may be replaced or specified as well. ┗━━━ Signed-off-by: John Snow Reviewed-by: Eric Blake --- python/qemu/utils/__init__.py | 78 +++

[PATCH v3 5/5] iotests: fortify compare_images() against crashes

2022-03-07 Thread John Snow
(perhaps to test how qemu_img compare behaves on malformed images, for instance), it is still possible to catch the exception in the test and deal with that circumstance manually. Signed-off-by: John Snow Reviewed-by: Eric Blake --- tests/qemu-iotests/iotests.py | 21 - 1 file

[PATCH v3 3/5] iotests: Remove explicit checks for qemu_img() == 0

2022-03-07 Thread John Snow
qemu_img() returning zero ought to be the rule, not the exception. Remove all explicit checks against the condition in preparation for making non-zero returns an Exception. Signed-off-by: John Snow --- tests/qemu-iotests/163 | 9 +++-- tests/qemu-iotests/216

[PATCH v3 0/5] iotests: add enhanced debugging info to qemu-img failures

2022-03-07 Thread John Snow
nice diagnostic info to the terminal if it goes unhandled. John Snow (5): python/utils: add add_visual_margin() text decoration utility python/utils: add VerboseProcessError iotests: Remove explicit checks for qemu_img() == 0 iotests: make qemu_img raise on non-zero rc by default iotests

[PATCH v3 2/5] python/utils: add VerboseProcessError

2022-03-07 Thread John Snow
so that it's easy to spot in a sea of traceback information. Signed-off-by: John Snow Reviewed-by: Eric Blake --- python/qemu/utils/__init__.py | 36 +++ 1 file changed, 36 insertions(+) diff --git a/python/qemu/utils/__init__.py b/python/qemu/utils/__init__.py

[PULL 08/11] python/aqmp: add start_server() and accept() methods

2022-03-07 Thread John Snow
connection is being made, just that it *is*. Is it worth disrupting that simplicity in order to provide a better state guard on `accept()`? Hm.) Signed-off-by: John Snow Acked-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé Message-id: 20220225205948.3693480-9-js...@redhat.com Signed-off-by:

[PULL 09/11] python/aqmp: fix race condition in legacy.py

2022-03-07 Thread John Snow
step, which creates a race condition if the QEMU process dials in too quickly. With refactoring out of the way, restore the former behavior of calling bind() and listen() during __init__() to fix this race condition. Signed-off-by: John Snow Acked-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé

[PULL 10/11] python/aqmp: drop _bind_hack()

2022-03-07 Thread John Snow
of _bind_hack(). Drop it. Fixes: b0b662bb2b3 Signed-off-by: John Snow Acked-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé Message-id: 20220225205948.3693480-11-js...@redhat.com [Expanded commit message. --js] Signed-off-by: John Snow --- python/qemu/aqmp/legacy.py | 2 +- python/qemu/aqmp

[PULL 11/11] scripts/qmp-shell-wrap: Fix import path

2022-03-07 Thread John Snow
Mea culpa. Dan's patch wound up with the wrong import path because I re-ordered my most recent pull request and missed that this needed a fix on rebase. Fixes: 43912529 Reported-by: Kashyap Chamarthy Signed-off-by: John Snow Tested-by: Kashyap Chamarthy Message-id: 20220225170828.3418305-1-js

[PULL 07/11] python/aqmp: stop the server during disconnect()

2022-03-07 Thread John Snow
Before we allow the full separation of starting the server and accepting new connections, make sure that the disconnect cleans up the server and its new state, too. Signed-off-by: John Snow Acked-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé Message-id: 20220225205948.3693480-8-js

[PULL 06/11] python/aqmp: refactor _do_accept() into two distinct steps

2022-03-07 Thread John Snow
. I'm just cutting down on some churn.) Signed-off-by: John Snow Acked-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé Message-id: 20220225205948.3693480-7-js...@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/protocol.py | 29 - python/tests/protocol.py

[PULL 03/11] python/aqmp: remove _new_session and _establish_connection

2022-03-07 Thread John Snow
changes a little to cope with the new semantics of _do_accept() and _do_connect(). Lastly, take some pieces of the now-deleted docstrings and move them up to the public interface level. They were a little more detailed, and it won't hurt to keep them. Signed-off-by: John Snow Acked-by: Kevin Wolf

[PULL 02/11] python/aqmp: rename 'accept()' to 'start_server_and_accept()'

2022-03-07 Thread John Snow
need to split apart the "accept()" method into multiple methods anyway (one of which strongly resembling accept(2)), it feels pertinent to rename this method *now*. Rename this all-in-one method "start_server_and_accept()" instead. Signed-off-by: John Snow Acked-by: Kevin Wolf

[PULL 04/11] python/aqmp: split _client_connected_cb() out as _incoming()

2022-03-07 Thread John Snow
As part of disentangling the monolithic nature of _do_accept(), split out the incoming callback to prepare for factoring out the "wait for a peer" step. Namely, this means using an event signal we can wait on from outside of this method. Signed-off-by: John Snow Acked-by: Kevin Wolf

[PULL 00/11] Python patches

2022-03-07 Thread John Snow
vm tests. John Snow (11): python/aqmp: add _session_guard() python/aqmp: rename 'accept()' to 'start_server_and_accept()' python/aqmp: remove _new_session and _establish_connection python/aqmp: split _client_connected_cb

[PULL 05/11] python/aqmp: squelch pylint warning for too many lines

2022-03-07 Thread John Snow
I would really like to keep this under 1000 lines, I promise. Doesn't look like it's gonna happen. Signed-off-by: John Snow Acked-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé Message-id: 20220225205948.3693480-6-js...@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/protocol.py | 3

[PULL 01/11] python/aqmp: add _session_guard()

2022-03-07 Thread John Snow
compatibility.) Signed-off-by: John Snow Acked-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé Message-id: 20220225205948.3693480-2-js...@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/protocol.py | 89 +--- 1 file changed, 62 insertions(+), 27 deletions

Re: [PATCH v2 3/5] iotests: Remove explicit checks for qemu_img() == 0

2022-03-04 Thread John Snow
On Fri, Mar 4, 2022 at 3:23 PM Eric Blake wrote: > > On Fri, Mar 04, 2022 at 02:47:44PM -0500, John Snow wrote: > > qemu_img() returning zero ought to be the rule, not the > > exception. Remove all explicit checks against the condition in > > preparation for making non-z

[PATCH v2 2/5] python/utils: add VerboseProcessError

2022-03-04 Thread John Snow
so that it's easy to spot in a sea of traceback information. Signed-off-by: John Snow Reviewed-by: Eric Blake --- python/qemu/utils/__init__.py | 36 +++ 1 file changed, 36 insertions(+) diff --git a/python/qemu/utils/__init__.py b/python/qemu/utils/__init__.py

[PATCH v2 3/5] iotests: Remove explicit checks for qemu_img() == 0

2022-03-04 Thread John Snow
qemu_img() returning zero ought to be the rule, not the exception. Remove all explicit checks against the condition in preparation for making non-zero returns an Exception. Signed-off-by: John Snow --- tests/qemu-iotests/163 | 9 +++-- tests/qemu-iotests/216

[PATCH v2 1/5] python/utils: add add_visual_margin() text decoration utility

2022-03-04 Thread John Snow
label may be given, and any of the individual glyphs used to draw the ┃ box may be replaced or specified as well. ┗━━━ Signed-off-by: John Snow Reviewed-by: Eric Blake --- python/qemu/utils/__init__.py | 78 +++

[PATCH v2 0/5] iotests: add enhanced debugging info to qemu-img failures

2022-03-04 Thread John Snow
qemu_img() function, but for the sake of doing the most good in the shortest amount of time, I am sending just the first 5 patches, and the rest will be sent later. I think this is a very good series to get in before freeze so that we have it during the heavy testing season. John Snow (5): python

[PATCH v2 5/5] iotests: fortify compare_images() against crashes

2022-03-04 Thread John Snow
(perhaps to test how qemu_img compare behaves on malformed images, for instance), it is still possible to catch the exception in the test and deal with that circumstance manually. Signed-off-by: John Snow Reviewed-by: Eric Blake --- tests/qemu-iotests/iotests.py | 21 - 1 file

[PATCH v2 4/5] iotests: make qemu_img raise on non-zero rc by default

2022-03-04 Thread John Snow
-img. Signed-off-by: John Snow Reviewed-by: Eric Blake --- tests/qemu-iotests/257| 8 +++-- tests/qemu-iotests/iotests.py | 56 ++- 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index

Re: [PATCH 1/5] python/utils: add add_visual_margin() text decoration utility

2022-03-04 Thread John Snow
On Thu, Mar 3, 2022, 5:43 PM Eric Blake wrote: > On Thu, Mar 03, 2022 at 03:58:58PM -0500, John Snow wrote: > > >>> print(add_visual_margin(msg, width=72, name="Commit Message")) > > ┏━ Commit Message ━━ >

[PATCH 5/5] iotests: fortify compare_images() against crashes

2022-03-03 Thread John Snow
(Perhaps to test how qemu_img compare behaves on malformed images, for instance), it is still possible to catch the exception in the test and deal with that circumstance manually. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 21 - 1 file changed, 16 insertions(+), 5

[PATCH 3/5] iotests: Remove explicit checks for qemu_img() == 0

2022-03-03 Thread John Snow
qemu_img() returning zero ought to be the rule, not the exception. Remove all explicit checks against the condition in preparation for making non-zero returns an Exception. Signed-off-by: John Snow Reviewed-by: Eric Blake --- tests/qemu-iotests/163 | 9

[PATCH 2/5] python/utils: add VerboseProcessError

2022-03-03 Thread John Snow
so that it's easy to spot in a sea of traceback information. Signed-off-by: John Snow --- python/qemu/utils/__init__.py | 36 +++ 1 file changed, 36 insertions(+) diff --git a/python/qemu/utils/__init__.py b/python/qemu/utils/__init__.py index 5babf40df2

[PATCH 1/5] python/utils: add add_visual_margin() text decoration utility

2022-03-03 Thread John Snow
label may be given, and any of the individual glyphs used to draw the ┃ box may be replaced or specified as well. ┗━━━ Signed-off-by: John Snow --- python/qemu/utils/__init__.py | 78 +++

[PATCH 4/5] iotests: make qemu_img raise on non-zero rc by default

2022-03-03 Thread John Snow
-img. Signed-off-by: John Snow --- tests/qemu-iotests/257| 8 -- tests/qemu-iotests/iotests.py | 54 +++ 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index fb5359c581..e7e7a2317e 100755

[PATCH 0/5] iotests: add enhanced debugging info to qemu-img failures

2022-03-03 Thread John Snow
patches, and the rest will be sent later. I think this is a very good series to get in before freeze so that we have it during the heavy testing season. John Snow (5): python/utils: add add_visual_margin() text decoration utility python/utils: add VerboseProcessError iotests: Remove explicit

[PULL 1/6] python: introduce qmp-shell-wrap convenience tool

2022-02-23 Thread John Snow
erra...@redhat.com [Edited for rebase. --js] Signed-off-by: John Snow --- python/qemu/aqmp/qmp_shell.py | 65 --- python/setup.cfg | 1 + scripts/qmp/qmp-shell-wrap| 11 ++ 3 files changed, 73 insertions(+), 4 deletions(-) create mode 100755 scripts

[PULL 0/6] Python patches

2022-02-23 Thread John Snow
Dan, and some packaging fixes. Daniel P. Berrangé (2): python: introduce qmp-shell-wrap convenience tool python: support recording QMP session to a file John Snow (4): Python: discourage direct setup.py install Python: add

[PULL 4/6] Python: add setuptools v60.0 workaround

2022-02-23 Thread John Snow
/5704 https://github.com/pypa/distutils/issues/110 Signed-off-by: John Snow Message-id: 20220204221804.2047468-2-js...@redhat.com Signed-off-by: John Snow --- python/tests/iotests-pylint.sh | 3 ++- python/tests/pylint.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff

[PULL 6/6] MAINTAINERS: python - remove ehabkost and add bleal

2022-02-23 Thread John Snow
to level of support), replace Eduardo as maintainer with myself. (Thanks for all of your hard work, Eduardo!) Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Beraldo Leal Acked-by: Eduardo Habkost Message-id: 20220208000525.2601011-1-js...@redhat.com Signed-off-by: John Sn

[PULL 3/6] Python: discourage direct setup.py install

2022-02-23 Thread John Snow
that points the user towards using the supported installation invocation. Reported-by: Daniel P. Berrangé Signed-off-by: John Snow Reviewed-by: Beraldo Leal Message-id: 20220207213039.2278569-1-js...@redhat.com Signed-off-by: John Snow --- python/setup.py | 19 ++- 1 file changed

[PULL 5/6] Revert "python: pin setuptools below v60.0.0"

2022-02-23 Thread John Snow
This reverts commit 1e4d8b31be35e54b6429fea54f5ecaa0083f91e7. Signed-off-by: John Snow Message-id: 20220204221804.2047468-3-js...@redhat.com Signed-off-by: John Snow --- python/Makefile | 2 -- python/setup.cfg | 1 - 2 files changed, 3 deletions(-) diff --git a/python/Makefile b/python

[PULL 2/6] python: support recording QMP session to a file

2022-02-23 Thread John Snow
.value.return.enabled' < q.log false Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrangé Message-id: 20220128161157.36261-3-berra...@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/qmp_shell.py | 29 ++--- python/setup.cfg |

[PATCH v2 18/18] iotests: reimplement img_info_log in terms of qemu_img_log

2022-02-21 Thread John Snow
Now every last call to qemu_img is certifiably either checked or logged. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 0519b2a8019

[PATCH v2 17/18] iotests: make qemu_img_log() check log level

2022-02-21 Thread John Snow
Improve qemu_img_log() to actually check if logging is turned on. If it isn't, revert to the behavior of qemu_img(). This is done so that there really is no way to avoid scrutinizing qemu-ing subprocess calls by accident. You're gonna have to work for it. Signed-off-by: John Snow --- tests/qemu

[PATCH v2 16/18] iotests: remove qemu_img_pipe()

2022-02-21 Thread John Snow
from the output is going into the log anyway. Every last call to qemu-img is now either checked for a return code of zero or has its output logged. It should be very hard to accidentally ignore the return code *or* output from qemu-img now; intentional malice remains unhandled. Signed-off-by: John

[PATCH v2 15/18] iotests: remove qemu_img_log('create', ...) calls

2022-02-21 Thread John Snow
where appropriate. Signed-off-by: John Snow --- tests/qemu-iotests/255 | 8 tests/qemu-iotests/255.out | 4 tests/qemu-iotests/274 | 17 - tests/qemu-iotests/274.out | 29 - tests/qemu-iotests/280 | 2 +- tests/qemu-iotests

[PATCH v2 14/18] iotests: move has_working_luks onto qemu_img()

2022-02-21 Thread John Snow
Admittedly a mostly lateral move; the diagnostics are slightly better on program crash. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py

[PATCH v2 13/18] iotests: remove external calls to qemu_img_pipe()

2022-02-21 Thread John Snow
this patch, the only uses of qemu_img_pipe are internal to iotests.py and will be removed in subsequent patches. Signed-off-by: John Snow --- tests/qemu-iotests/065 | 4 ++-- tests/qemu-iotests/149 | 8 ++-- tests/qemu-iotests/237 | 3 +-- tests/qemu-iotests/237.out | 3 --- tests

[PATCH v2 12/18] iotests: replace unchecked calls to qemu_img_pipe()

2022-02-21 Thread John Snow
qemu_img_pipe() discards the return code in favor of returning just the output. Some tests using this function don't save, log, or check the output either, though. Replace those calls to a checked version as appropriate. Tests affected are 194, 202, 203, 234, 262, and 303. Signed-off-by: John

[PATCH v2 11/18] iotests: change supports_quorum to use qemu_img

2022-02-21 Thread John Snow
Similar to other recent changes: use the qemu_img invocation that supports throwing loud, nasty exceptions when it fails for surprising reasons. (Why would "--help" ever fail? I don't know, but consistency is like a well-manicured bonsai.) Signed-off-by: John Snow --- tests/qe

[PATCH v2 08/18] iotests: add qemu_img_info()

2022-02-21 Thread John Snow
Add qemu_img_info() by analogy with qemu_img_{measure,check}. Modify image_size() to use this function instead. Signed-off-by: John Snow --- tests/qemu-iotests/065| 5 ++--- tests/qemu-iotests/242| 5 ++--- tests/qemu-iotests/iotests.py | 12 3 files changed, 12

[PATCH v2 07/18] iotests: use qemu_img_json() when applicable

2022-02-21 Thread John Snow
These functions should now give better crash information when something unexpected happens. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index

[PATCH v2 04/18] iotests: make qemu_img raise on non-zero rc by default

2022-02-21 Thread John Snow
a tool. Signed-off-by: John Snow --- tests/qemu-iotests/257| 8 -- tests/qemu-iotests/iotests.py | 53 +++ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index fb5359c581e..e7e7a2317e3 100755

[PATCH v2 01/18] python/utils: add enboxify() text decoration utility

2022-02-21 Thread John Snow
given, ┃ ┃ and any of the individual glyphs used to draw the box may be┃ ┃ replaced or specified as well. ┃ ┗━━┛ Signed-off-by: John Snow --- python/qemu/uti

[PATCH v2 02/18] iotests: add VerboseProcessError

2022-02-21 Thread John Snow
-by: John Snow --- tests/qemu-iotests/iotests.py | 34 ++ 1 file changed, 34 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6ba65eb1ffe..5617f991da7 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests

[PATCH v2 10/18] iotests: add qemu_img_map() function

2022-02-21 Thread John Snow
By analogy with qemu_img_{measure, check, info}. Replace calls to qemu_img_pipe('map', '--output=json', ...) with the new function. Signed-off-by: John Snow --- tests/qemu-iotests/041 | 5 ++--- tests/qemu-iotests/211 | 6 +++--- tests/qemu

[PATCH v2 09/18] iotests: remove-bitmap-from-backing: use qemu_img_info()

2022-02-21 Thread John Snow
Remove two more usages of qemu_img_pipe(). Signed-off-by: John Snow --- tests/qemu-iotests/tests/remove-bitmap-from-backing | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/tests/remove-bitmap-from-backing b/tests/qemu-iotests/tests/remove-bitmap

[PATCH v2 06/18] iotests: add qemu_img_json()

2022-02-21 Thread John Snow
is re-raised instead. In the event that the return code is zero but we can't parse valid JSON, allow the JSON deserialization error to be raised. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 35 +++ 1 file changed, 35 insertions(+) diff --git a/tests

[PATCH v2 03/18] iotests: Remove explicit checks for qemu_img() == 0

2022-02-21 Thread John Snow
qemu_img() returning zero ought to be the rule, not the exception. Remove all explicit checks against the condition in preparation for making non-zero returns an Exception. Signed-off-by: John Snow Reviewed-by: Eric Blake --- tests/qemu-iotests/163 | 9

[PATCH v2 05/18] iotests: fortify compare_images() against crashes

2022-02-21 Thread John Snow
Make this helper function a little stricter about what it allows by default. If qemu_img returns some exit code that implies it didn't actually perform the comparison, treat that as an exceptional circumstance and force the caller to be aware of the peril. Signed-off-by: John Snow --- tests

[PATCH v2 00/18] iotests: add detailed tracebacks to qemu_img() failures

2022-02-21 Thread John Snow
to qemu-img go through qemu_img() - Raise VerboseProcessError on negative return code, even when check=False - Check logging status for logged variants and revert to Exceptions when logging is off! John Snow (18): python/utils: add enboxify() text decoration utility iotests: add

Re: [PATCH] hw/ide: implement ich6 ide controller support

2022-02-17 Thread John Snow
; reading it. What machine needs this? In QEMU I think we only have > >>>> piix and ich9 emulated for pc and q35 machines but maybe ich6 is > >>>> also used by some machine I don't know about. Otherwise it looks > >>>> odd to have ide part of ic

Re: [PATCH v2] ide: Increment BB in-flight counter for TRIM BH

2022-02-17 Thread John Snow
On Tue, Feb 15, 2022 at 12:14 PM Hanna Reitz wrote: > > Ping > > (I can take it too, if you’d like, John, but you’re listed as the only > maintainer for hw/ide, so... Just say the word, though!) > Sorry, I sent you a mail off-list at the time where I said you were free to take it whenever you

Re: [PATCH 1/4] python/utils: add enboxify() text decoration utility

2022-02-16 Thread John Snow
On Tue, Feb 15, 2022, 6:57 PM Philippe Mathieu-Daudé wrote: > On 16/2/22 00:53, John Snow wrote: > > On Tue, Feb 15, 2022 at 5:55 PM Eric Blake wrote: > >> > >> On Tue, Feb 15, 2022 at 05:08:50PM -0500, John Snow wrote: > >>>>>> pr

Re: [PATCH 4/4] iotests: make qemu_img raise on non-zero rc by default

2022-02-15 Thread John Snow
On Tue, Feb 15, 2022 at 6:09 PM Eric Blake wrote: > > On Tue, Feb 15, 2022 at 05:08:53PM -0500, John Snow wrote: > > re-configure qemu_img() into a function that will by default raise a > > VerboseProcessException (extended from CalledProcessException) on > &g

Re: [PATCH 3/4] iotests: Remove explicit checks for qemu_img() == 0

2022-02-15 Thread John Snow
On Tue, Feb 15, 2022 at 6:05 PM Eric Blake wrote: > > On Tue, Feb 15, 2022 at 05:08:52PM -0500, John Snow wrote: > > qemu_img() returning zero ought to be the rule, not the > > exception. Remove all explicit checks against the condition in > > preparation for making non-z

Re: [PATCH 2/4] iotests: add VerboseProcessError

2022-02-15 Thread John Snow
On Tue, Feb 15, 2022 at 5:58 PM Eric Blake wrote: > > On Tue, Feb 15, 2022 at 05:08:51PM -0500, John Snow wrote: > > This adds an Exception that extends the garden variety > > subprocess.CalledProcessError. When this exception is raised, it will > > still be caught when

Re: [PATCH 1/4] python/utils: add enboxify() text decoration utility

2022-02-15 Thread John Snow
On Tue, Feb 15, 2022 at 5:55 PM Eric Blake wrote: > > On Tue, Feb 15, 2022 at 05:08:50PM -0500, John Snow wrote: > > >>> print(enboxify(msg, width=72, name="commit message")) > > ┏━ commit message ━┓ &

[PATCH 0/4] iotests: add detailed tracebacks to qemu_img() failures

2022-02-15 Thread John Snow
--- +Traceback (most recent call last): + File "/home/jsnow/src/qemu/tests/qemu-iotests/065", line 42, in tearDown +os.remove(test_img) +FileNotFoundError: [Errno 2] No such file or directory: '/home/jsnow/src/qemu/bin/git/tests/

[PATCH 3/4] iotests: Remove explicit checks for qemu_img() == 0

2022-02-15 Thread John Snow
qemu_img() returning zero ought to be the rule, not the exception. Remove all explicit checks against the condition in preparation for making non-zero returns an Exception. Signed-off-by: John Snow --- tests/qemu-iotests/163 | 9 +++-- tests/qemu-iotests/216

[PATCH 2/4] iotests: add VerboseProcessError

2022-02-15 Thread John Snow
-by: John Snow --- tests/qemu-iotests/iotests.py | 34 ++ 1 file changed, 34 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6ba65eb1ffe..7df393df2c3 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests

[PATCH 4/4] iotests: make qemu_img raise on non-zero rc by default

2022-02-15 Thread John Snow
something more flexible (There appears to be only one) can use check=False and manage the return themselves. Signed-off-by: John Snow --- tests/qemu-iotests/257| 8 -- tests/qemu-iotests/iotests.py | 53 +++ 2 files changed, 53 insertions(+), 8 deletions

[PATCH 1/4] python/utils: add enboxify() text decoration utility

2022-02-15 Thread John Snow
given, ┃ ┃ and any of the individual glyphs used to draw the box may be┃ ┃ replaced or specified as well. ┃ ┗━━┛ Signed-off-by: John Snow --- python/qemu/uti

Re: [PULL 0/4] Python patches

2022-02-15 Thread John Snow
On Tue, Feb 15, 2022 at 1:01 PM Peter Maydell wrote: > > On Tue, 15 Feb 2022 at 17:46, John Snow wrote: > > Just so I don't leave this thread hanging, I filed a GitLab issue and > > I'm working on it, but this one isn't as quick to solve as the other. > > > > https:

Re: [PULL 0/4] Python patches

2022-02-15 Thread John Snow
On Tue, Feb 8, 2022 at 9:40 AM Peter Maydell wrote: > > On Thu, 3 Feb 2022 at 23:22, John Snow wrote: > > > > On Thu, Feb 3, 2022 at 11:52 AM Peter Maydell > > wrote: > > > > > > On Thu, 3 Feb 2022 at 16:38, John Snow wrote: > > >

Re: [PATCH 0/4] iotests: finalize switch to async QMP

2022-02-08 Thread John Snow
Squeak Squeak... ...Any objections to me staging this? (This patchset removes the accommodations in iotests for allowing either library to run and always forces the new one. Point of no return for iotests.) --js On Wed, Feb 2, 2022 at 9:24 PM John Snow wrote: > >

Re: [PATCH-for-6.2 0/2] hw/block/fdc: Fix CVE-2021-3507

2022-02-04 Thread John Snow
On Thu, Jan 27, 2022 at 3:11 PM Jon Maloy wrote: > > > On 11/18/21 06:57, Philippe Mathieu-Daudé wrote: > > Trivial fix for CVE-2021-3507. > > > > Philippe Mathieu-Daudé (2): > >hw/block/fdc: Prevent end-of-track overrun (CVE-2021-3507) > >tests/qtest/fdc-test: Add a regression test for

Re: [PATCH v4 4/4] python/aqmp: add socket bind step to legacy.py

2022-02-04 Thread John Snow
On Thu, Feb 3, 2022 at 4:19 AM Kevin Wolf wrote: > > Am 02.02.2022 um 20:08 hat John Snow geschrieben: > > > I guess the relevant question in the context of this patch is whether > > > sync.py will need a similar two-phase setup as legacy.py. Do you think > > > yo

Re: [PATCH v4 4/4] python/aqmp: add socket bind step to legacy.py

2022-02-03 Thread John Snow
On Thu, Feb 3, 2022 at 4:38 AM Daniel P. Berrangé wrote: > > On Wed, Feb 02, 2022 at 02:08:59PM -0500, John Snow wrote: > > On Tue, Feb 1, 2022 at 2:46 PM Kevin Wolf wrote: > > > > > > Am 01.02.2022 um 19:32 hat John Snow geschrieben: > > > > On Tue

Re: [PULL 0/4] Python patches

2022-02-03 Thread John Snow
On Thu, Feb 3, 2022 at 11:52 AM Peter Maydell wrote: > > On Thu, 3 Feb 2022 at 16:38, John Snow wrote: > > > On Thu, Feb 3, 2022, 11:20 AM Peter Maydell > > wrote: > >> Summary of Failures: > >> > >> 1/1 qemu:block / qemu-iotests qcow2 ERR

Re: [PULL 0/4] Python patches

2022-02-03 Thread John Snow
On Thu, Feb 3, 2022, 11:20 AM Peter Maydell wrote: > On Thu, 3 Feb 2022 at 01:59, John Snow wrote: > > > > The following changes since commit > 47cc1a3655135b89fa75c2824fbddd29df874612: > > > > Merge remote-tracking branch 'remotes/kwolf-gitlab/tags/for-upstream'

[PATCH 4/4] iotests: switch to AQMP

2022-02-02 Thread John Snow
All that's left is to import type definitions from the new library instead. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal --- tests/qemu-iotests/iotests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests

[PATCH 3/4] iotests/mirror-top-perms: switch to AQMP

2022-02-02 Thread John Snow
with. Ultimately, I decided it's fine to just suppress the logger temporarily.) Signed-off-by: John Snow --- tests/qemu-iotests/tests/mirror-top-perms | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/tests/mirror-top-perms b/tests/qemu-iotests/tests/mirror-top

[PATCH 2/4] scripts/bench-block-job: switch to AQMP

2022-02-02 Thread John Snow
For this commit, we only need to remove accommodations for the synchronous QMP library. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal --- scripts/simplebench/bench_block_job.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH 1/4] python/machine: permanently switch to AQMP

2022-02-02 Thread John Snow
Remove the QEMU_PYTHON_LEGACY_QMP environment variable, making the switch permanent. Update Exceptions and import paths as necessary. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal --- python/qemu/machine/machine.py | 18 +++--- python

[PATCH 0/4] iotests: finalize switch to async QMP

2022-02-02 Thread John Snow
p qemu-block list with those. (Just be aware that I plan to finalize the switch soon!) John Snow (4): python/machine: permanently switch to AQMP scripts/bench-block-job: switch to AQMP iotests/mirror-top-perms: switch to AQMP iotests: switch to AQMP python/qemu/machine/machine.py

[PULL 4/4] python/aqmp: add socket bind step to legacy.py

2022-02-02 Thread John Snow
, guaranteeing that there will be a UNIX socket in the filesystem ready for the QEMU client to connect to without a race condition. (Yes, it's a bit ugly. Fixing it more nicely will have to wait until our minimum Python version is 3.7+.) Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id

[PULL 3/4] python: upgrade mypy to 0.780

2022-02-02 Thread John Snow
not related to the mypy upgrade are simply beyond my control. It's on my list to take care of soon.) Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 20220201041134.1237016-4-js...@redhat.com Signed-off-by: John Snow --- python/Pipfile.lock | 66

[PULL 0/4] Python patches

2022-02-02 Thread John Snow
observed on NetBSD. If it doesn't, let me know. John Snow (4): python/aqmp: Fix negotiation with pre-"oob" QEMU python/machine: raise VMLaunchFailure exception from launch() python: upgrade mypy to 0.780 python/aqmp:

[PULL 2/4] python/machine: raise VMLaunchFailure exception from launch()

2022-02-02 Thread John Snow
, so catch on the broadest scope and wrap-and-re-raise only in the more targeted scope.) Signed-off-by: John Snow Reviewed-by: Hanna Reitz Reviewed-by: Kevin Wolf Message-id: 20220201041134.1237016-3-js...@redhat.com Signed-off-by: John Snow --- python/qemu/machine/machine.py

[PULL 1/4] python/aqmp: Fix negotiation with pre-"oob" QEMU

2022-02-02 Thread John Snow
QEMU versions prior to the "oob" capability *also* can't accept the "enable" keyword argument at all. Fix the handshake process with older QEMU versions. Signed-off-by: John Snow Reviewed-by: Hanna Reitz Reviewed-by: Kevin Wolf Message-id: 20220201041134.1237016-2-js...@r

Re: [PATCH v4 4/4] python/aqmp: add socket bind step to legacy.py

2022-02-02 Thread John Snow
On Tue, Feb 1, 2022 at 2:46 PM Kevin Wolf wrote: > > Am 01.02.2022 um 19:32 hat John Snow geschrieben: > > On Tue, Feb 1, 2022 at 8:21 AM Kevin Wolf wrote: > > > > > > Am 01.02.2022 um 05:11 hat John Snow geschrieben: > > > > The synchronous QMP libra

Re: [PATCH v4 1/4] python/aqmp: Fix negotiation with pre-"oob" QEMU

2022-02-01 Thread John Snow
On Tue, Feb 1, 2022 at 7:59 AM Kevin Wolf wrote: > > Am 01.02.2022 um 05:11 hat John Snow geschrieben: > > QEMU versions prior to the "oob" capability *also* can't accept the > > "enable" keyword argument at all. Fix the handshake process with older > >

Re: [PATCH v4 0/4] Python: Improvements for iotest 040,041

2022-02-01 Thread John Snow
On Tue, Feb 1, 2022 at 8:28 AM Kevin Wolf wrote: > > Am 01.02.2022 um 05:11 hat John Snow geschrieben: > > GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-aqmp-fixes > > CI: https://gitlab.com/jsnow/qemu/-/pipelines/455146881 > > > > Fixes and improvements a

<    1   2   3   4   5   6   7   8   9   10   >