[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/iote

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

2022-02-02 Thread John Snow
We don't have to maintain compatibility with both QMP libraries anymore, so we can just remove the old exception. While we're here, take advantage of the extra fields present in the VMLaunchFailure exception that machine.py now raises. (Note: I'm leaving the logging suppression here unchanged. I h

[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 a/

[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
Based-on: <20220203015946.1330386-1-js...@redhat.com> [PULL 0/4] Python patches GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-qmp-legacy-switch-pt1b This tiny series is a spiritual v4 to: "[PATCH v3 00/31] Python: delete synchronous qemu.qmp package". I've isolated just the bit

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

2022-02-02 Thread John Snow
The synchronous QMP library would bind to the server address during __init__(). The new library delays this to the accept() call, because binding occurs inside of the call to start_[unix_]server(), which is an async method -- so it cannot happen during __init__ anymore. Python 3.7+ adds the abilit

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

2022-02-02 Thread John Snow
We need a slightly newer version of mypy in order to use some features of the asyncio server functions in the next commit. (Note: pipenv is not really suited to upgrading individual packages; I need to replace this tool with something better for the task. For now, the miscellaneous updates not rel

[PULL 0/4] Python patches

2022-02-02 Thread John Snow
The following changes since commit 47cc1a3655135b89fa75c2824fbddd29df874612: Merge remote-tracking branch 'remotes/kwolf-gitlab/tags/for-upstream' into staging (2022-02-01 19:48:15 +) are available in the Git repository at: https://gitlab.com/jsnow/qemu.git tags/python-pull-request for

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

2022-02-02 Thread John Snow
This allows us to pack in some extra information about the failure, which guarantees that if the caller did not *intentionally* cause a failure (by capturing this Exception), some pretty good clues will be printed at the bottom of the traceback information. This will help make failures in the even

[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...@redhat.com Signed-off-by

[RFC] thread-pool: Add option to fix the pool size

2022-02-02 Thread Nicolas Saenz Julienne
The thread pool regulates itself: when idle, it kills threads until empty, when in demand, it creates new threads until full. This behaviour doesn't play well with latency sensitive workloads where the price of creating a new thread is too high. For example, when paired with qemu's '-mlock', or usi

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 library would bind to the server address during > >

Re: [PATCH v6 21/33] block: move BQL logic of bdrv_co_invalidate_cache in bdrv_activate

2022-02-02 Thread Kevin Wolf
Am 02.02.2022 um 18:27 hat Paolo Bonzini geschrieben: > On 1/27/22 12:03, Kevin Wolf wrote: > > > +int coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs, Error > > > **errp) > > > +{ > > > +Error *local_err = NULL; > > > + > > > +if (bs->drv->bdrv_co_invalidate_cache) { > > > +

Re: [PATCH v6 21/33] block: move BQL logic of bdrv_co_invalidate_cache in bdrv_activate

2022-02-02 Thread Paolo Bonzini
On 1/27/22 12:03, Kevin Wolf wrote: +int coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs, Error **errp) +{ +Error *local_err = NULL; + +if (bs->drv->bdrv_co_invalidate_cache) { +bs->drv->bdrv_co_invalidate_cache(bs, &local_err); +if (local_err) { +bs

Re: [PATCH 10/12] block.c: add subtree_drains where needed

2022-02-02 Thread Paolo Bonzini
On 2/2/22 16:37, Emanuele Giuseppe Esposito wrote: So we have disk B with backing file C, and new disk A that wants to have backing file C. I think I understand what you mean, so in theory the operation would be - create new child - add child to A->children list - add child to C->parents list S

Re: [PATCH 10/12] block.c: add subtree_drains where needed

2022-02-02 Thread Emanuele Giuseppe Esposito
On 01/02/2022 15:47, Vladimir Sementsov-Ogievskiy wrote: > 18.01.2022 19:27, Emanuele Giuseppe Esposito wrote: >> Protect bdrv_replace_child_noperm, as it modifies the >> graph by adding/removing elements to .children and .parents >> list of a bs. Use the newly introduced >> bdrv_subtree_drained

Re: [PULL 18/20] block/nbd: drop connection_co

2022-02-02 Thread Hanna Reitz
On 02.02.22 14:53, Eric Blake wrote: On Wed, Feb 02, 2022 at 12:49:36PM +0100, Fabian Ebner wrote: Am 27.09.21 um 23:55 schrieb Eric Blake: From: Vladimir Sementsov-Ogievskiy OK, that's a big rewrite of the logic. Pre-patch we have an always running coroutine - connection_co. It does reply r

Re: multiple connections per block device with NBD?

2022-02-02 Thread Eric Blake
On Wed, Feb 02, 2022 at 02:42:02AM +0530, Sam wrote: > Hello, > > I am wondering whether NBD integration of qemu is able to establish multiple > connections to remote NBD server for a single block device. nbd-client has > this option: > > -C, --connections > Use num connections to the server, t

Re: [PULL 18/20] block/nbd: drop connection_co

2022-02-02 Thread Eric Blake
On Wed, Feb 02, 2022 at 12:49:36PM +0100, Fabian Ebner wrote: > Am 27.09.21 um 23:55 schrieb Eric Blake: > > From: Vladimir Sementsov-Ogievskiy > > > > OK, that's a big rewrite of the logic. > > > > Pre-patch we have an always running coroutine - connection_co. It does > > reply receiving and re

Re: [PULL 18/20] block/nbd: drop connection_co

2022-02-02 Thread Fabian Ebner
Am 27.09.21 um 23:55 schrieb Eric Blake: > From: Vladimir Sementsov-Ogievskiy > > OK, that's a big rewrite of the logic. > > Pre-patch we have an always running coroutine - connection_co. It does > reply receiving and reconnecting. And it leads to a lot of difficult > and unobvious code around d

Re: [PULL 00/10] Block layer patches

2022-02-02 Thread Peter Maydell
On Tue, 1 Feb 2022 at 15:21, Kevin Wolf wrote: > > The following changes since commit 804b30d25f8d70dc2dea951883ea92235274a50c: > > Merge remote-tracking branch 'remotes/legoater/tags/pull-ppc-20220130' into > staging (2022-01-31 11:10:08 +) > > are available in the Git repository at: > >