Re: [PATCH v3 11/16] iotests/297: return error code from run_linters()

2021-09-22 Thread John Snow
On Fri, Sep 17, 2021 at 7:00 AM Hanna Reitz wrote: > On 16.09.21 06:09, John Snow wrote: > > This turns run_linters() into a bit of a hybrid test; returning non-zero > > on failed execution while also printing diffable information. This is > > done for the benefit of th

Re: [PATCH v3 07/16] iotests/297: Don't rely on distro-specific linter binaries

2021-09-22 Thread John Snow
(This email just explains python packaging stuff. No action items in here. Skim away.) On Fri, Sep 17, 2021 at 5:43 AM Hanna Reitz wrote: > On 16.09.21 06:09, John Snow wrote: > > 'pylint-3' is another Fedora-ism. Use "python3 -m pylint" or "python3 -m > &g

Re: [PATCH v3 03/16] iotests/migrate-bitmaps-postcopy-test: declare instance variables

2021-09-22 Thread John Snow
On Fri, Sep 17, 2021 at 4:37 AM Hanna Reitz wrote: > On 16.09.21 06:09, John Snow wrote: > > Signed-off-by: John Snow > > --- > > tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/t

Re: [PATCH v3 06/16] iotests/297: Add get_files() function

2021-09-22 Thread John Snow
On Fri, Sep 17, 2021 at 5:24 AM Hanna Reitz wrote: > On 16.09.21 06:09, John Snow wrote: > > Split out file discovery into its own method to begin separating out the > > "environment setup" and "test execution" phases. > > > > Signed-off-by: John

Re: [PATCH 12/15] iotests: Disable AQMP logging under non-debug modes

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 8:58 PM John Snow wrote: > > > On Fri, Sep 17, 2021 at 10:30 AM Hanna Reitz wrote: > >> On 17.09.21 07:40, John Snow wrote: >> > Disable the aqmp logger, which likes to (at the moment) print out >> > intermediate warnings and e

Re: [PATCH 13/15] iotests: Accommodate async QMP Exception classes

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 10:35 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > (But continue to support the old ones for now, too.) > > > > There are very few cases of any user of QEMUMachine or a subclass > > thereof relying on a QMP Exception type.

Re: [PATCH 12/15] iotests: Disable AQMP logging under non-debug modes

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 10:30 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > Disable the aqmp logger, which likes to (at the moment) print out > > intermediate warnings and errors that cause session termination; disable > > them so they don't int

Re: [PATCH 11/15] python/aqmp: Create sync QMP wrapper for iotests

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 10:23 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > This is a wrapper around the async QMPClient that mimics the old, > > synchronous QEMUMonitorProtocol class. It is designed to be > > interchangeable with the old implementation

Re: [PATCH 10/15] python/machine: Add support for AQMP backend

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 10:16 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > To use the AQMP backend, Machine just needs to be a little more diligent > > about what happens when closing a QMP connection. The operation is no > > longer a freeb

Re: [PATCH 09/15] python/machine: remove has_quit argument

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 9:59 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > If we spy on the QMP commands instead, we don't need callers to remember > > to pass it. Seems like a fair trade-off. > > > > The one slightly weird bit is overloading thi

Re: [PATCH 08/15] python/aqmp: Create MessageModel and StandaloneModel classes

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021, 9:39 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > This allows 'Greeting' to be subclass of 'Message'. We need the adapter > > classes to avoid some typing problems that occur if we try to put too > > much into th

Re: [PATCH 07/15] python/aqmp: add send_fd_scm

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 9:34 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > The single space is indeed required to successfully transmit the file > > descriptor to QEMU. > > Yeah, socket_scm_helper.c said “Send a blank to notify qemu”. > >

Re: [PATCH 05/15] python/qmp: add send_fd_scm directly to QEMUMonitorProtocol

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 9:21 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > It turns out you can do this directly from Python ... and because of > > this, you don't need to worry about setting the inheritability of the > > fds or spawning another proc

Re: [PATCH 04/15] python/qmp: clear events on get_events() call

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 8:51 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > All callers in the tree *already* clear the events after a call to > > get_events(). Do it automatically instead and update callsites to remove > > the manual clear call. > &

Re: [PATCH 03/15] python/aqmp: Return cleared events from EventListener.clear()

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 8:36 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > This serves two purposes: > > > > (1) It is now possible to discern whether or not clear() removed any > > event(s) from the queue with absolute certainty, and > > >

Re: [PATCH 14/15] python/aqmp: Remove scary message

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 10:39 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > The scary message interferes with the iotests output. Coincidentally, if > > iotests works by removing this, then it's good evidence that we don't > > really need to

Re: [PATCH 15/15] python, iotests: replace qmp with aqmp

2021-09-17 Thread John Snow
On Fri, Sep 17, 2021 at 10:40 AM Hanna Reitz wrote: > On 17.09.21 07:40, John Snow wrote: > > Swap out the synchronous QEMUMonitorProtocol from qemu.qmp with the sync > > wrapper from qemu.aqmp instead. > > > > Add an escape hatch in the form

[PATCH 13/15] iotests: Accommodate async QMP Exception classes

2021-09-16 Thread John Snow
its derivatives. That'd be these: - QMPError - QMPConnectError - QMPCapabilitiesError - QMPTimeoutError - QMPProtocolError - QMPResponseError - QMPBadPortError Signed-off-by: John Snow --- scripts/simplebench/bench_block_job.py| 3 ++- tests/qemu-iotests/tests/mirror-top-perms | 6 +-

[PATCH 11/15] python/aqmp: Create sync QMP wrapper for iotests

2021-09-16 Thread John Snow
This is a wrapper around the async QMPClient that mimics the old, synchronous QEMUMonitorProtocol class. It is designed to be interchangeable with the old implementation. It does not, however, attempt to mimic Exception compatibility. Signed-off-by: John Snow --- python/qemu/aqmp/legacy.py

[PATCH 08/15] python/aqmp: Create MessageModel and StandaloneModel classes

2021-09-16 Thread John Snow
x27;Greeting' ⊆ 'Message', which is taxonomically true; but the real motivation is to be able to inherit and abuse all of the Mapping dunders so that we can call dict(greeting) or bytes(greeting), for example. Signed-off-by: John Snow --- python/qemu/aqmp/models.py | 67

[PATCH 09/15] python/machine: remove has_quit argument

2021-09-16 Thread John Snow
that wait() will "fail" if the QEMU process does not terminate of its own accord. In most cases, we probably did already actually issue quit -- some iotests do this -- but in some others, we may be waiting for QEMU to terminate for some other reason. Signed-off-by: John Snow

[PATCH 10/15] python/machine: Add support for AQMP backend

2021-09-16 Thread John Snow
will have exited due to EOF after issuing the last 'quit' command. That error will ultimately be bubbled up when attempting to close the QMP connection. The manager class here then is free to discard it if it was expected. Signed-off-by: John Snow --- Yes, I regret that this class has

Re: [PATCH v3 00/16] python/iotests: Run iotest linters during Python CI

2021-09-16 Thread John Snow
On Thu, Sep 16, 2021 at 12:10 AM John Snow wrote: > GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-package-iotest > CI: https://gitlab.com/jsnow/qemu/-/pipelines/371611883 > Based-On: <20210915175318.853225-1-hre...@redhat.com> > "[PULL 00/32] Block pat

[PATCH 14/15] python/aqmp: Remove scary message

2021-09-16 Thread John Snow
The scary message interferes with the iotests output. Coincidentally, if iotests works by removing this, then it's good evidence that we don't really need to scare people away from using it. Signed-off-by: John Snow --- python/qemu/aqmp/__init__.py | 14 -- 1 file c

[PATCH 15/15] python, iotests: replace qmp with aqmp

2021-09-16 Thread John Snow
concurrently. Signed-off-by: John Snow --- python/qemu/machine/machine.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 8f5a6649e5..6b005dd5d1 100644 --- a/python/qemu/machine/machine.py +++ b/python

[PATCH 12/15] iotests: Disable AQMP logging under non-debug modes

2021-09-16 Thread John Snow
no matter what. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 273d2777ae..47e5f9738b 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@

[PATCH 05/15] python/qmp: add send_fd_scm directly to QEMUMonitorProtocol

2021-09-16 Thread John Snow
ivate implementation details. *that* is helpful in turn because it allows me to write a compatible, alternative implementation. Signed-off-by: John Snow --- python/qemu/machine/machine.py | 44 +++--- python/qemu/qmp/__init__.py| 21 +++- 2 files change

[PATCH 06/15] python, iotests: remove socket_scm_helper

2021-09-16 Thread John Snow
It's not used anymore, now. Signed-off-by: John Snow --- tests/qemu-iotests/socket_scm_helper.c | 136 - python/qemu/machine/machine.py | 3 - python/qemu/machine/qtest.py | 2 - tests/Makefile.include | 1 - tests/meson.

[PATCH 04/15] python/qmp: clear events on get_events() call

2021-09-16 Thread John Snow
Making the retrieval also clear the queue is vastly simpler. Signed-off-by: John Snow --- python/qemu/machine/machine.py | 1 - python/qemu/qmp/__init__.py| 4 +++- python/qemu/qmp/qmp_shell.py | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/qemu/machine/machine.p

[PATCH 07/15] python/aqmp: add send_fd_scm

2021-09-16 Thread John Snow
The single space is indeed required to successfully transmit the file descriptor to QEMU. Signed-off-by: John Snow --- python/qemu/aqmp/qmp_client.py | 17 + 1 file changed, 17 insertions(+) diff --git a/python/qemu/aqmp/qmp_client.py b/python/qemu/aqmp/qmp_client.py index

[PATCH 02/15] python/aqmp: add .empty() method to EventListener

2021-09-16 Thread John Snow
Synchronous clients may want to know if they're about to block waiting for an event or not. A method such as this is necessary to implement a compatible interface for the old QEMUMonitorProtocol using the new async internals. Signed-off-by: John Snow --- python/qemu/aqmp/events.py | 6

[PATCH 01/15] python/aqmp: add greeting property to QMPClient

2021-09-16 Thread John Snow
Expose the greeting as a read-only property of QMPClient so it can be retrieved at-will. Signed-off-by: John Snow --- python/qemu/aqmp/qmp_client.py | 5 + 1 file changed, 5 insertions(+) diff --git a/python/qemu/aqmp/qmp_client.py b/python/qemu/aqmp/qmp_client.py index 82e9dab124

[PATCH 00/15] Switch iotests to using Async QMP

2021-09-16 Thread John Snow
LEGACY_QMP variable to any non-empty string as it pleases you to engage the QMP machinery you are used to. I'd like to try and get this committed early in the 6.2 development cycle to give ample time to smooth over any possible regressions. I've tested it locally and via gitlab CI

[PATCH 03/15] python/aqmp: Return cleared events from EventListener.clear()

2021-09-16 Thread John Snow
This serves two purposes: (1) It is now possible to discern whether or not clear() removed any event(s) from the queue with absolute certainty, and (2) It is now very easy to get a List of all pending events in one chunk, which is useful for the sync bridge. Signed-off-by: John Snow

Re: [PATCH v3 01/16] python: Update for pylint 2.10

2021-09-16 Thread John Snow
On Thu, Sep 16, 2021 at 9:30 AM Alex Bennée wrote: > > John Snow writes: > > > A few new annoyances. Of note is the new warning for an unspecified > > encoding when opening a text file, which actually does indicate a > > potentially real problem; see > > https:/

Re: [PATCH v3 02/16] iotests/mirror-top-perms: Adjust imports

2021-09-16 Thread John Snow
On Thu, Sep 16, 2021 at 12:27 AM Philippe Mathieu-Daudé wrote: > On 9/16/21 6:09 AM, John Snow wrote: > > We need to import things from the qemu namespace; importing the > > namespace alone doesn't bring the submodules with it -- unless someone > > else (like io

[PATCH v3 16/16] iotests/linters: check mypy files all at once

2021-09-15 Thread John Snow
We can circumvent the '__main__' redefinition problem by passing --scripts-are-modules. Take mypy out of the loop per-filename and check everything in one go: it's quite a bit faster. Signed-off-by: John Snow --- tests/qemu-iotests/linters.py | 62

[PATCH v3 14/16] iotests/linters: Add workaround for mypy bug #9852

2021-09-15 Thread John Snow
e problems intermittently. mypy >= 0.920 isn't released yet, so add this workaround for now. See also: https://github.com/python/mypy/issues/11010 https://github.com/python/mypy/issues/9852 Signed-off-by: John Snow --- tests/qemu-iotests/linters.py | 3 +++ 1 file changed, 3 insertions(+)

[PATCH v3 12/16] iotests/297: split linters.py off from 297

2021-09-15 Thread John Snow
files that instruct these tools how to run properly in this directory, but ... not yet, and not in this series. Signed-off-by: John Snow --- tests/qemu-iotests/297| 105 ++ tests/qemu-iotests/linters.py | 117 ++ 2 files changed

[PATCH v3 15/16] python: Add iotest linters to test suite

2021-09-15 Thread John Snow
As a convenience, since iotests is an extremely prominent user of the qemu.qmp and qemu.machine packages and already implements a linting regime, run those tests as well so that it's very hard to miss regressions caused by changes to the python library. Signed-off-by: John Snow --- python/

[PATCH v3 07/16] iotests/297: Don't rely on distro-specific linter binaries

2021-09-15 Thread John Snow
efore the test begins -- this check is now "overly strict", but shouldn't cause anything that was already running correctly to start failing. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé --- tests/qemu-iotests/297 |

[PATCH v3 10/16] iotests/297: Add 'directory' argument to run_linters

2021-09-15 Thread John Snow
Allow run_linters to work well if it's executed from a different directory. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/297 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297 index 08d2b

[PATCH v3 13/16] iotests/linters: Add entry point for Python CI linters

2021-09-15 Thread John Snow
onvenient for block maintainers and contributors to run in this manner. We can either remove this functionality at a later date if everyone is happy with the Python CI, or we can opt to continue to maintain it. Please let me know how you feel. See the following commit for how this is used fr

[PATCH v3 05/16] iotests/297: modify is_python_file to work from any CWD

2021-09-15 Thread John Snow
Add a directory argument to is_python_file to allow it to work correctly no matter what CWD we happen to run it from. This is done in anticipation of running the iotests from another directory (./python/). Signed-off-by: John Snow --- tests/qemu-iotests/297 | 8 +--- 1 file changed, 5

[PATCH v3 08/16] iotests/297: Create main() function

2021-09-15 Thread John Snow
Instead of running "run_linters" directly, create a main() function that will be responsible for environment setup, leaving run_linters() responsible only for execution of the linters. (That environment setup will be moved over in forthcoming commits.) Signed-off-by: John Snow R

[PATCH v3 11/16] iotests/297: return error code from run_linters()

2021-09-15 Thread John Snow
: universal_newlines is added to the pylint invocation for type consistency with the mypy run -- it's not strictly necessary, but it avoids some typing errors caused by our re-use of the 'p' variable.) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-i

[PATCH v3 04/16] iotests/migrate-bitmaps-test: delint

2021-09-15 Thread John Snow
Mostly uninteresting stuff. Move the test injections under a function named main() so that the variables used during that process aren't in the global scope. Signed-off-by: John Snow --- tests/qemu-iotests/tests/migrate-bitmaps-test | 50 +++ 1 file changed, 28 insertions(+

[PATCH v3 03/16] iotests/migrate-bitmaps-postcopy-test: declare instance variables

2021-09-15 Thread John Snow
Signed-off-by: John Snow --- tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test index 00ebb5c251..9c00ae61c8 100755 --- a

[PATCH v3 00/16] python/iotests: Run iotest linters during Python CI

2021-09-15 Thread John Snow
but was necessary for testing. - Rebased on top of hreitz/block, which fixed some linting issues. - Added a workaround for a rather nasty mypy bug ... >:( V2: - Added patches 1-5 which do some more delinting. - Added patch 8, which scans subdirs for tests to lint. - Added patch 17, which i

[PATCH v3 06/16] iotests/297: Add get_files() function

2021-09-15 Thread John Snow
Split out file discovery into its own method to begin separating out the "environment setup" and "test execution" phases. Signed-off-by: John Snow --- tests/qemu-iotests/297 | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iote

[PATCH v3 01/16] python: Update for pylint 2.10

2021-09-15 Thread John Snow
minal output. Note that Python states: "language code and encoding may be None if their values cannot be determined" -- use a platform default as a backup. Signed-off-by: John Snow --- python/qemu/machine/machine.py | 9 - python/setup.cfg | 1 + 2 files changed, 9 i

[PATCH v3 09/16] iotests/297: Separate environment setup from test execution

2021-09-15 Thread John Snow
Move environment setup into main(), leaving pure test execution behind in run_linters(). Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/297 | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a

[PATCH v3 02/16] iotests/mirror-top-perms: Adjust imports

2021-09-15 Thread John Snow
We need to import things from the qemu namespace; importing the namespace alone doesn't bring the submodules with it -- unless someone else (like iotests.py) imports them too. Adjust the imports. Signed-off-by: John Snow --- tests/qemu-iotests/tests/mirror-top-perms | 7 --- 1 file ch

Re: [PATCH 1/2] iotests: Fix unspecified-encoding pylint warnings

2021-09-14 Thread John Snow
Philippe Mathieu-Daudé > > I don't see this upstream just yet, so ... Reviewed-by: John Snow I'll get around to revisiting my "run the iotest linters on Python CI" thing soon which will flush out anything else that might still be missing. --js

Re: [PATCH 0/7] floppy: build as modules.

2021-08-17 Thread John Snow
On Tue, Aug 17, 2021 at 5:09 AM Philippe Mathieu-Daudé wrote: > Hi John, > > On 8/16/21 11:55 PM, John Snow wrote: > > On Thu, Aug 5, 2021 at 3:12 AM Gerd Hoffmann > <mailto:kra...@redhat.com>> wrote: > > > > On Wed, Aug 04, 2021 at 05:19:02P

Re: [PATCH 0/7] floppy: build as modules.

2021-08-16 Thread John Snow
On Thu, Aug 5, 2021 at 3:12 AM Gerd Hoffmann wrote: > On Wed, Aug 04, 2021 at 05:19:02PM +0200, Philippe Mathieu-Daudé wrote: > > +Mark > > > > On 8/4/21 4:27 PM, Gerd Hoffmann wrote: > > > Some code shuffling needed beforehand due to floppy being part of > > > several platforms. While being at

Re: [PATCH v7 25/33] iotests.py: VM: add own __enter__ method

2021-08-04 Thread John Snow
> +# Redefine __enter__ with proper type hint > +def __enter__(self) -> 'VM': > +return self > + > def __init__(self, path_suffix=''): > name = "qemu%s-%d" % (path_suffix, os.getpid()) > super().__init__

Re: [PATCH v7 29/33] iotests.py: hmp_qemu_io: support qdev

2021-08-04 Thread John Snow
ot;', use_log=use_log) > > def flatten_qmp_object(self, obj, output=None, basestr=''): > if output is None: > -- > 2.29.2 > > Guess that's really the only flag that this HMP command supports. I was gonna suggest abstracting to {args} ... but, uh, that's the only one, so... sure! Reviewed-by: John Snow

Re: [PATCH v2 00/17] python/iotests: Run iotest linters during Python CI

2021-07-20 Thread John Snow
I realize that some of this has been covered before: https://lists.gnu.org/archive/html/qemu-devel/2021-05/msg04221.html Missed it at the time -- I suppose these patches never went in. I'll rebase my series and front-load these patches. --js On Tue, Jul 20, 2021 at 1:33 PM John Snow

[PATCH v2 15/17] iotests/linters: Add entry point for Python CI linters

2021-07-20 Thread John Snow
onvenient for block maintainers and contributors to run in this manner. See the following commit for how this is used from the Python packaging side. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/linters.py | 13 + 1 file changed, 13 inse

[PATCH v2 16/17] python: Add iotest linters to test suite

2021-07-20 Thread John Snow
As a convenience, since iotests is an extremely prominent user of the qemu.qmp and qemu.machine packages and already implements a linting regime, run those tests as well so that it's very hard to miss regressions caused by changes to the python library. Signed-off-by: John Snow Review

[PATCH v2 13/17] iotests/297: return error code from run_linters()

2021-07-20 Thread John Snow
: universal_newlines is added to the pylint invocation for type consistency with the mypy run -- it's not strictly necessary, but it avoids some typing errors caused by our re-use of the 'p' variable.) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-i

[PATCH v2 17/17] iotests/linters: check mypy files all at once

2021-07-20 Thread John Snow
We can circumvent the '__main__' redefinition problem by passing --scripts-are-modules. Take mypy out of the loop per-filename and check everything in one go: it's quite a bit faster. Signed-off-by: John Snow --- tests/qemu-iotests/linters.py | 56

[PATCH v2 14/17] iotests/297: split linters.py off from 297

2021-07-20 Thread John Snow
files that instruct these tools how to run properly in this directory, but ... not yet, and not in this series. Signed-off-by: John Snow --- tests/qemu-iotests/297| 110 ++- tests/qemu-iotests/linters.py | 121 ++ 2 files changed

[PATCH v2 12/17] iotests/297: Add 'directory' argument to run_linters

2021-07-20 Thread John Snow
Allow run_linters to work well if it's executed from a different directory. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/297 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297 index 961c91

[PATCH v2 09/17] iotests/297: Don't rely on distro-specific linter binaries

2021-07-20 Thread John Snow
efore the test begins -- this check is now "overly strict", but shouldn't cause anything that was already running correctly to start failing. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/297 | 45 --

[PATCH v2 10/17] iotests/297: Create main() function

2021-07-20 Thread John Snow
Instead of running "run_linters" directly, create a main() function that will be responsible for environment setup, leaving run_linters() responsible only for execution of the linters. (That environment setup will be moved over in forthcoming commits.) Signed-off-by: John Snow R

[PATCH v2 07/17] iotests/297: Add get_files() function

2021-07-20 Thread John Snow
Split out file discovery into its own method to begin separating out the "environment setup" and "test execution" phases. Signed-off-by: John Snow --- tests/qemu-iotests/297 | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iote

[PATCH v2 11/17] iotests/297: Separate environment setup from test execution

2021-07-20 Thread John Snow
Move environment setup into main(), leaving pure test execution behind in run_linters(). Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/297 | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a

[PATCH v2 05/17] iotests/migrate-bitmaps-test: delint

2021-07-20 Thread John Snow
Mostly uninteresting stuff. Move the test injections under a function named main() so that the variables used during that process aren't in the global scope. Signed-off-by: John Snow --- tests/qemu-iotests/tests/migrate-bitmaps-test | 70 +++ 1 file changed, 39 insertions(+

[PATCH v2 04/17] iotests/migrate-bitmaps-postcopy-test: declare instance variables

2021-07-20 Thread John Snow
Signed-off-by: John Snow --- tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test index 584062b4128..78dc19e3e3d 100755 --- a

[PATCH v2 08/17] iotests/297: Include sub-directories when finding tests to lint

2021-07-20 Thread John Snow
Choosing to interpret the SKIP_FILES list as a list of filenames instead of a list of paths, to keep things simple. Signed-off-by: John Snow --- tests/qemu-iotests/297 | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tests/qemu-iotests/297 b

[PATCH v2 03/17] iotests/mirror-top-perms: Adjust import paths

2021-07-20 Thread John Snow
Technically AbnormalShutdown isn't exported via 'qemu.machine.AbnormalShutdown', but instead from 'qemu.machine.machine.AbnormalShutdown'. Odd, I know, and it's on the list to fix. For now, change the imports here. Signed-off-by: John Snow --- tests/qemu-iote

[PATCH v2 06/17] iotests/297: modify is_python_file to work from any CWD

2021-07-20 Thread John Snow
Add a directory argument to is_python_file to allow it to work correctly no matter what CWD we happen to run it from. This is done in anticipation of running the iotests from another directory (./python/). Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu

[PATCH v2 01/17] iotests: use with-statement for open() calls

2021-07-20 Thread John Snow
aware of them at present. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 89663dac06d..beadf5c821c 100644 --- a/tests/qemu-iotests/iotests.py

[PATCH v2 00/17] python/iotests: Run iotest linters during Python CI

2021-07-20 Thread John Snow
# [SOB] JS [14] iotests-297-split-linters-py # [SOB] JS [17] iotests-297-check-mypy-files # [SOB] JS --js John Snow (17): iotests: use with-statement for open() calls iotests: use subprocess.DEVNULL instead of open("/dev/null") iotests/mirror-top-perms: Adjust import paths

[PATCH v2 02/17] iotests: use subprocess.DEVNULL instead of open("/dev/null")

2021-07-20 Thread John Snow
Avoids a warning from pylint not to use open() outside of a with-statement, and is ... probably more portable anyway. Not that I think we care too much about running tests *on* Windows, but... eh. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 14 +++--- 1 file changed, 7

Re: [PATCH 07/10] iotests/297: return error code from run_linters()

2021-07-20 Thread John Snow
On Tue, Jul 13, 2021 at 5:44 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > 25.06.2021 21:20, John Snow wrote: > > This turns run_linters() into a bit of a hybrid test; returning non-zero > > on failed execution while also printing diffable information.

Re: [PATCH 02/10] iotests/297: Add get_files() function

2021-07-20 Thread John Snow
On Tue, Jul 6, 2021 at 5:02 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > 25.06.2021 21:20, John Snow wrote: > > Split out file discovery into its own method to begin separating out the > > "environment setup" and "test execution"

[PATCH 0/2] remove socket_scm_helper

2021-07-16 Thread John Snow
GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-socket-scm-helper CI: https://gitlab.com/jsnow/qemu/-/pipelines/338595177 19 insertions(+) 208 deletions(-) Seems good to me ...? --js John Snow (2): python/qmp: add send_fd_scm directly to QEMUMonitorProtocol python, iotests: remove

[PATCH 2/2] python, iotests: remove socket_scm_helper

2021-07-16 Thread John Snow
It's not used anymore, now. Signed-off-by: John Snow --- tests/qemu-iotests/socket_scm_helper.c | 136 - python/qemu/machine/machine.py | 3 - python/qemu/machine/qtest.py | 2 - tests/Makefile.include | 1 - tests/meson.

[PATCH 1/2] python/qmp: add send_fd_scm directly to QEMUMonitorProtocol

2021-07-16 Thread John Snow
which allows me to construct a different implementation -- a Synchronous wrapper around my Async QMP library. Signed-off-by: John Snow --- python/qemu/machine/machine.py | 44 +++--- python/qemu/qmp/__init__.py| 21 +++- 2 files changed, 18 insertions(+

Re: [PATCH 07/10] iotests/297: return error code from run_linters()

2021-07-12 Thread John Snow
On Tue, Jul 6, 2021 at 5:49 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > 25.06.2021 21:20, John Snow wrote: > > This turns run_linters() into a bit of a hybrid test; returning non-zero > > on failed execution while also printing diffable information.

Re: [PATCH v7 00/16] qemu_iotests: improve debugging options

2021-06-28 Thread John Snow
d option to the debug section of QEMU > iotests > qemu-iotests: add option to show qemu binary logs on stdout > docs/devel/testing: add -p option to the debug section of QEMU iotests > > John Snow (1): > python: Reduce strictness of pylint's duplicate-code check

[PATCH 10/10] python: Add iotest linters to test suite

2021-06-25 Thread John Snow
As a convenience, since iotests is an extremely prominent user of the qemu.qmp and qemu.machine packages and already implements a linting regime, run those tests as well so that it's very hard to miss regressions caused by changes to the python library. Signed-off-by: John Snow --- python/

[PATCH 09/10] iotests/linters: Add entry point for Python CI linters

2021-06-25 Thread John Snow
onvenient for block maintainers and contributors to run in this manner. See the following commit for how this is used from the Python packaging side. Signed-off-by: John Snow --- tests/qemu-iotests/linters.py | 13 + 1 file changed, 13 insertions(+) diff --git a/tests/qemu-i

[PATCH 08/10] iotests/297: split linters.py off from 297

2021-06-25 Thread John Snow
files that instruct these tools how to run properly in this directory, but ... not yet, and not in this series. Signed-off-by: John Snow --- tests/qemu-iotests/297| 105 ++ tests/qemu-iotests/linters.py | 117 ++ 2 files changed

[PATCH 06/10] iotests/297: Add 'directory' argument to run_linters

2021-06-25 Thread John Snow
Allow run_linters to work well if it's executed from a different directory. Signed-off-by: John Snow --- tests/qemu-iotests/297 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297 index c7428af901..1e8334d1d4 100755 --- a/tests/qemu-iotest

[PATCH 04/10] iotests/297: Create main() function

2021-06-25 Thread John Snow
Instead of running "run_linters" directly, create a main() function that will be responsible for environment setup, leaving run_linters() responsible only for execution of the linters. (That environment setup will be moved over in forthcoming commits.) Signed-off-by: John Snow ---

[PATCH 07/10] iotests/297: return error code from run_linters()

2021-06-25 Thread John Snow
: universal_newlines is added to the pylint invocation for type consistency with the mypy run -- it's not strictly necessary, but it avoids some typing errors caused by our re-use of the 'p' variable.) Signed-off-by: John Snow --- tests/qemu-iotests/297 | 10 -- 1 file changed, 8 i

[PATCH 03/10] iotests/297: Don't rely on distro-specific linter binaries

2021-06-25 Thread John Snow
efore the test begins -- this check is now "overly strict", but shouldn't cause anything that was already running correctly to start failing. Signed-off-by: John Snow --- tests/qemu-iotests/297 | 45 -- 1 file changed, 26 insertions(+), 19 delet

[PATCH 02/10] iotests/297: Add get_files() function

2021-06-25 Thread John Snow
Split out file discovery into its own method to begin separating out the "environment setup" and "test execution" phases. Signed-off-by: John Snow --- tests/qemu-iotests/297 | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iote

[PATCH 05/10] iotests/297: Separate environment setup from test execution

2021-06-25 Thread John Snow
Move environment setup into main(), leaving pure test execution behind in run_linters(). Signed-off-by: John Snow --- tests/qemu-iotests/297 | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297

[PATCH 01/10] iotests/297: modify is_python_file to work from any CWD

2021-06-25 Thread John Snow
Add a directory argument to is_python_file to allow it to work correctly no matter what CWD we happen to run it from. This is done in anticipation of running the iotests from another directory (./python/). Signed-off-by: John Snow --- tests/qemu-iotests/297 | 8 +--- 1 file changed, 5

[PATCH 00/10] python/iotests: Run iotest linters during Python CI

2021-06-25 Thread John Snow
(5/5) tests/pylint.sh: PASS (4.10 s) RESULTS: PASS 5 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB TIME : 23.70 s ___ summary ___ py36: commands succeeded py37: commands succeeded py38: commands succ

[PULL 5/6] hw/block/fdc: Extract SysBus floppy controllers to fdc-sysbus.c

2021-06-25 Thread John Snow
From: Philippe Mathieu-Daudé Some machines use floppy controllers via the SysBus interface, and don't need to pull in all the SysBus code. Extract the SysBus specific code to a new unit: fdc-sysbus.c, and add a new Kconfig symbol: "FDC_SYSBUS". Reviewed-by: John Snow Acked-by: M

[PULL 2/6] hw/block/fdc: Replace disabled fprintf() by trace event

2021-06-25 Thread John Snow
From: Philippe Mathieu-Daudé Reviewed-by: John Snow Acked-by: Mark Cave-Ayland Reviewed-by: Mark Cave-Ayland Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-id: 20210614193220.2007159-3-phi...@redhat.com Signed-off-by: John Snow --- hw/block/fdc.c| 7

[PULL 1/6] hw/isa/Kconfig: Fix missing dependency ISA_SUPERIO -> FDC

2021-06-25 Thread John Snow
From: Philippe Mathieu-Daudé isa_superio_realize() calls isa_fdc_init_drives(), which is defined in hw/block/fdc.c, so ISA_SUPERIO needs to select the FDC symbol. Reported-by: John Snow Reviewed-by: Thomas Huth Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-id

[PULL 6/6] hw/block/fdc: Add description to floppy controllers

2021-06-25 Thread John Snow
t;virtual floppy drive" name "isa-fdc", bus ISA, desc "virtual floppy controller" Signed-off-by: Philippe Mathieu-Daudé Message-id: 20210614193220.2007159-7-phi...@redhat.com Signed-off-by: John Snow --- hw/block/fdc-isa.c| 1 + hw/block/fdc-sysbus.c | 2 ++ 2 file

[PULL 4/6] hw/block/fdc: Extract ISA floppy controllers to fdc-isa.c

2021-06-25 Thread John Snow
mit dd0ff8191ab ("isa: express SuperIO dependencies with Kconfig"). Reviewed-by: John Snow Acked-by: Mark Cave-Ayland Reviewed-by: Mark Cave-Ayland Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-id: 20210614193220.2007159-5-phi...@redhat.com Signed-off-by: John Snow

<    7   8   9   10   11   12   13   14   15   16   >