[PATCH v2 3/8] tests/qemu-iotests/meson.build: Improve the indentation

2022-02-09 Thread Thomas Huth
By using subdir_done(), we can get rid of one level of indentation in this file. This will make it easier to add more conditions to skip the iotests in future patches. Reviewed-by: Hanna Reitz Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/qemu-iotests/meson.build | 6

[PATCH v2 8/8] tests: Remove check-block.sh

2022-02-09 Thread Thomas Huth
Now that the iotests are added by the meson.build file already, we do not need the check-block.sh wrapper script anymore. Signed-off-by: Thomas Huth --- tests/check-block.sh | 73 1 file changed, 73 deletions(-) delete mode 100755 tests/check-block.s

[PATCH v2 0/8] Improve integration of iotests in the meson test harness

2022-02-09 Thread Thomas Huth
Though "make check-block" is currently already run via the meson test runner, it still looks like an oddball in the output of "make check" since the tests are still run separately via the check-block.sh script. It would be nicer if the iotests would show up like the other tests suites. For this we

[PATCH v2 7/8] tests/qemu-iotests/testrunner: Print diff to stderr in TAP mode

2022-02-09 Thread Thomas Huth
When running in TAP mode, stdout is reserved for the TAP protocol. To see the "diff" of the failed test, we have to print it to stderr instead. Signed-off-by: Thomas Huth --- tests/qemu-iotests/testrunner.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotes

[PATCH v2 5/8] tests/qemu-iotests/meson.build: Call the 'check' script directly

2022-02-09 Thread Thomas Huth
We can get a nicer progress indication if we add the iotests individually via the 'check' script instead of going through the check-block.sh wrapper. For this, we have to add some of the sanity checks that have originally been done in the tests/check-block.sh script (whether "bash" is available or

[PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations

2022-02-09 Thread Thomas Huth
If multiple tests run in parallel, they must use unique file names for the test output. Suggested-by: Hanna Reitz Signed-off-by: Thomas Huth --- tests/qemu-iotests/testrunner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iot

[PATCH v2 4/8] tests/qemu-iotests: Allow to run "./check -n" from the source directory, too

2022-02-09 Thread Thomas Huth
For better integration of the iotests into the meson build system, it would be very helpful to get the list of the tests in the "auto" group during the "configure" step already. However, "check -n -g auto" currently only works if the binaries have already been built. To fix this, skip the check for

[PATCH v2 2/8] tests/qemu-iotests: Improve the check for GNU sed

2022-02-09 Thread Thomas Huth
Instead of failing the iotests if GNU sed is not available (or skipping them completely in the check-block.sh script), it would be better to simply skip the bash-based tests, so that the python-based tests could still be run. Thus add the check for BusyBox sed to common.rc and mark the tests as "no

[PATCH v2 6/8] tests: Do not treat the iotests as separate meson test target anymore

2022-02-09 Thread Thomas Huth
Now that we add the single iotests directly in meson.build, we do not have to separate the block suite from the other suits anymore. Signed-off-by: Thomas Huth --- meson.build| 6 +++--- scripts/mtest2make.py | 4 tests/Makefile.include | 9 + 3 files changed, 4 inserti

[PATCH 1/5] crypto: perform permission checks under BQL

2022-02-09 Thread Emanuele Giuseppe Esposito
Move the permission API calls into driver-specific callbacks that always run under BQL. In this case, bdrv_crypto_luks needs to perform permission checks before and after qcrypto_block_amend_options(). The problem is that the caller, block_crypto_amend_options_generic_luks(), can also run in I/O fr

[PATCH 2/5] crypto: distinguish between main loop and I/O in block_crypto_amend_options_generic_luks

2022-02-09 Thread Emanuele Giuseppe Esposito
block_crypto_amend_options_generic_luks uses the block layer permission API, therefore it should be called with the BQL held. However, the same function is being called by two BlockDriver callbacks: bdrv_amend_options (under BQL) and bdrv_co_amend (I/O). The latter is I/O because it is invoked by

[PATCH 3/5] block: introduce bdrv_activate

2022-02-09 Thread Emanuele Giuseppe Esposito
This function is currently just a wrapper for bdrv_invalidate_cache(), but in future will contain the code of bdrv_co_invalidate_cache() that has to always be protected by BQL, and leave the rest in the I/O coroutine. Replace all bdrv_invalidate_cache() invokations with bdrv_activate(). Signed-of

[PATCH 4/5] block: rename bdrv_invalidate_cache_all, blk_invalidate_cache and test_sync_op_invalidate_cache

2022-02-09 Thread Emanuele Giuseppe Esposito
Following the bdrv_activate renaming, change also the name of the respective callers. bdrv_invalidate_cache_all -> bdrv_activate_all blk_invalidate_cache -> blk_activate test_sync_op_invalidate_cache -> test_sync_op_activate No functional change intended. Signed-off-by: Emanuele Giuseppe Esposit

[PATCH 5/5] block: move BQL logic of bdrv_co_invalidate_cache in bdrv_activate

2022-02-09 Thread Emanuele Giuseppe Esposito
Split bdrv_co_invalidate cache in two: the Global State (under BQL) code that takes care of permissions and running GS callbacks, and leave only the I/O code (->bdrv_co_invalidate_cache) running in the I/O coroutine. The only side effect is that bdrv_co_invalidate_cache is not recursive anymore, a

[PATCH 0/5] block layer: permission API refactoring in preparation

2022-02-09 Thread Emanuele Giuseppe Esposito
This serie aims to refactoring and fixing permission API related bugs that came up in the serie "block layer: split block APIs in global state and I/O". In that serie, we are splitting all block layer headers in Global State (GS) APIs, holding always the BQL and running in the main loop, and I/O ru

downstream extensions

2022-02-09 Thread Vladimir Sementsov-Ogievskiy
Hi all! We declare a kind of __com.redhat_drive-mirror syntax for downstream extensions of QAPI. That's inconvenient: Assume I want to merge now my keep-dirty option for Qcow2 driver "[PATCH v2 0/2] qcow2: add keep-dirty open option" to our downstream. To avoid possible conflicts with upstre

[PULL 5/7] iotests/281: Test lingering timers

2022-02-09 Thread Vladimir Sementsov-Ogievskiy
From: Hanna Reitz Prior to "block/nbd: Delete reconnect delay timer when done" and "block/nbd: Delete open timer when done", both of those timers would remain scheduled even after successfully (re-)connecting to the server, and they would not even be deleted when the BDS is deleted. This test co

[PULL 1/7] block/nbd: Delete reconnect delay timer when done

2022-02-09 Thread Vladimir Sementsov-Ogievskiy
From: Hanna Reitz We start the reconnect delay timer to cancel the reconnection attempt after a while. Once nbd_co_do_establish_connection() has returned, this attempt is over, and we no longer need the timer. Delete it before returning from nbd_reconnect_attempt(), so that it does not persist

[PULL 6/7] block/nbd: Move s->ioc on AioContext change

2022-02-09 Thread Vladimir Sementsov-Ogievskiy
From: Hanna Reitz s->ioc must always be attached to the NBD node's AioContext. If that context changes, s->ioc must be attached to the new context. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2033626 Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Reitz --- block/nbd.

[PULL 7/7] iotests/281: Let NBD connection yield in iothread

2022-02-09 Thread Vladimir Sementsov-Ogievskiy
From: Hanna Reitz Put an NBD block device into an I/O thread, and then read data from it, hoping that the NBD connection will yield during that read. When it does, the coroutine must be reentered in the block device's I/O thread, which will only happen if the NBD block driver attaches the connec

[PULL 08/28] drop libxml2 checks since libxml is not actually used (for parallels)

2022-02-09 Thread Alex Bennée
From: Michael Tokarev For a long time, we assumed that libxml2 is necessary for parallels block format support (block/parallels*). However, this format actually does not use libxml [*]. Since this is the only user of libxml2 in whole QEMU tree, we can drop all libxml2 checks and dependencies too.

[PULL 3/7] block/nbd: Assert there are no timers when closed

2022-02-09 Thread Vladimir Sementsov-Ogievskiy
From: Hanna Reitz Our two timers must not remain armed beyond nbd_clear_bdrvstate(), or they will access freed data when they fire. This patch is separate from the patches that actually fix the issue (HEAD^^ and HEAD^) so that you can run the associated regression iotest (281) on a configuration

[PULL 0/7] nbd: handle AioContext change correctly

2022-02-09 Thread Vladimir Sementsov-Ogievskiy
The following changes since commit 0a301624c2f4ced3331ffd5bce85b4274fe132af: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20220208' into staging (2022-02-08 11:40:08 +) are available in the Git repository at: https://src.openvz.org/scm/~vsementsov/qemu.git tags/pu

[PULL 2/7] block/nbd: Delete open timer when done

2022-02-09 Thread Vladimir Sementsov-Ogievskiy
From: Hanna Reitz We start the open timer to cancel the connection attempt after a while. Once nbd_do_establish_connection() has returned, the attempt is over, and we no longer need the timer. Delete it before returning from nbd_open(), so that it does not persist for longer. It has no use afte

[PULL 4/7] iotests.py: Add QemuStorageDaemon class

2022-02-09 Thread Vladimir Sementsov-Ogievskiy
From: Hanna Reitz This is a rather simple class that allows creating a QSD instance running in the background and stopping it when no longer needed. The __del__ handler is a safety net for when something goes so wrong in a test that e.g. the tearDown() method is not called (e.g. setUp() launches

[PATCH] hw/block/fdc-isa: Respect QOM properties when building AML

2022-02-09 Thread Bernhard Beschow
Other ISA devices such as serial-isa use the properties in their build_aml functions. fdc-isa not using them is probably an oversight. Signed-off-by: Bernhard Beschow --- hw/block/fdc-isa.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/block/fdc-isa.c b/hw/bl

Re: [PATCH] hw/block/fdc-isa: Respect QOM properties when building AML

2022-02-09 Thread Philippe Mathieu-Daudé via
On 9/2/22 20:15, Bernhard Beschow wrote: Other ISA devices such as serial-isa use the properties in their build_aml functions. fdc-isa not using them is probably an oversight. Signed-off-by: Bernhard Beschow --- hw/block/fdc-isa.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletion

Re: downstream extensions

2022-02-09 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Hi all! > > We declare a kind of __com.redhat_drive-mirror syntax for downstream > extensions of QAPI. > > That's inconvenient: > > Assume I want to merge now my keep-dirty option for Qcow2 driver "[PATCH v2 > 0/2] qcow2: add keep-dirty open option" to our