Re: [PATCH v4 00/27] refresh qemu-img options handling

2025-07-17 Thread Kevin Wolf
Am 17.07.2025 um 10:27 hat Michael Tokarev geschrieben: > On 15.07.2025 21:42, Kevin Wolf wrote: > > Am 31.05.2025 um 19:15 hat Michael Tokarev geschrieben: > > > This is another iteration of this patch series, which tries > > > to add missing command-line options, --hel

[PULL 42/57] qemu-img: convert: refresh options/--help (short option change)

2025-07-15 Thread Kevin Wolf
131321-1-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- docs/tools/qemu-img.rst | 2 +- qemu-img.c | 230 +++- 2 files changed, 159 insertions(+), 73 deletions(-) diff --git a/docs/tools/qemu-img.rst b/docs/tools/q

[PULL 45/57] qemu-img: snapshot: allow specifying -f fmt

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev For consistency with other commands, and since it already accepts --image-opts, allow specifying -f fmt too. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Message-ID: <20250531171609.197078-16-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by:

[PULL 49/57] qemu-img: resize: do not always eat last argument

2025-07-15 Thread Kevin Wolf
too. The only case which is not handled right is when there's an option between filename and size, and size is given as decrement, - in this case -size will be treated as option, not as size. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-20-...@tls.msk.ru> Reviewe

[PULL 48/57] qemu-img: rebase: refresh options/--help (short option change)

2025-07-15 Thread Kevin Wolf
- for the new backing file (was eg CACHE vs SRC_CACHE, which is unclear). Probably should rename local variables. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-19-...@tls.msk.ru> [kwolf: Removed command description from the argument list] Reviewed-by: Kevin Wolf Signed-

[PULL 40/57] qemu-img: compare: use helper function for --object

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Use the same function to parse --object as used by all other qemu-img subcommands. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-11-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.c | 16 ++--

[PULL 22/57] block: mark bdrv_drop_intermediate() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function bdrv_drop_intermediate() calls bdrv_drained_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-45-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block

[PULL 55/57] qemu-img: measure: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. Also add -s short option for --size (and remove OPTION_SIZE). Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-26-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by:

[PULL 50/57] qemu-img: resize: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-21-...@tls.msk.ru> [kwolf: Fixed up qemu-iotests] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu

[PULL 24/57] block: mark bdrv_close() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
Fiona Ebner Message-ID: <20250530151125.955508-47-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block_int-common.h | 2 +- block.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/block/block_int

[PULL 34/57] qemu-img: pass current cmd info into command handlers

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev This info will be used to generate --help output. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Reviewed-by: Kevin Wolf Message-ID: <20250531171609.197078-5-...@tls.msk.ru> Signed-off-by: Kevin Wolf --- qemu-img.

[PULL 30/57] iotests: add test for changing the 'drive' property via 'qom-set'

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner Signed-off-by: Fiona Ebner Message-ID: <20250605100938.43133-1-f.eb...@proxmox.com> [kwolf: Fixed up pylint warnings flagged by 297] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/qom-set-drive | 75 ++ test

[PULL 27/57] block/qapi: include child references in block device info

2025-07-15 Thread Kevin Wolf
e-ID: <20250702123204.325470-2-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qapi/block-core.json | 16 block/qapi.c | 10 ++ tests/qemu-iotests/184.out | 8 3 files changed, 34 insertions(+) diff --git a/qapi

[PULL 37/57] qemu-img: check: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-8-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.

[PULL 13/57] block: mark bdrv_inactivate() as GRAPH_RDLOCK and move drain to callers

2025-07-15 Thread Kevin Wolf
locked section covers bdrv_find_node() too, so the latter alternative is chosen. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-36-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block-global-state.h | 2 +- b

[PULL 01/57] block: never use atomics to access bs->quiesce_counter

2025-07-15 Thread Kevin Wolf
4-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block_int-common.h | 2 +- block/io.c | 7 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h inde

[PULL 32/57] qemu-img: create: convert img_size to signed, simplify handling

2025-07-15 Thread Kevin Wolf
off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Reviewed-by: Kevin Wolf Message-ID: <20250531171609.197078-3-...@tls.msk.ru> Signed-off-by: Kevin Wolf --- qemu-img.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index e676602f

[PULL 47/57] qemu-img: snapshot: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-18-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.

[PULL 02/57] block: add bdrv_graph_wrlock_drained() convenience wrapper

2025-07-15 Thread Kevin Wolf
ll_begin();\n\s*bdrv_graph_wrlock();/bdrv_graph_wrlock_drained();/g' {} ';' find . -name '*.c' -exec sed -i -z 's/bdrv_graph_wrunlock();\n\s*bdrv_drain_all_end();/bdrv_graph_wrunlock();/g' {} ';' Suggested-by: Kevin Wolf Signed-off-by: Fiona Ebner Messa

[PULL 17/57] block-backend: mark blk_io_limits_disable() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function blk_io_limits_disable() calls bdrv_drained_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-40-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/system

[PULL 33/57] qemu-img: global option processing and error printing

2025-07-15 Thread Kevin Wolf
his will be done in subsequent changes command by command, with main() done last. unrecognized_option() and missing_argument() functions prototypes aren't changed by this patch, since they're called from many places and will be removed a few patches later. Only artifical "

[PULL 31/57] qemu-img: measure: convert img_size to signed, simplify handling

2025-07-15 Thread Kevin Wolf
. Berrangé Reviewed-by: Kevin Wolf Message-ID: <20250531171609.197078-2-...@tls.msk.ru> Signed-off-by: Kevin Wolf --- qemu-img.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index e75707180d..e676602fc7 100644 --- a/qemu-img.c

[PULL 44/57] qemu-img: map: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. While at it, remove unused option_index variable. Signed-off-by: Michael Tokarev Message-ID: <20250715140903.131529-1-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevi

[PULL 05/57] block: call bdrv_set_backing_hd() while unlocked in bdrv_open_backing_file()

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner This is in preparation to mark bdrv_set_backing_hd() as GRAPH_UNLOCKED. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-28-f.eb...@proxmox.com> [kwolf: Removed an extra blank line] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block.c | 6 +++

[PULL 23/57] block: mark bdrv_close_all() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function bdrv_close_all() calls bdrv_drain_all(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-46-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block-

[PULL 15/57] block: mark blk_remove_bs() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
Ebner Message-ID: <20250530151125.955508-38-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/system/block-backend-global-state.h | 2 +- block/monitor/block-hmp-cmds.c | 15 ++- 2 files changed, 11 insertions(+), 6 deletions(-)

[PULL 20/57] block: mark bdrv_replace_child_bs() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function bdrv_replace_child_bs() calls bdrv_drained_begin() which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-43-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block

[PULL 54/57] qemu-img: dd: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-25-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.

[PULL 11/57] block/stream: mark stream_prepare() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
Ebner Message-ID: <20250530151125.955508-34-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/qemu/job.h | 2 +- block/stream.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/job.h b/include/qemu/job.h index a5a04155ea.

[PULL 06/57] block: mark bdrv_set_backing_hd() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function bdrv_set_backing_hd() calls bdrv_drain_all_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-29-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block

[PULL 51/57] qemu-img: amend: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-22-...@tls.msk.ru> [kwolf: Fixed up qemu-iotests] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu

[PULL 56/57] qemu-img: implement short --help, remove global help() function

2025-07-15 Thread Kevin Wolf
missing_argument() and unrecognized_option() are now unused, remove them. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Message-ID: <20250531171609.197078-27-...@tls.msk.ru> [kwolf: Fixed up style and formatting] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.c

[PULL 03/57] block/mirror: switch to bdrv_set_backing_hd_drained() variant

2025-07-15 Thread Kevin Wolf
: <20250530151125.955508-26-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/mirror.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 82a6e50cf8..873e95d029 100644 --- a/block/mirror.c

[PULL 12/57] block: mark bdrv_reopen_queue() and bdrv_reopen_multiple() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
necessary to make the locked section in reopen_backing_file() shorter. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-35-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block-global-state.h | 9 + block/replica

[PULL 26/57] blockjob: mark block_job_remove_all_bdrv() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function block_job_remove_all_bdrv() calls bdrv_graph_wrlock_drained(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-49-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- i

[PULL 35/57] qemu-img: create: refresh options/--help (short option change)

2025-07-15 Thread Kevin Wolf
, Reorder options for consistency. Remove usage of missing_argument()/unrecognized_option() in img_create(). Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-6-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- docs/tools/qemu-img.rst | 10 +

[PULL 25/57] block: mark bdrv_open_child_common() and its callers GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
making the locked section shorter in vmdk_open(). Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-48-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block-global-state.h | 9 + block.c

[PULL 29/57] file-posix: Fix aio=threads performance regression after enablign FUA

2025-07-15 Thread Kevin Wolf
: qemu-sta...@nongnu.org Fixes: 984a32f17e8d ("file-posix: Support FUA writes") Buglink: https://issues.redhat.com/browse/RHEL-96854 Reported-by: Tingting Mao Signed-off-by: Kevin Wolf Message-ID: <20250625085019.27735-1-kw...@redhat.com> Reviewed-by: Eric Blake Signed-off-by: K

[PULL 21/57] block: mark bdrv_insert_node() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function bdrv_insert_node() calls bdrv_drained_begin() which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-44-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block-

[PULL 28/57] block/qapi: make @node-name in @BlockDeviceInfo non-optional

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner Since commit 15489c769b ("block: auto-generated node-names"), if the node name of a block driver state is not explicitly specified, it will be auto-generated. Signed-off-by: Fiona Ebner Message-ID: <20250702123204.325470-3-f.eb...@proxmox.com> Reviewed-by: Ke

[PULL 10/57] block/snapshot: mark bdrv_all_delete_snapshot() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function bdrv_all_delete_snapshot() calls bdrv_drain_all_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-33-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include

[PULL 09/57] block-backend: mark blk_drain_all() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function blk_drain_all() calls bdrv_drain_all_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-32-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/system/block-b

[PULL 53/57] qemu-img: bitmap: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-24-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.

[PULL 57/57] qemu-img: extend cvtnum() and use it in more places

2025-07-15 Thread Kevin Wolf
mmediately. While at it, remove allowed size suffixes from the error message as it makes no sense most of the time (should be in help instead). Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Message-ID: <20250531171609.197078-28-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-of

[PULL 41/57] qemu-img: compare: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add long options, add help, reorder options for consistency. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-12-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.

[PULL 52/57] qemu-img: bench: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. Add missing --object option. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-23-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.c

[PULL 46/57] qemu-img: snapshot: make -l (list) the default, simplify option handling

2025-07-15 Thread Kevin Wolf
can use RO mode). Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Message-ID: <20250531171609.197078-17-...@tls.msk.ru> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- docs/tools/qemu-img.rst | 2 +- qemu-img.c | 52 ++

[PULL 43/57] qemu-img: info: refresh options/--help

2025-07-15 Thread Kevin Wolf
: <20250531171609.197078-14-...@tls.msk.ru> [kwolf: Fixed up help text formatting] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.c | 51 --- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/qemu-img.c b/qemu-img.c

[PULL 08/57] block: drop wrapper for bdrv_set_backing_hd_drained()

2025-07-15 Thread Kevin Wolf
ff-by: Fiona Ebner Message-ID: <20250530151125.955508-31-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block-global-state.h | 5 + block.c| 20 block/commit.c | 6 +++--- blo

[PULL 36/57] qemu-img: factor out parse_output_format() and use it in the code

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Use common code and simplify error message Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Reviewed-by: Kevin Wolf Message-ID: <20250531171609.197078-7-...@tls.msk.ru> Signed-off-by: Kevin Wolf --- qemu-img.c

[PULL 38/57] qemu-img: simplify --repair error message

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Message-ID: <20250531171609.197078-9-...@tls.msk.ru> [kwolf: Added missing comma in help text] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-img.c | 5 +++-- 1 file changed, 3 insertions

[PULL 19/57] block: Allow bdrv_new() with and without graph lock

2025-07-15 Thread Kevin Wolf
just created the BlockDriverState and it isn't even part of the graph yet. We can use bdrv_do_drained_begin_quiesce() instead to avoid the polling, which means that bdrv_new() can now safely be called from callers that hold the graph lock as well as from callers that don't. Signed-off

[PULL 39/57] qemu-img: commit: refresh options/--help

2025-07-15 Thread Kevin Wolf
From: Michael Tokarev Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev Message-ID: <20250531171609.197078-10-...@tls.msk.ru> [kwolf: Fixed up qemu-iotests] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu

[PULL 18/57] block/commit: mark commit_abort() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
ge-ID: <20250530151125.955508-41-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/qemu/job.h | 2 +- block/commit.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/job.h b/include/qemu/job.h index bb8ee766ef..ead31578d3 1

[PULL 16/57] block: mark blk_drain() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function blk_drain() calls bdrv_drained_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-39-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/system/block-b

[PULL 14/57] block: mark bdrv_inactivate_all() as GRAPH_UNLOCKED

2025-07-15 Thread Kevin Wolf
From: Fiona Ebner The function bdrv_inactivate_all() calls bdrv_drain_all_begin(), which must be called with the graph unlocked. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-37-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block

[PULL 04/57] block/commit: switch to bdrv_set_backing_hd_drained() variant

2025-07-15 Thread Kevin Wolf
locked section can also cover bdrv_cow_bs(). Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-27-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/commit.c | 32 +--- 1 file changed, 25 insertions(+), 7 deletions(-)

[PULL 07/57] blockdev: avoid locking and draining multiple times in external_snapshot_abort()

2025-07-15 Thread Kevin Wolf
.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- blockdev.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/blockdev.c b/blockdev.c index e625534925..3c53472a23 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1580,11 +1580,19 @@ stati

[PULL 00/57] Block layer patches

2025-07-15 Thread Kevin Wolf
o non-optional iotests: add test for changing the 'drive' property via 'qom-set' Kevin Wolf (2): block: Allow bdrv_new() with and without graph lock file-posix: Fix aio=threads performance regression after enablign FUA Michael Tokarev (27): qemu-img: m

Re: [PATCH v4 00/27] refresh qemu-img options handling

2025-07-15 Thread Kevin Wolf
Am 31.05.2025 um 19:15 hat Michael Tokarev geschrieben: > This is another iteration of this patch series, which tries > to add missing command-line options, --help output, make it > all more or less consistent, etc. > > I addressed (hopefully) all comments so far, mostly by Kevin. > I ended up (so

Re: [PATCH 14/27] qemu-img: map: refresh options/--help

2025-07-15 Thread Kevin Wolf
Am 31.05.2025 um 19:15 hat Michael Tokarev geschrieben: > Add missing long options and --help output, > reorder options for consistency. > > While at it, remove unused option_index variable. > > Signed-off-by: Michael Tokarev > --- > qemu-img.c | 57 ++---

Re: [PATCH 13/27] qemu-img: info: refresh options/--help

2025-07-15 Thread Kevin Wolf
Am 31.05.2025 um 19:15 hat Michael Tokarev geschrieben: > Add missing long options and --help output. > Also add -b short option for --backing-chain, and remove > now-unused OPTION_BACKING_CHAIN. I think I wouldn't do this part, -b specifies a backing file name elsewhere, so this feels a little in

Re: [PATCH] iotests: add test for changing the 'drive' property via 'qom-set'

2025-07-14 Thread Kevin Wolf
Am 05.06.2025 um 12:09 hat Fiona Ebner geschrieben: > Signed-off-by: Fiona Ebner Thanks, applied to the block branch. Kevin

Re: [PATCH v3 0/2] block/qapi: include child references in block device info

2025-07-14 Thread Kevin Wolf
Am 02.07.2025 um 14:31 hat Fiona Ebner geschrieben: > Changes in v3: > * Add patch to make @node-name non-optional for @BlockDeviceInfo. > * Drop superfluous check for child->bs being non-NULL. > * Make @node-name non-optional and expect it to be set. > * Use 'block/qapi' rather than just 'block' a

Re: [PATCH v4 00/48] block: do not drain while holding the graph lock

2025-07-14 Thread Kevin Wolf
Am 01.07.2025 um 19:16 hat Kevin Wolf geschrieben: > Am 30.05.2025 um 17:10 hat Fiona Ebner geschrieben: > > This series is an attempt to fix a deadlock issue reported by Andrey > > here [3]. > > > > bdrv_drained_begin() polls and is not allowed to be called with th

Re: [PATCH v2 01/12] aio-posix: fix race between io_uring CQE and AioHandler deletion

2025-07-02 Thread Kevin Wolf
Am 20.06.2025 um 02:08 hat Stefan Hajnoczi geschrieben: > When an AioHandler is enqueued on ctx->submit_list for removal, the > fill_sq_ring() function will submit an io_uring POLL_REMOVE operation to > cancel the in-flight POLL_ADD operation. > > There is a race when another thread enqueues an Ai

Re: [PATCH v2] block: include child references in block device info

2025-07-02 Thread Kevin Wolf
Am 02.07.2025 um 11:39 hat Fiona Ebner geschrieben: > Am 02.07.25 um 11:13 schrieb Kevin Wolf: > > Am 01.07.2025 um 18:21 hat Fiona Ebner geschrieben: > >> +## > >> +# @BlockdevChild: > >> +# > >> +# @child: The name of the child, for example 'f

Re: [PATCH v2] block: include child references in block device info

2025-07-02 Thread Kevin Wolf
Am 01.07.2025 um 18:21 hat Fiona Ebner geschrieben: > In combination with using a throttle filter to enforce IO limits for > a guest device, knowing the 'file' child of a block device can be > useful. If the throttle filter is only intended for guest IO, block > jobs should not also be limited by t

Re: [PATCH 3/4] block: implement 'resize' callback for child_of_bds class

2025-07-01 Thread Kevin Wolf
Am 01.07.2025 um 16:46 hat Hanna Czenczek geschrieben: > On 30.06.25 13:27, Fiona Ebner wrote: > > If a node below a filter node is resized, the size of the filter node > > is now also refreshed (recursively for filter parents). > > > > Signed-off-by: Fiona Ebner > > --- > > block.c

Re: [PATCH v4 00/48] block: do not drain while holding the graph lock

2025-07-01 Thread Kevin Wolf
Am 30.05.2025 um 17:10 hat Fiona Ebner geschrieben: > This series is an attempt to fix a deadlock issue reported by Andrey > here [3]. > > bdrv_drained_begin() polls and is not allowed to be called with the > block graph lock held. Mark the function as GRAPH_UNLOCKED. > > This alone does not catc

Re: [PATCH v4 41/48] block: mark bdrv_new() as GRAPH_UNLOCKED

2025-07-01 Thread Kevin Wolf
Am 30.05.2025 um 17:11 hat Fiona Ebner geschrieben: > The function bdrv_new() calls bdrv_drained_begin(), which must be > called with the graph unlocked. > > Marking bdrv_new() as GRAPH_UNLOCKED requires making the locked > section in bdrv_open_inherit() shorter. > > Signed-off-by: Fiona Ebner >

Re: [PATCH] block: include 'file' child node name in block device info

2025-07-01 Thread Kevin Wolf
Am 01.07.2025 um 15:04 hat Hanna Czenczek geschrieben: > On 30.06.25 16:06, Fiona Ebner wrote: > > In combination with using a throttle filter to enforce IO limits for > > a guest device, knowing the 'file' child of a block device can be > > useful. If the throttle filter is only intended for guest

Re: [PATCH v4 27/48] block: call bdrv_set_backing_hd() while unlocked in bdrv_open_backing_file()

2025-07-01 Thread Kevin Wolf
Am 30.05.2025 um 17:11 hat Fiona Ebner geschrieben: > This is in preparation to mark bdrv_set_backing_hd() as > GRAPH_UNLOCKED. > > Signed-off-by: Fiona Ebner > --- > block.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/block.c b/block.c > index 1da10d55f0..ca3

Re: [PATCH v4 24/48] block: add bdrv_graph_wrlock_drained() convenience wrapper

2025-07-01 Thread Kevin Wolf
t; commands and then manually checked: > find . -name '*.c' -exec sed -i -z > 's/bdrv_drain_all_begin();\n\s*bdrv_graph_wrlock();/bdrv_graph_wrlock_drained();/g' > {} ';' > find . -name '*.c' -exec sed -i -z > 's/bdrv_graph_wrunlock();\n\s

Re: [PATCH v4 23/48] block: never use atomics to access bs->quiesce_counter

2025-07-01 Thread Kevin Wolf
Am 02.06.2025 um 16:45 hat Fiona Ebner geschrieben: > Am 30.05.25 um 17:11 schrieb Fiona Ebner: > > All accesses of bs->quiesce_counter are in the main thread, either > > after a GLOBAL_STATE_CODE() macro or in a function with GRAPH_WRLOCK > > annotation. > > Now I wonder if that is actually good

Re: [PATCH v5 3/3] docs: define policy forbidding use of AI code generators

2025-06-25 Thread Kevin Wolf
ually. The tools will mature, and we > > can expect some to become safely usable in free software projects. > > The policy we set now must be for today, and be open to revision. It's > > best to start strict and safe, then relax. > > > > Meanwhile reque

[PATCH] hw/s390x/ccw-device: Fix memory leak in loadparm setter

2025-06-25 Thread Kevin Wolf
Commit bdf12f2a fixed the setter for the "loadparm" machine property, which gets a string from a visitor, passes it to s390_ipl_fmt_loadparm() and then forgot to free it. It left another instance of the same problem unfixed in the "loadparm" device property. Fix it. Signe

Re: [PATCH] s390x: Fix leak in machine_set_loadparm

2025-06-25 Thread Kevin Wolf
Am 24.06.2025 um 14:34 hat Fabiano Rosas geschrieben: > Thomas Huth writes: > > > On 12/05/2025 17.37, Fabiano Rosas wrote: > >> Philippe Mathieu-Daudé writes: > >> > >>> On 12/5/25 16:07, Philippe Mathieu-Daudé wrote: > On 9/5/25 19:49, Fabiano Rosas wrote: > > ASAN spotted a leaking

[PATCH] file-posix: Fix aio=threads performance regression after enablign FUA

2025-06-25 Thread Kevin Wolf
: qemu-sta...@nongnu.org Fixes: 984a32f17e8d ("file-posix: Support FUA writes") Buglink: https://issues.redhat.com/browse/RHEL-96854 Reported-by: Tingting Mao Signed-off-by: Kevin Wolf --- block/file-posix.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deleti

Re: [PATCH] virtio: avoid cost of -ftrivial-auto-var-init in hot path

2025-06-06 Thread Kevin Wolf
Am 05.06.2025 um 20:54 hat Daniel P. Berrangé geschrieben: > On Wed, Jun 04, 2025 at 03:18:43PM -0400, Stefan Hajnoczi wrote: > > Since commit 7ff9ff039380 ("meson: mitigate against use of uninitialize > > stack for exploits") the -ftrivial-auto-var-init=zero compiler option is > > used to zero loc

[PULL 20/24] iotests/graph-changes-while-io: remove image file after test

2025-06-04 Thread Kevin Wolf
From: Fiona Ebner Suggested-by: Kevin Wolf Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-21-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/graph-changes-while-io | 1 + 1 file changed, 1 insertion(+) diff --git a

[PULL 14/24] block: move drain outside of quorum_add_child()

2025-06-04 Thread Kevin Wolf
.@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block_int-common.h | 7 +++ block.c | 10 -- block/quorum.c | 2 -- blockdev.c | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(

[PULL 24/24] hw/core/qdev-properties-system: Add missing return in set_drive_helper()

2025-06-04 Thread Kevin Wolf
na Ebner Message-ID: <20250523070211.280498-1-f.eb...@proxmox.com> Reviewed-by: Daniel P. Berrangé Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- hw/core/qdev-properties-system.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-s

[PULL 18/24] blockdev: drain while unlocked in external_snapshot_action()

2025-06-04 Thread Kevin Wolf
From: Fiona Ebner This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-19-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- blockdev.c | 17 - 1 file chang

[PULL 08/24] block: move drain outside of bdrv_change_aio_context() and mark GRAPH_RDLOCK

2025-06-04 Thread Kevin Wolf
e.g. via bdrv_child_change_aio_context(). [0]: https://lore.kernel.org/qemu-devel/73839c04-7616-407e-b057-80ca69e63...@virtuozzo.com/ Reported-by: Andrey Drobyshev Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message-ID: <20250530151125.955508-9-f.eb...@proxmox.com> Signed-off-

[PULL 15/24] block: move drain outside of bdrv_root_unref_child()

2025-06-04 Thread Kevin Wolf
explicilty listed here. The caller quorum_del_child() holds the graph lock, so it is not actually allowed to drain. This will be addressed in the next commit. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-16-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wo

[PULL 12/24] block: move drain outside of bdrv_root_attach_child()

2025-06-04 Thread Kevin Wolf
st In all callers, a drained section is introduced. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message-ID: <20250530151125.955508-13-f.eb...@proxmox.com> Signed-off-by: Kevin Wolf --- include/block/blockjob.h | 2 ++ block.c | 4 ++-- block/backup.c

[PULL 21/24] iotests/graph-changes-while-io: add test case with removal of lower snapshot

2025-06-04 Thread Kevin Wolf
rename snap1->mid as suggested by Kevin Wolf remove image file after test as suggested by Kevin Wolf add type annotation for function argument to make mypy happy] Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-22-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Sign

[PULL 06/24] block: mark change_aio_ctx() callback and instances as GRAPH_RDLOCK(_PTR)

2025-06-04 Thread Kevin Wolf
From: Fiona Ebner This is a small step in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. More concretely, it is in preparation to move the drain out of bdrv_change_aio_context() and marking that function as GRAPH_RDLOCK. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message

[PULL 04/24] block: move drain outside of read-locked bdrv_inactivate_recurse()

2025-06-04 Thread Kevin Wolf
From: Fiona Ebner This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. More granular draining is not trivially possible, because bdrv_inactivate_recurse() can recursively call itself. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message-ID: <20250530151125.95550

[PULL 09/24] block: move drain outside of bdrv_try_change_aio_context()

2025-06-04 Thread Kevin Wolf
ng commits. Functions like qmp_blockdev_mirror() query the nodes to act on before draining and locking. In theory, draining could invalidate those nodes. This kind of issue is not addressed by these commits. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message-ID: <20250530151125.9

[PULL 05/24] block: mark bdrv_parent_change_aio_context() GRAPH_RDLOCK

2025-06-04 Thread Kevin Wolf
From: Fiona Ebner This is a small step in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. More concretely, it allows marking the change_aio_ctx() callback GRAPH_RDLOCK_PTR, which is the next step. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message-ID

[PULL 03/24] block/snapshot: move drain outside of read-locked bdrv_snapshot_delete()

2025-06-04 Thread Kevin Wolf
sub-calls. This is fine for the existing callers of bdrv_all_delete_snapshot(). Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message-ID: <20250530151125.955508-4-f.eb...@proxmox.com> Signed-off-by: Kevin Wolf --- block/snapshot.c | 26 +++--- blockdev.c

[PULL 22/24] block/io: remove duplicate GLOBAL_STATE_CODE() in bdrv_do_drained_end()

2025-06-04 Thread Kevin Wolf
e main thread cannot change here, so keep only the earlier instance. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-23-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/io.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/io.c b/b

[PULL 16/24] block: move drain outside of quorum_del_child()

2025-06-04 Thread Kevin Wolf
text() and mark GRAPH_RDLOCK". Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-17-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block_int-common.h | 7 +++ block.c | 2 ++ block/quorum.c

[PULL 10/24] block: move drain outside of bdrv_attach_child_common(_abort)()

2025-06-04 Thread Kevin Wolf
Message-ID: <20250530151125.955508-11-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block.c | 40 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/block.c b/block.c index 3aaacabf7f..46eb2fe449 100644 ---

[PULL 17/24] blockdev: drain while unlocked in internal_snapshot_action()

2025-06-04 Thread Kevin Wolf
From: Fiona Ebner This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-18-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- blockdev.c | 19 +-- 1 file chang

[PULL 02/24] block: move drain outside of read-locked bdrv_reopen_queue_child()

2025-06-04 Thread Kevin Wolf
From: Fiona Ebner This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. More granular draining is not trivially possible, because bdrv_reopen_queue_child() can recursively call itself. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message-ID: <20250530151125.95550

[PULL 13/24] block: move drain outside of bdrv_attach_child()

2025-06-04 Thread Kevin Wolf via
sed by the following commit. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message-ID: <20250530151125.955508-14-f.eb...@proxmox.com> Signed-off-by: Kevin Wolf --- block.c | 6 -- block/quorum.c | 2 ++ block/replication.c | 5 +

[PULL 23/24] iotests: fix 240

2025-06-04 Thread Kevin Wolf
3 ("virtio-scsi: add iothread-vq-mapping parameter") Reported-by: Thomas Huth Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Tested-by: Eric Blake Message-ID: <20250529203147.180338-1-stefa...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- test

  1   2   3   4   5   6   7   8   9   10   >