Am 14.07.25 um 15:43 schrieb 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_d
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' as commit title prefix.
Fiona
rottle node was explicitly added (as the mirror
target).
In other scenarios, it could be useful to follow the backing chain.
Note that iotests 191 and 273 use _filter_img_info, so the 'children'
information is filtered out there.
Signed-off-by: Fiona Ebner
---
Changes in v3:
* D
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
---
New in v3.
block/qapi.c | 4 +---
qapi/block-core.json | 2 +-
2 files changed, 2
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 'file' or 'backing'.
>> +#
>> +# @node-name: The nam
rottle node was explicitly added (as the mirror
target).
In other scenarios, it could be useful to follow the backing chain.
Note that iotests 191 and 273 use _filter_img_info, so the 'children'
information is filtered out there.
Signed-off-by: Fiona Ebner
---
Changes in v2:
* Return
Am 01.07.25 um 15:04 schrieb Hanna Czenczek:
> 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 on
rottle node was explicitly added (as the mirror
target).
Signed-off-by: Fiona Ebner
---
block/qapi.c | 4
qapi/block-core.json | 4
tests/qemu-iotests/184.out | 1 +
tests/qemu-iotests/191.out | 8
tests/qemu-iotests/273.out | 2 ++
5 files changed, 19 in
The 'resize' callback is only called by bdrv_parent_cb_resize() which
is only called by bdrv_co_write_req_finish() to notify the parent(s)
that the child was resized.
Signed-off-by: Fiona Ebner
---
include/block/block_int-common.h | 3 +++
1 file changed, 3 insertions(+)
diff --git
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 | 12
include/block/block_int-common.h | 2 +-
2 files changed, 13 insertions(+), 1
In preparation for calling it via the bdrv_child_cb_resize() callback
that will be added by the next commit. Rename it to include the "_co_"
part while at it.
Signed-off-by: Fiona Ebner
---
block/io.c | 9 +++--
include/block/block_int-io.h | 6 ++
2 files
Resizing a node below a filter would result in the filter still
reporting the old size. Implement a 'resize' callback for the
child_of_bds class, that refreshes filter parents recursively.
Fiona Ebner (4):
include/block/block_int-common: document when resize callback is used
b
Signed-off-by: Fiona Ebner
---
tests/qemu-iotests/tests/resize-below-filter | 73 +++
.../tests/resize-below-filter.out | 5 ++
2 files changed, 78 insertions(+)
create mode 100755 tests/qemu-iotests/tests/resize-below-filter
create mode 100644 tests/qemu-iotests
Am 19.06.25 um 23:20 schrieb Ilya Dryomov:
> On Thu, Jun 19, 2025 at 8:38 PM Ilya Dryomov wrote:
>>
>> On Mon, Jun 16, 2025 at 2:38 PM Fiona Ebner wrote:
>>>
>>> Am 16.06.25 um 12:28 schrieb Ilya Dryomov:
>>>> On Mon, Jun 16, 2025 at 11:52 AM Daniel P
Am 16.06.25 um 11:34 schrieb Ilya Dryomov:
> On Thu, May 15, 2025 at 1:29 PM Fiona Ebner wrote:
>>
>> In Proxmox VE, it is not always required to have a dedicated Ceph
>> configuration file, and using the 'key-secret' QAPI option would
>> require obtain
Am 16.06.25 um 12:28 schrieb Ilya Dryomov:
> On Mon, Jun 16, 2025 at 11:52 AM Daniel P. Berrangé
> wrote:
>> On Mon, Jun 16, 2025 at 11:25:54AM +0200, Ilya Dryomov wrote:
>>> On Thu, May 15, 2025 at 1:29 PM Fiona Ebner wrote:
>>>> ##
>>>> # @Blockd
Am 16.06.25 um 11:41 schrieb Daniel P. Berrangé:
> On Thu, May 15, 2025 at 01:29:07PM +0200, Fiona Ebner wrote:
>> @@ -4327,6 +4360,9 @@
>> # authentication. This maps to Ceph configuration option "key".
>> # (Since 3.0)
>> #
>> +# @key-value
Am 15.05.25 um 13:29 schrieb Fiona Ebner:
> Currently, most Ceph configuration options are not exposed via QAPI.
> While it is possible to specify a dedicated Ceph configuration file,
> specialized options are often only required for a selection of images
> on the RBD storage, not all
Signed-off-by: Fiona Ebner
---
tests/qemu-iotests/tests/qom-set-drive | 75 ++
tests/qemu-iotests/tests/qom-set-drive.out | 11
2 files changed, 86 insertions(+)
create mode 100755 tests/qemu-iotests/tests/qom-set-drive
create mode 100644 tests/qemu-iotests/tests
Am 03.06.25 um 16:54 schrieb Kevin Wolf:
> Am 30.05.2025 um 17:10 hat Fiona Ebner geschrieben:
>> There were no changes for patches 01/48-09/48 and 17/48-23/48, endpoints
>> inclusive. All patches starting from 25/48 are new in v4.
>
> This is starting to become
Patches 1/4 and 2/4 are tangentially related. See patches 3/4 and 4/4
for the details.
I did not CC the people for the individual block drivers. Let me know
if I should!
Fiona Ebner (4):
block/graph-lock: fix typo in comment
block-coroutine-wrapper: mark generated co-wrapper as
Signed-off-by: Fiona Ebner
---
tests/qemu-iotests/085 | 18 ++
tests/qemu-iotests/085.out | 21 +
2 files changed, 39 insertions(+)
diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085
index 3fb7b0b5c8..5063e3e8d2 100755
--- a/tests/qemu-iotests
lback in an IO thread, but can also be reached via the QOM
realize handler nvme_ns_realize(). For this caller, a
bdrv_get_info_unlocked() coroutine wrapper is introduced that must be
called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
The test added by the following patch exhibits the i
Signed-off-by: Fiona Ebner
---
include/block/graph-lock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/block/graph-lock.h b/include/block/graph-lock.h
index 2c26c72108..67c8d04867 100644
--- a/include/block/graph-lock.h
+++ b/include/block/graph-lock.h
@@ -169,7
Generated co-wrappers poll, so they need to be called with the graph
unlocked.
Signed-off-by: Fiona Ebner
---
Unfortunately, it's not clear how to achieve something similar for the
mixed wrappers, which would've caught the issue fixed in the following
patch.
scripts/block-coroutine-
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 enough? Because vCPUs threads can
also
Am 30.05.25 um 17:11 schrieb Fiona Ebner:
> By using the appropriate variants bdrv_set_backing_hd_drained() and
> bdrv_try_change_aio_context_locked(), there only needs to be a single
> drained and write-locked section in external_snapshot_abort().
>
> Signed-off-by: Fiona Ebner
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
---
I'm not sure if the TODO comment is only intended fo
Suggested-by: Kevin Wolf
Signed-off-by: Fiona Ebner
---
tests/qemu-iotests/tests/graph-changes-while-io | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/qemu-iotests/tests/graph-changes-while-io
b/tests/qemu-iotests/tests/graph-changes-while-io
index 194fda500e..35489e3b5e 100755
The function bdrv_replace_child_bs() calls bdrv_drained_begin() which
must be called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/block/block-global-state.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/block/block-global-state.h
b/include
The function stream_prepare() calls bdrv_drain_all_begin(), which
must be called with the graph unlocked.
Also mark the JobDriver's prepare() callback as GRAPH_UNLOCKED_PTR,
because that is the callback via which stream_prepare() is reached.
Signed-off-by: Fiona Ebner
---
block/str
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
---
block.c | 25 ++---
1 file changed
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
---
block.c | 19 +++
1 file changed, 11
The function bdrv_inactivate_all() calls bdrv_drain_all_begin(), which
must be called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/block/block-global-state.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/block/block-global-state.h
b/include
This is in preparation to mark bdrv_set_backing_hd() as
GRAPH_UNLOCKED.
Switch to using the bdrv_set_backing_hd_drained() variant, so that the
drained and locked section can also cover the calls to
bdrv_skip_filters() and bdrv_cow_bs().
Signed-off-by: Fiona Ebner
---
block/mirror.c | 12
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
---
block.c | 8
1 file changed, 4
All of bdrv_drain_all_begin(), bdrv_drain_all() and
bdrv_drained_begin() poll and are not allowed to be called with the
block graph lock held. Mark the function as such.
Suggested-by: Kevin Wolf
Signed-off-by: Fiona Ebner
---
include/block/block-global-state.h | 4 ++--
include/block/block
nnot change here, so keep only the earlier instance.
Signed-off-by: Fiona Ebner
---
block/io.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/block/io.c b/block/io.c
index 4fd7768f9c..ac5c7174f6 100644
--- a/block/io.c
+++ b/block/io.c
@@ -413,7 +413,6 @@ static void bdrv_do_drained_end(
The function blk_drain() calls bdrv_drained_begin(), which must be
called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/system/block-backend-global-state.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/system/block-backend-global-state.h
b
locked section in reopen_backing_file() shorter.
Signed-off-by: Fiona Ebner
---
block/replication.c| 3 ++-
include/block/block-global-state.h | 9 +
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/block/replication.c b/block/replication.c
index 83978b61f5
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..ca3b67b233 100644
--- a/block.c
+++ b/block.c
@@ -3632,7 +3632,8 @@ int
d the bdrv_close() wrapper,
which are also marked as GRAPH_UNLOCKED_PTR and GRAPH_UNLOCKED.
Furthermore, the function bdrv_close() also calls bdrv_drained_begin()
and bdrv_graph_wrlock_drained(), so there are additional reasons for
marking it GRAPH_UNLOCKED.
Signed-off-by: Fiona Ebner
---
bl
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
---
.../qemu-iotests/tests/graph-changes-while-io | 101 --
.../tests/gr
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
---
Changes in v4:
* Document requirement that all nodes need to be drained for
bdrv_root_unref_child() and bdrv_unref_child().
*
ed section is introduced.
Signed-off-by: Fiona Ebner
Reviewed-by: Kevin Wolf
---
Changes in v4:
* Document requirement that all nodes need to be drained for
bdrv_root_attach_child() and block_job_add_bdrv().
block.c | 4 ++--
block/backup.c | 2 ++
b
The function commit_abort() calls bdrv_drained_begin(), which must be
called with the graph unlocked.
Also mark the JobDriver's abort() callback as GRAPH_UNLOCKED_PTR,
because that is the callback via which commit_abort() is reached.
Signed-off-by: Fiona Ebner
---
block/commit.c
The function bdrv_set_backing_hd() calls bdrv_drain_all_begin(), which
must be called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/block/block-global-state.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/block/block-global-state.h
b/include
The function bdrv_drop_intermediate() calls bdrv_drained_begin(),
which must be called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/block/block-global-state.h | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/block/block-global-state.h
b
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
---
block.c | 57 +++-
include/block/block_int-
The function blk_remove_bs() calls bdrv_graph_wrlock_drained() and can
also call bdrv_drained_begin(), both of which which must be called with
the graph unlocked.
Marking blk_remove_bs() as GRAPH_UNLOCKED requires temporarily
unlocking in hmp_drive_del().
Signed-off-by: Fiona Ebner
---
block
The function blk_io_limits_disable() calls bdrv_drained_begin(), which
must be called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/system/block-backend-global-state.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/system/block-backend-global
By using the appropriate variants bdrv_set_backing_hd_drained() and
bdrv_try_change_aio_context_locked(), there only needs to be a single
drained and write-locked section in external_snapshot_abort().
Signed-off-by: Fiona Ebner
---
The assumption in the added code comment about the reference is
This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED.
Signed-off-by: Fiona Ebner
---
blockdev.c | 19 +--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index bd5ca77619..506755bef1 100644
--- a/blockdev.c
+++ b/blockdev.c
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
---
include/block/block
ch is only called in the bdrv_add_child() function, which
also runs under the graph lock.
The bdrv_add_child() function is called by qmp_x_blockdev_change(),
where a drained section is introduced.
Signed-off-by: Fiona Ebner
---
Changes in v4:
* Document requirement that all nodes need to be d
t.
Signed-off-by: Fiona Ebner
Reviewed-by: Kevin Wolf
---
Changes in v4:
* Document requirement that all nodes need to be drained for
bdrv_attach_child().
block.c | 6 --
block/quorum.c | 2 ++
block/replication.c | 5 +
tests
ned-off-by: Fiona Ebner
---
Changes in v4:
* Drop now superfluous drain_bs variable.
* Document requirement that all nodes need to be drained for
bdrv_set_backing_hd_drained().
block.c| 16 +++-
block/stream.c | 6 ++
2 files changed, 5 insertions(+), 17 deletions(-)
di
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
---
include/block/blockjob.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/block/blockjob.h b/include/block
covers
bdrv_find_node() too, so the latter alternative is chosen.
Signed-off-by: Fiona Ebner
---
block.c| 14 ++
blockdev.c | 75 ++
include/block/block-global-state.h | 2 +-
3 files changed, 51 insertions(+), 40
rv_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
---
Changes in v4:
* Adapt
section
shorter in vmdk_open().
Signed-off-by: Fiona Ebner
---
block.c| 13 ++---
block/vmdk.c | 6 --
include/block/block-global-state.h | 9 +
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/block.c b/block.c
The function bdrv_all_delete_snapshot() calls bdrv_drain_all_begin(),
which must be called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/block/snapshot.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/block/snapshot.h b/include/block
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
---
block.c
E() macro nor the GRAPH_WRLOCK annotation existed.
Even if the field was only accessed in the main thread back then (did
not check if that is actually the case), it wouldn't have been easy to
verify.
Signed-off-by: Fiona Ebner
---
block/io.c | 7 ++-
include/block/
also cover bdrv_cow_bs().
Signed-off-by: Fiona Ebner
---
block/commit.c | 32 +---
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/block/commit.c b/block/commit.c
index dc1942483b..c9690a5da0 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -514,28
AioContext locking was removed in commit b49f4755c7 ("block: remove
AioContext locking").
Signed-off-by: Fiona Ebner
Reviewed-by: Kevin Wolf
---
block.c | 7 ---
1 file changed, 7 deletions(-)
diff --git a/block.c b/block.c
index f222e1a50a..a5399888ba 100644
--- a/block.c
+++
The function bdrv_close_all() calls bdrv_drain_all(), which must be
called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/block/block-global-state.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/block/block-global-state.h
b/include/block/block
tions 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
---
block.c
K".
Signed-off-by: Fiona Ebner
---
Changes in v4:
* Document requirement that all nodes need to be drained for
bdrv_del_child() wrapper and callback.
* Add function comment for bdrv_del_child() callback.
block.c | 2 ++
block/quorum.c |
The function bdrv_insert_node() calls bdrv_drained_begin() which must
be called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/block/block-global-state.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/block/block-global-state.h
b/include/block
This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED.
Signed-off-by: Fiona Ebner
---
blockdev.c | 17 -
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/blockdev.c b/blockdev.c
index 506755bef1..2e7fda6780 100644
--- a/blockdev.c
+++ b/blockdev.c
e().
This resolves all code paths.
The functions bdrv_set_backing_hd_drained(), bdrv_attach_child() and
bdrv_root_attach_child() run under the graph lock, so they are not
actually allowed to drain. This will be addressed in the following
commits.
Signed-off-by: Fiona Ebner
---
Changes in v
44485-1-f.eb...@proxmox.com/
[3]:
https://lore.kernel.org/qemu-devel/73839c04-7616-407e-b057-80ca69e63...@virtuozzo.com/
[4]:
https://lore.kernel.org/qemu-devel/20250529203147.180338-1-stefa...@redhat.com/
Andrey Drobyshev (1):
iotests/graph-changes-while-io: add test case with removal of lower
The function blk_drain_all() calls bdrv_drain_all_begin(), which must
be called with the graph unlocked.
Signed-off-by: Fiona Ebner
---
include/system/block-backend-global-state.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/system/block-backend-global-state.h
b
fine for the existing
callers of bdrv_all_delete_snapshot().
Signed-off-by: Fiona Ebner
Reviewed-by: Kevin Wolf
---
block/snapshot.c | 26 +++---
blockdev.c | 25 +
qemu-img.c | 2 ++
3 files changed, 34 insertions(+), 19 deletions
Nearly all callers (outside of the tests) are already using the
_drained() variant of the function. It doesn't seem worth keeping.
Simply adapt the remaining callers of bdrv_set_backing_hd() and rename
bdrv_set_backing_hd_drained() to bdrv_set_backing_hd().
Signed-off-by: Fiona
Am 27.05.25 um 17:29 schrieb Kevin Wolf:
> Am 26.05.2025 um 15:21 hat Fiona Ebner geschrieben:
>> @@ -3578,7 +3577,6 @@ int bdrv_set_backing_hd_drained(BlockDriverState *bs,
>> ret = bdrv_refresh_perms(bs, tran, errp);
>> out:
>> tran_finalize(tran, ret);
Am 27.05.25 um 17:23 schrieb Kevin Wolf:
> Am 26.05.2025 um 15:21 hat Fiona Ebner geschrieben:
>> @@ -3129,11 +3123,9 @@ bdrv_attach_child_common(BlockDriverState *child_bs,
>> bool ret_child;
>>
>> g_hash_t
nnot change here, so keep only the earlier instance.
Signed-off-by: Fiona Ebner
---
No changes in v3.
block/io.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/block/io.c b/block/io.c
index 4fd7768f9c..ac5c7174f6 100644
--- a/block/io.c
+++ b/block/io.c
@@ -413,7 +413,6 @@ static void
bdrv_graph_wrunlock();\n\s*bdrv_drain_all_end();/bdrv_graph_wrunlock();/g'
{} ';'
Suggested-by: Kevin Wolf
Signed-off-by: Fiona Ebner
---
Changes in v3:
* Fix typo in commit message.
block.c | 20
block/backup.c | 4 +---
bloc
Suggested-by: Kevin Wolf
Signed-off-by: Fiona Ebner
---
No changes in v3.
tests/qemu-iotests/tests/graph-changes-while-io | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/qemu-iotests/tests/graph-changes-while-io
b/tests/qemu-iotests/tests/graph-changes-while-io
index 194fda500e
it is not actually allowed to drain. This
will be addressed in the next commit.
Signed-off-by: Fiona Ebner
---
No changes in v3.
block.c | 6 --
block/blklogwrites.c | 4
block/blkverify.c| 2 ++
block/block-backend.c| 2 ++
blo
fine for the existing
callers of bdrv_all_delete_snapshot().
Signed-off-by: Fiona Ebner
Reviewed-by: Kevin Wolf
---
No changes in v3.
block/snapshot.c | 26 +++---
blockdev.c | 25 +
qemu-img.c | 2 ++
3 files changed, 34 insertions
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
---
No changes in v3.
block.c | 19
This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED.
Signed-off-by: Fiona Ebner
---
No changes in v3.
blockdev.c | 19 +--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index bd5ca77619..506755bef1 100644
--- a
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
---
No changes in v3.
block.c | 8
1 file
tions 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
---
Changes in v3:
* Clarify that _locked() version was used iff caller already
ed section is introduced.
Signed-off-by: Fiona Ebner
---
No changes in v3.
block.c | 2 --
block/backup.c | 2 ++
block/block-backend.c| 2 ++
block/commit.c | 4
block/mirror.c | 5 +
block/stream.c
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
---
No changes in v3.
.../qemu-iotests/tests/graph-changes-while-io |
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
---
Changes in v3:
* Fix
e().
This resolves all code paths.
The functions bdrv_set_backing_hd_drained(), bdrv_attach_child() and
bdrv_root_attach_child() run under the graph lock, so they are not
actually allowed to drain. This will be addressed in the following
commits.
Signed-off-by: Fiona Ebner
---
No changes in v3.
E() macro nor the GRAPH_WRLOCK annotation existed.
Even if the field was only accessed in the main thread back then (did
not check if that is actually the case), it wouldn't have been easy to
verify.
Signed-off-by: Fiona Ebner
---
No changes in v3.
block/io.c | 7 ++--
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
---
Changes in v3:
* Extend drained section in bdrv_try_change_aio_context() until after
the transaction is finalized.
* A
AioContext locking was removed in commit b49f4755c7 ("block: remove
AioContext locking").
Signed-off-by: Fiona Ebner
Reviewed-by: Kevin Wolf
---
No changes in v3.
block.c | 7 ---
1 file changed, 7 deletions(-)
diff --git a/block.c b/block.c
index f222e1a50a..a5399888ba 10
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
---
Changes in v3:
* Fix
t.
Signed-off-by: Fiona Ebner
---
No changes in v3.
block.c | 4 ++--
block/quorum.c | 2 ++
block/replication.c | 5 +
tests/unit/test-bdrv-drain.c | 14 ++
tests/unit/test-bdrv-graph-mod.c | 10 ++
5 files c
All of bdrv_drain_all_begin(), bdrv_drain_all() and
bdrv_drained_begin() poll and are not allowed to be called with the
block graph lock held. Mark the function as such.
Suggested-by: Kevin Wolf
Signed-off-by: Fiona Ebner
---
Changes in v3:
* Also mark bdrv_drain_all_begin() and bdrv_drain_all
a drained section is introduced,
replacing the previously present bs-specific drains.
2. stream_prepare(), where a drained section is introduced replacing
the previously present bs-specific drains.
Signed-off-by: Fiona Ebner
---
No changes in v3.
block.c| 6 ++
block/stream.c | 6
ch is only called in the bdrv_add_child() function, which
also runs under the graph lock.
The bdrv_add_child() function is called by qmp_x_blockdev_change(),
where a drained section is introduced.
Signed-off-by: Fiona Ebner
---
No changes in v3.
block/quorum.c | 2 --
blockdev.c | 2 ++
2 fil
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
---
No changes in v3.
block.c | 25
1 - 100 of 486 matches
Mail list logo