Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs

2023-05-09 Thread Olaf Hering
Resuming this old thread about an unfixed bug, which was introduced in qemu-4.2: qemu ends up in piix_ide_reset from pci_unplug_disks. This was not the case prior 4.2, the removed call to qemu_register_reset(piix3_reset, d) in ee358e919e385fdc79d59d0d47b4a81e349cd5c9 did apparently nothing. In

Re: [PATCH v5 05/21] virtio-scsi: stop using aio_disable_external() during unplug

2023-05-09 Thread Stefan Hajnoczi
On Tue, May 09, 2023 at 08:55:14PM +0200, Kevin Wolf wrote: > Am 04.05.2023 um 21:53 hat Stefan Hajnoczi geschrieben: > > This patch is part of an effort to remove the aio_disable_external() > > API because it does not fit in a multi-queue block layer world where > > many AioContexts may be

[PULL 07/10] migration: drop colo_incoming_thread from MigrationIncomingState

2023-05-09 Thread Juan Quintela
From: Vladimir Sementsov-Ogievskiy have_colo_incoming_thread variable is unused. colo_incoming_thread can be local. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela Reviewed-by: Peter Xu Reviewed-by: Zhang Chen Message-Id:

[PULL 06/10] build: move COLO under CONFIG_REPLICATION

2023-05-09 Thread Juan Quintela
From: Vladimir Sementsov-Ogievskiy We don't allow to use x-colo capability when replication is not configured. So, no reason to build COLO when replication is disabled, it's unusable in this case. Note also that the check in migrate_caps_check() is not the only restriction: some functions in

[PULL 00/10] Migration 20230509 patches

2023-05-09 Thread Juan Quintela
/migration-20230509-pull-request for you to fetch changes up to 5f43d297bc2b9530805ad8602c6e2ea284b08628: migration: block incoming colo when capability is disabled (2023-05-09 20:52:21 +0200) Migration Pull request (20230509

[PULL 10/10] migration: block incoming colo when capability is disabled

2023-05-09 Thread Juan Quintela
From: Vladimir Sementsov-Ogievskiy We generally require same set of capabilities on source and target. Let's require x-colo capability to use COLO on target. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela Reviewed-by: Peter Xu Reviewed-by: Lukas Straub Reviewed-by:

[PULL 02/10] ram: Let colo_flush_ram_cache take the bitmap_mutex

2023-05-09 Thread Juan Quintela
From: Lukas Straub This is not required, colo_flush_ram_cache does not run concurrently with the multifd threads since the cache is only flushed after everything has been received. But it makes me more comfortable. This will be used in the next commits to add colo support to multifd.

[PULL 09/10] migration: disallow change capabilities in COLO state

2023-05-09 Thread Juan Quintela
From: Vladimir Sementsov-Ogievskiy COLO is not listed as running state in migrate_is_running(), so, it's theoretically possible to disable colo capability in COLO state and the unexpected error in migration_iteration_finish() is reachable. Let's disallow that in qmp_migrate_set_capabilities.

[PULL 04/10] block/meson.build: prefer positive condition for replication

2023-05-09 Thread Juan Quintela
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Lukas Straub Reviewed-by: Zhang Chen Message-Id: <20230428194928.1426370-2-vsement...@yandex-team.ru> Signed-off-by: Juan Quintela ---

[PULL 03/10] multifd: Add the ramblock to MultiFDRecvParams

2023-05-09 Thread Juan Quintela
From: Lukas Straub This will be used in the next commits to add colo support to multifd. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Message-Id: <88135197411df1a71d7832962b39abf60faf0021.1683572883.git.lukasstra...@web.de> Signed-off-by: Juan Quintela --- migration/multifd.c |

[PULL 08/10] migration: process_incoming_migration_co: simplify code flow around ret

2023-05-09 Thread Juan Quintela
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela Reviewed-by: Peter Xu Reviewed-by: Zhang Chen Message-Id: <20230428194928.1426370-7-vsement...@yandex-team.ru> Signed-off-by: Juan Quintela --- migration/migration.c | 11 ++-

[PULL 05/10] colo: make colo_checkpoint_notify static and provide simpler API

2023-05-09 Thread Juan Quintela
From: Vladimir Sementsov-Ogievskiy colo_checkpoint_notify() is mostly used in colo.c. Outside we use it once when x-checkpoint-delay migration parameter is set. So, let's simplify the external API to only that function - notify COLO that parameter was set. This make external API more robust and

[PULL 01/10] ram: Add public helper to set colo bitmap

2023-05-09 Thread Juan Quintela
From: Lukas Straub The overhead of the mutex in non-multifd mode is negligible, because in that case its just the single thread taking the mutex. This will be used in the next commits to add colo support to multifd. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Message-Id:

Re: [PATCH v5 00/21] block: remove aio_disable_external() API

2023-05-09 Thread Kevin Wolf
Am 04.05.2023 um 21:53 hat Stefan Hajnoczi geschrieben: > v5: > - Use atomic accesses for in_flight counter in vhost-user-server.c [Kevin] > - Stash SCSIDevice id/lun values for VIRTIO_SCSI_T_TRANSPORT_RESET event > before unrealizing the SCSIDevice [Kevin] > - Keep vhost-user-blk export

Re: [PATCH v5 05/21] virtio-scsi: stop using aio_disable_external() during unplug

2023-05-09 Thread Kevin Wolf
Am 04.05.2023 um 21:53 hat Stefan Hajnoczi geschrieben: > This patch is part of an effort to remove the aio_disable_external() > API because it does not fit in a multi-queue block layer world where > many AioContexts may be submitting requests to the same disk. > > The SCSI emulation code is

Re: [PATCH v5 00/21] block: remove aio_disable_external() API

2023-05-09 Thread Kevin Wolf
Am 09.05.2023 um 19:51 hat Stefan Hajnoczi geschrieben: > On Thu, May 04, 2023 at 11:44:42PM +0200, Kevin Wolf wrote: > > Am 04.05.2023 um 21:53 hat Stefan Hajnoczi geschrieben: > > > v5: > > > - Use atomic accesses for in_flight counter in vhost-user-server.c [Kevin] > > > - Stash SCSIDevice

Re: [PATCH v5 00/21] block: remove aio_disable_external() API

2023-05-09 Thread Stefan Hajnoczi
On Thu, May 04, 2023 at 11:44:42PM +0200, Kevin Wolf wrote: > Am 04.05.2023 um 21:53 hat Stefan Hajnoczi geschrieben: > > v5: > > - Use atomic accesses for in_flight counter in vhost-user-server.c [Kevin] > > - Stash SCSIDevice id/lun values for VIRTIO_SCSI_T_TRANSPORT_RESET event > > before

Re: [PATCH v2 00/20] Graph locking, part 3 (more block drivers)

2023-05-09 Thread Stefan Hajnoczi
On Thu, May 04, 2023 at 01:57:30PM +0200, Kevin Wolf wrote: > The first few patches in this series fix coroutine correctness problems > that have existed for a while, but only actually start to make things > fail in practice with stricter checks that we're going to introduce with > the graph

Re: [PATCH] block: compile out assert_bdrv_graph_readable() by default

2023-05-09 Thread Kevin Wolf
Am 01.05.2023 um 19:34 hat Stefan Hajnoczi geschrieben: > reader_count() is a performance bottleneck because the global > aio_context_list_lock mutex causes thread contention. Put this debugging > assertion behind a new ./configure --enable-debug-graph-lock option and > disable it by default. > >

Re: [PATCH v2 00/20] Graph locking, part 3 (more block drivers)

2023-05-09 Thread Kevin Wolf
Am 04.05.2023 um 13:57 hat Kevin Wolf geschrieben: > The first few patches in this series fix coroutine correctness problems > that have existed for a while, but only actually start to make things > fail in practice with stricter checks that we're going to introduce with > the graph locking work.

Re: [PATCH v2] iotests: Test resizing image attached to an iothread

2023-05-09 Thread Eric Blake
On Tue, May 09, 2023 at 03:41:33PM +0200, Kevin Wolf wrote: > This tests that trying to resize an image with QMP block_resize doesn't > hang or otherwise fail when the image is attached to a device running in > an iothread. > > This is a regression test for the recent fix that changed >

Re: [PATCH] iotests: Test resizing image attached to an iothread

2023-05-09 Thread Eric Blake
On Tue, May 09, 2023 at 12:59:31PM +0200, Kevin Wolf wrote: > This tests that trying to resize an image with QMP block_resize doesn't > hang or otherwise fail when the image is attached to a device running in > an iothread. > > This is a regression test for the recent fix that changed >

Re: Question about graph locking preconditions regarding qemu_in_main_thread()

2023-05-09 Thread Fiona Ebner
Am 09.05.23 um 15:53 schrieb Kevin Wolf: > Am 09.05.2023 um 12:26 hat Fiona Ebner geschrieben: >> Am 08.05.23 um 12:40 schrieb Kevin Wolf: >>> Am 05.05.2023 um 11:35 hat Fiona Ebner geschrieben: Hi, I noticed that the bdrv_graph_co_rd_lock() and bdrv_graph_co_rd_unlock() functions

Re: [PATCH 07/21] migration: Correct transferred bytes value

2023-05-09 Thread Juan Quintela
Harsh Prateek Bora wrote: > On 5/8/23 18:38, Juan Quintela wrote: >> We forget several places to add to trasferred amount of data. With >> this fixes I get: >> qemu_file_transferred() + multifd_bytes == transferred >> The only place whrer this is not true is during devices sending. >> But >

Re: Question about graph locking preconditions regarding qemu_in_main_thread()

2023-05-09 Thread Kevin Wolf
Am 09.05.2023 um 12:26 hat Fiona Ebner geschrieben: > Am 08.05.23 um 12:40 schrieb Kevin Wolf: > > Am 05.05.2023 um 11:35 hat Fiona Ebner geschrieben: > >> Hi, > >> I noticed that the bdrv_graph_co_rd_lock() and bdrv_graph_co_rd_unlock() > >> functions use qemu_in_main_thread() as a conditional to

[PATCH v2] iotests: Test resizing image attached to an iothread

2023-05-09 Thread Kevin Wolf
This tests that trying to resize an image with QMP block_resize doesn't hang or otherwise fail when the image is attached to a device running in an iothread. This is a regression test for the recent fix that changed qmp_block_resize, which is a coroutine based QMP handler, to avoid calling

Re: [PATCH 07/21] migration: Correct transferred bytes value

2023-05-09 Thread Harsh Prateek Bora
On 5/8/23 18:38, Juan Quintela wrote: We forget several places to add to trasferred amount of data. With this fixes I get: qemu_file_transferred() + multifd_bytes == transferred The only place whrer this is not true is during devices sending. But s/whrer/where going all through

Re: [PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-09 Thread Harsh Prateek Bora
On 5/8/23 18:38, Juan Quintela wrote: This way we can make them atomic and use this functions from any s/this/these place. I also moved all functions that use rate_limit to migration-stats. Functions got renamed, they are not qemu_file anymore. qemu_file_rate_limit ->

Re: [PATCH 02/21] migration: Don't use INT64_MAX for unlimited rate

2023-05-09 Thread Harsh Prateek Bora
On 5/9/23 17:21, Juan Quintela wrote: Harsh Prateek Bora wrote: On 5/8/23 18:38, Juan Quintela wrote: Use 0 instead. Signed-off-by: Juan Quintela --- migration/migration.c | 4 ++-- migration/qemu-file.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git

Re: [PATCH 02/21] migration: Don't use INT64_MAX for unlimited rate

2023-05-09 Thread Harsh Prateek Bora
On 5/8/23 18:38, Juan Quintela wrote: Use 0 instead. Signed-off-by: Juan Quintela --- migration/migration.c | 4 ++-- migration/qemu-file.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 1192f1ebf1..3979a98949

Re: [PATCH 02/21] migration: Don't use INT64_MAX for unlimited rate

2023-05-09 Thread Juan Quintela
Harsh Prateek Bora wrote: > On 5/8/23 18:38, Juan Quintela wrote: >> Use 0 instead. >> Signed-off-by: Juan Quintela >> --- >> migration/migration.c | 4 ++-- >> migration/qemu-file.c | 3 +++ >> 2 files changed, 5 insertions(+), 2 deletions(-) >> diff --git a/migration/migration.c

Re: [PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats

2023-05-09 Thread Juan Quintela
Harsh Prateek Bora wrote: > On 5/8/23 18:38, Juan Quintela wrote: >> This way we can make them atomic and use this functions from any > > s/this/these > Fixed. Thanks.

[PATCH] iotests: Test resizing image attached to an iothread

2023-05-09 Thread Kevin Wolf
This tests that trying to resize an image with QMP block_resize doesn't hang or otherwise fail when the image is attached to a device running in an iothread. This is a regression test for the recent fix that changed qmp_block_resize, which is a coroutine based QMP handler, to avoid calling

Re: [PATCH v1 0/1] Add support for namespace attach/detach during runtime

2023-05-09 Thread Klaus Jensen
On May 5 14:12, Daniel Wagner wrote: > This is a follow up on a very old thread[1]. My aim is to attach/detatch nvme > devices during runtime and test the Linux nvme subsystem in the guest. > > In order to it working, I had first to add hotplug able PCI bus and the > nvme-subsystem. The

Re: Question about graph locking preconditions regarding qemu_in_main_thread()

2023-05-09 Thread Fiona Ebner
Am 08.05.23 um 12:40 schrieb Kevin Wolf: > Am 05.05.2023 um 11:35 hat Fiona Ebner geschrieben: >> Hi, >> I noticed that the bdrv_graph_co_rd_lock() and bdrv_graph_co_rd_unlock() >> functions use qemu_in_main_thread() as a conditional to return early. >> What high-level requirements ensure that

Re: [PATCH 10/17] tests/qapi-schema/doc-good: Improve argument description tests

2023-05-09 Thread Juan Quintela
Markus Armbruster wrote: > Juan Quintela writes: > >> Markus Armbruster wrote: >>> Improve the comments to better describe what they test. >>> >>> Cover argument description starting on a new line indented. This >>> style isn't documented in docs/devel/qapi-code-gen.rst. qapi-gen.py >>>

Re: [PATCH] block/export: call blk_set_dev_ops(blk, NULL, NULL)

2023-05-09 Thread Kevin Wolf
Am 02.05.2023 um 23:11 hat Stefan Hajnoczi geschrieben: > Most export types install BlockDeviceOps pointers. It is easy to forget > to remove them because that happens automatically via the "drive" qdev > property in hw/ but not block/export/. > > Put blk_set_dev_ops(blk, NULL, NULL) calls in the

Re: [PATCH 13/17] qapi: Relax doc string @name: description indentation rules

2023-05-09 Thread Markus Armbruster
Markus Armbruster writes: > Juan Quintela writes: [...] >>> docs/devel/qapi-code-gen.rst | 10 ++-- >>> scripts/qapi/parser.py| 73 +++ >>> tests/qapi-schema/doc-bad-indent.err | 2 +- >>> tests/qapi-schema/doc-bad-indent.json | 3 +- >> >>

Re: [PATCH 13/17] qapi: Relax doc string @name: description indentation rules

2023-05-09 Thread Markus Armbruster
Juan Quintela writes: > Markus Armbruster wrote: >> The QAPI schema doc comment language provides special syntax for >> command and event arguments, struct and union members, alternate >> branches, enumeration values, and features: descriptions starting with >> "@name:". >> >> By convention, we

Re: [PATCH 12/17] qapi: Rewrite parsing of doc comment section symbols and tags

2023-05-09 Thread Markus Armbruster
Juan Quintela writes: > Markus Armbruster wrote: >> To recognize a line starting with a section symbol and or tag, we >> first split it at the first space, then examine the part left of the >> space. We can just as well examine the unsplit line, so do that. >> >> Signed-off-by: Markus

Re: [PATCH 10/17] tests/qapi-schema/doc-good: Improve argument description tests

2023-05-09 Thread Markus Armbruster
Juan Quintela writes: > Markus Armbruster wrote: >> Improve the comments to better describe what they test. >> >> Cover argument description starting on a new line indented. This >> style isn't documented in docs/devel/qapi-code-gen.rst. qapi-gen.py >> accepts it, but messes up indentation:

Re: [PATCH 07/17] qapi: Tidy up a slightly awkward TODO comment

2023-05-09 Thread Markus Armbruster
Juan Quintela writes: > Markus Armbruster wrote: >> MigrateSetParameters has a TODO comment sitting right behind its doc >> comment. I wrote it this way to keep it out of the manual, but that >> reason is not obvious. >> >> The previous commit (sphinx/qapidoc: Do not emit TODO sections into >>

Re: [PATCH 04/17] meson: Fix to make QAPI generator output depend on main.py

2023-05-09 Thread Markus Armbruster
Juan Quintela writes: > Markus Armbruster wrote: >> @qapi_gen_depends is missing scripts/qapi/main.py. Fix that, and drop >> a duplicate scripts/qapi/common.py. >> >> Signed-off-by: Markus Armbruster > > Reviewed-by: Juan Quintela > > >> --- >> meson.build | 2 +- >> 1 file changed, 1

Re: [PATCH 03/17] qapi: Fix crash on stray double quote character

2023-05-09 Thread Markus Armbruster
Juan Quintela writes: > Markus Armbruster wrote: >> When the lexer chokes on a stray character, its shows the characters >> until the next structural character in the error message. > > You have a problem > >> It uses a regular expression > > You use regular expresions. > > Now you have two