[PATCH v2 15/15] iotests: [RFC] drop iotest 297

2021-10-19 Thread John Snow
(This is highlighting a what-if, which might make it clear why any special infrastructure is still required at all. It's not intended to actually be merged at this step -- running JUST the iotest linters from e.g. 'make check' is not yet accommodated, so there's no suitable replacement for 297 for

[PATCH v2 13/15] iotests/linters: Add workaround for mypy bug #9852

2021-10-19 Thread John Snow
This one is insidious: if you write an import as "from {namespace} import {subpackage}" as mirror-top-perms (now) does, mypy will fail on every-other invocation *if* the package being imported is a typed, installed, namespace-scoped package. Upsettingly, that's exactly what

[PATCH v2 11/15] iotests: split linters.py out from 297

2021-10-19 Thread John Snow
Now, 297 is just the iotests-specific incantations and linters.py is as minimal as I can think to make it. The only remaining element in here that ought to be configuration and not code is the list of skip files, but they're still numerous enough that repeating them for mypy and pylint

[PATCH v2 10/15] iotests/297: split test into sub-cases

2021-10-19 Thread John Snow
Take iotest 297's main() test function and split it into two sub-cases that can be skipped individually. We can also drop custom environment setup from the pylint test as it isn't needed. Signed-off-by: John Snow --- tests/qemu-iotests/297 | 63 ++ 1 file

[PATCH v2 12/15] iotests/linters: Add entry point for linting via Python CI

2021-10-19 Thread John Snow
We need at least a tiny little shim here to join test file discovery with test invocation. This logic could conceivably be hosted somewhere in python/, but I felt it was strictly the least-rude thing to keep the test logic here in iotests/, even if this small function isn't itself an iotest. Note

[PATCH v2 09/15] iotests/297: update tool availability checks

2021-10-19 Thread John Snow
As mentioned in 'iotests/297: Don't rely on distro-specific linter binaries', these checks are overly strict. Update them to be in-line with how we actually invoke the linters themselves. Signed-off-by: John Snow --- tests/qemu-iotests/297 | 9 + 1 file changed, 5 insertions(+), 4

[PATCH v2 08/15] iotests/297: Change run_linter() to raise an exception on failure

2021-10-19 Thread John Snow
Instead of using a process return code as the python function return value (or just not returning anything at all), allow run_linter() to raise an exception instead. The responsibility for printing output on error shifts from the function itself to the caller, who will know best how to

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

2021-10-19 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 Reviewed-by:

[PATCH v2 02/15] iotests/297: Split mypy configuration out into mypy.ini

2021-10-19 Thread John Snow
More separation of code and configuration. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/297 | 14 +- tests/qemu-iotests/mypy.ini | 12 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 tests/qemu-iotests/mypy.ini

[PATCH v2 01/15] iotests/297: Move pylint config into pylintrc

2021-10-19 Thread John Snow
Move --score=n and --notes=XXX,FIXME into pylintrc. This pulls configuration out of code, which I think is probably a good thing in general. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/297 | 4 +--- tests/qemu-iotests/pylintrc | 16 2 files

[PATCH v2 14/15] python: Add iotest linters to test suite

2021-10-19 Thread John Snow
Run mypy and pylint on the iotests files directly from the Python CI test infrastructure. This ensures that any accidental breakages to the qemu.[qmp|aqmp|machine|utils] packages will be caught by that test suite. It also ensures that these linters are run with well-known versions and test

[PATCH v2 06/15] iotests/297: Split run_linters apart into run_pylint and run_mypy

2021-10-19 Thread John Snow
Move environment setup into main(), and split the actual linter execution into run_pylint and run_mypy, respectively. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/297 | 38 -- 1 file changed, 24 insertions(+), 14 deletions(-)

[PATCH v2 07/15] iotests/297: refactor run_[mypy|pylint] as generic execution shim

2021-10-19 Thread John Snow
There's virtually nothing special here anymore; we can combine these into a single, rather generic function. Signed-off-by: John Snow --- tests/qemu-iotests/297 | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git

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

2021-10-19 Thread John Snow
'pylint-3' is another Fedora-ism. Use "python3 -m pylint" or "python3 -m mypy" to access these scripts instead. This style of invocation will prefer the "correct" tool when run in a virtual environment. Note that we still check for "pylint-3" before the test begins -- this check is now "overly

[PATCH v2 03/15] iotests/297: Add get_files() function

2021-10-19 Thread John Snow
Split out file discovery into its own method to begin separating out configuration/setup and test execution. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/297 | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/297

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

2021-10-19 Thread John Snow
GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-package-iotest-pt2 CI: https://gitlab.com/jsnow/qemu/-/pipelines/388626603 (There's no real rush on my part for this particular series, so review at-leisure, I'm just getting my edits back out onto the list. The AQMP series is more important

Re: [PATCH V5] block/rbd: implement bdrv_co_block_status

2021-10-19 Thread Kevin Wolf
Am 12.10.2021 um 17:22 hat Peter Lieven geschrieben: > the qemu rbd driver currently lacks support for bdrv_co_block_status. > This results mainly in incorrect progress during block operations (e.g. > qemu-img convert with an rbd image as source). > > This patch utilizes the rbd_diff_iterate2

Re: [PATCH] block: Fail gracefully when blockdev-snapshot creates loops

2021-10-19 Thread Kevin Wolf
Am 18.10.2021 um 16:22 hat Vladimir Sementsov-Ogievskiy geschrieben: > 18.10.2021 16:47, Kevin Wolf wrote: > > Using blockdev-snapshot to append a node as an overlay to itself, or to > > any of its parents, causes crashes. Catch the condition and return an > > error for these cases instead. > > >

Re: [PATCH v2] block/file-posix: Fix return value translation for AIO discards.

2021-10-19 Thread Kevin Wolf
Am 19.10.2021 um 13:09 hat Ari Sundholm geschrieben: > AIO discards regressed as a result of the following commit: > 0dfc7af2 block/file-posix: Optimize for macOS > > When trying to run blkdiscard within a Linux guest, the request would > fail, with some errors in dmesg: > > [ snip ]

[PATCH v2] block/file-posix: Fix return value translation for AIO discards.

2021-10-19 Thread Ari Sundholm
AIO discards regressed as a result of the following commit: 0dfc7af2 block/file-posix: Optimize for macOS When trying to run blkdiscard within a Linux guest, the request would fail, with some errors in dmesg: [ snip ] [4.010070] sd 2:0:0:0: [sda] tag#0 FAILED Result:

Re: [PATCH v2 12/15] virtio-net: Store failover primary opts pointer locally

2021-10-19 Thread Kevin Wolf
Am 19.10.2021 um 10:06 hat Laurent Vivier geschrieben: > On 08/10/2021 15:34, Kevin Wolf wrote: > > Instead of accessing the global QemuOptsList, which really belong to the > > command line parser and shouldn't be accessed from devices, store a > > pointer to the QemuOpts in a new VirtIONet field.

Re: [PATCH] block/file-posix: Fix return value translation for AIO discards.

2021-10-19 Thread Stefan Hajnoczi
On Tue, Oct 19, 2021 at 05:40:13AM +0200, Philippe Mathieu-Daudé wrote: > +Stefan > > On 10/18/21 20:07, Ari Sundholm wrote: > > AIO discards regressed as a result of the following commit: > > 0dfc7af2 block/file-posix: Optimize for macOS > > > > When trying to run blkdiscard within a Linux

Re: [PULL 37/40] monitor: Tidy up find_device_state()

2021-10-19 Thread Markus Armbruster
Markus Armbruster writes: > Christian Borntraeger writes: > >> Am 13.10.21 um 11:07 schrieb Paolo Bonzini: >>> From: Markus Armbruster >>> Commit 6287d827d4 "monitor: allow device_del to accept QOM paths" >>> extended find_device_state() to accept QOM paths in addition to qdev >>> IDs. This

Re: [PATCH v2 12/15] virtio-net: Store failover primary opts pointer locally

2021-10-19 Thread Laurent Vivier
On 08/10/2021 15:34, Kevin Wolf wrote: Instead of accessing the global QemuOptsList, which really belong to the command line parser and shouldn't be accessed from devices, store a pointer to the QemuOpts in a new VirtIONet field. This is not the final state, but just an intermediate step to get