Re: [PATCH v2 0/3] virtio: increase VIRTQUEUE_MAX_SIZE to 32k

2021-11-01 Thread Christian Schoenebeck
On Donnerstag, 28. Oktober 2021 11:00:48 CET Stefan Hajnoczi wrote: > On Mon, Oct 25, 2021 at 05:03:25PM +0200, Christian Schoenebeck wrote: > > On Montag, 25. Oktober 2021 12:30:41 CEST Stefan Hajnoczi wrote: > > > On Thu, Oct 21, 2021 at 05:39:28PM +0200, Christian Schoenebeck wrote: > > > > On F

[PULL 22/22] python, iotests: replace qmp with aqmp

2021-11-01 Thread John Snow
Swap out the synchronous QEMUMonitorProtocol from qemu.qmp with the sync wrapper from qemu.aqmp instead. Add an escape hatch in the form of the environment variable QEMU_PYTHON_LEGACY_QMP which allows you to cajole QEMUMachine into using the old implementation, proving that both implementations wo

[PULL 21/22] python/aqmp: Create sync QMP wrapper for iotests

2021-11-01 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 Acked-by: Hanna Reitz Reviewed-by:

[PULL 16/22] python/machine: Handle QMP errors on close more meticulously

2021-11-01 Thread John Snow
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 freebie in the async world; it may return errors encountered in the async bottom half on incoming message receipt, etc. (AQMP's disconnect, ultima

[PULL 15/22] python/machine: remove has_quit argument

2021-11-01 Thread John Snow
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 this instance variable for wait(), where we use it to mean "don't issue the qmp 'quit' command". This means that wait() will "fail" if the QEM

[PULL 13/22] iotests/linters: Add workaround for mypy bug #9852

2021-11-01 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 'qemu.[aqmp|qmp|machine

[PULL 09/22] iotests/297: update tool availability checks

2021-11-01 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 Reviewed-by: Hanna Reitz Message-id: 20211019144918.3159078-10-js...@redhat.com Sig

[PULL 20/22] iotests/300: avoid abnormal shutdown race condition

2021-11-01 Thread John Snow
Wait for the destination VM to close itself instead of racing to shut it down first, which produces different error log messages from AQMP depending on precisely when we tried to shut it down. (For example: We may try to issue 'quit' immediately prior to the target VM closing its QMP socket, which

[PULL 19/22] iotests: Conditionally silence certain AQMP errors

2021-11-01 Thread John Snow
AQMP likes to be very chatty about errors it encounters. In general, this is good because it allows us to get good diagnostic information for otherwise complex async failures. For example, during a failed QMP connection attempt, we might see: +ERROR:qemu.aqmp.qmp_client.qemub-2536319:Negotiation

[PULL 18/22] iotests: Accommodate async QMP Exception classes

2021-11-01 Thread John Snow
(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. If you'd like to check for yourself, you want to grep for all of the derivatives of QMPError, excluding 'AQMPError' and its derivatives. T

Re: [PATCH v2 1/5] hw/sd: add nuvoton MMC

2021-11-01 Thread Richard Henderson
On 11/1/21 1:18 PM, Peter Maydell wrote: On Fri, 8 Oct 2021 at 01:26, Hao Wu wrote: From: Shengtan Mao Signed-off-by: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Chris Rauer Reviewed-by: Tyrone Ting Signed-off-by: Hao Wu --- +default: +qemu_log_mask(LOG_GUEST_ERROR, "S

[PULL 14/22] python: Add iotest linters to test suite

2021-11-01 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 against

[PULL 07/22] iotests/297: refactor run_[mypy|pylint] as generic execution shim

2021-11-01 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 Reviewed-by: Hanna Reitz Message-id: 20211019144918.3159078-8-js...@redhat.com Signed-off-by: John Snow --- tests/qemu-iotests/297 | 42 ++--

[PULL 05/22] iotests/297: Don't rely on distro-specific linter binaries

2021-11-01 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 str

[PULL 12/22] iotests/linters: Add entry point for linting via Python CI

2021-11-01 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

[PULL 17/22] python/aqmp: Remove scary message

2021-11-01 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 Acked-by: Hanna Reitz Reviewed-by: Kevin Wolf Reviewed-by: Hanna Reitz Message

[PULL 11/22] iotests: split linters.py out from 297

2021-11-01 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 configuratio

[PULL 10/22] iotests/297: split test into sub-cases

2021-11-01 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 Reviewed-by: Hanna Reitz Message-id: 20211019144918.3159078-11-js...@redhat.com Sig

[PULL 08/22] iotests/297: Change run_linter() to raise an exception on failure

2021-11-01 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 present/for

[PULL 04/22] iotests/297: Create main() function

2021-11-01 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: Vladi

[PULL 06/22] iotests/297: Split run_linters apart into run_pylint and run_mypy

2021-11-01 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 Message-id: 20211019144918.3159078-7-js...@redhat.com Signed-off-by: John Snow --- tests/qemu-iotests/297 | 38 +++

[PULL 03/22] iotests/297: Add get_files() function

2021-11-01 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 Message-id: 20211019144918.3159078-4-js...@redhat.com Signed-off-by: John Snow --- tests/qemu-iotests/297 | 9 +++-- 1 file changed

[PULL 02/22] iotests/297: Split mypy configuration out into mypy.ini

2021-11-01 Thread John Snow
More separation of code and configuration. Signed-off-by: John Snow Reviewed-by: Hanna Reitz Message-id: 20211019144918.3159078-3-js...@redhat.com Signed-off-by: John Snow --- tests/qemu-iotests/297 | 14 +- tests/qemu-iotests/mypy.ini | 12 2 files changed, 13 in

[PULL 01/22] iotests/297: Move pylint config into pylintrc

2021-11-01 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 Message-id: 20211019144918.3159078-2-js...@redhat.com Signed-off-by: John Snow --- tests/qemu-iotests/2

[PULL 00/22] Python patches

2021-11-01 Thread John Snow
The following changes since commit af531756d25541a1b3b3d9a14e72e7fedd941a2e: Merge remote-tracking branch 'remotes/philmd/tags/renesas-20211030' into staging (2021-10-30 11:31:41 -0700) are available in the Git repository at: https://gitlab.com/jsnow/qemu.git tags/python-pull-request for y

Re: [PATCH v2 5/5] tests/qtest: add qtests for npcm7xx sdhci

2021-11-01 Thread Peter Maydell
On Fri, 8 Oct 2021 at 01:26, Hao Wu wrote: > > From: Shengtan Mao > > Signed-off-by: Shengtan Mao > Reviewed-by: Hao Wu > Reviewed-by: Chris Rauer > Reviewed-by: Tyrone Ting > Signed-off-by: Hao Wu Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v2 4/5] tests/qtest/libqos: add SDHCI commands

2021-11-01 Thread Peter Maydell
On Fri, 8 Oct 2021 at 01:26, Hao Wu wrote: > > From: Shengtan Mao > > Signed-off-by: Shengtan Mao > Reviewed-by: Hao Wu > Reviewed-by: Chris Rauer > Reviewed-by: Tyrone Ting > Signed-off-by: Hao Wu > --- > tests/qtest/libqos/meson.build | 1 + > tests/qtest/libqos/sdhci-cmd.c | 116 ++

Re: [PATCH v2 1/5] hw/sd: add nuvoton MMC

2021-11-01 Thread Peter Maydell
On Fri, 8 Oct 2021 at 01:26, Hao Wu wrote: > > From: Shengtan Mao > > Signed-off-by: Shengtan Mao > Reviewed-by: Hao Wu > Reviewed-by: Chris Rauer > Reviewed-by: Tyrone Ting > Signed-off-by: Hao Wu > --- > +default: > +qemu_log_mask(LOG_GUEST_ERROR, "SDHCI read of nonexist reg:

Re: [PATCH v2 2/5] hw/arm: Add Nuvoton SD module to board

2021-11-01 Thread Peter Maydell
On Fri, 8 Oct 2021 at 01:26, Hao Wu wrote: > > From: Shengtan Mao > > Signed-off-by: Shengtan Mao > Reviewed-by: Hao Wu > Reviewed-by: Chris Rauer > Reviewed-by: Tyrone Ting > Signed-off-by: Hao Wu Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v3 2/4] qemu-img: make --block-size optional for compare --stat

2021-11-01 Thread Eric Blake
On Mon, Nov 01, 2021 at 11:03:22AM +0300, Vladimir Sementsov-Ogievskiy wrote: > 29.10.2021 23:32, Eric Blake wrote: > > On Thu, Oct 28, 2021 at 12:24:39PM +0200, Vladimir Sementsov-Ogievskiy > > wrote: > > > Let's detect block-size automatically if not specified by user: > > > > > > If both fil

Re: [PATCH v3 3/4] qemu-img: add --shallow option for qemu-img compare

2021-11-01 Thread Vladimir Sementsov-Ogievskiy
29.10.2021 23:44, Eric Blake wrote: On Thu, Oct 28, 2021 at 12:24:40PM +0200, Vladimir Sementsov-Ogievskiy wrote: Allow compare only top images of backing chains. This is useful to Allow the comparison of only the top image of backing chains. compare images with same backing file or to compa

Re: [PATCH v3 2/4] qemu-img: make --block-size optional for compare --stat

2021-11-01 Thread Vladimir Sementsov-Ogievskiy
29.10.2021 23:32, Eric Blake wrote: On Thu, Oct 28, 2021 at 12:24:39PM +0200, Vladimir Sementsov-Ogievskiy wrote: Let's detect block-size automatically if not specified by user: If both files define cluster-size, use minimum to be more precise. If both files don't specify cluster-size, use