]> git.proxmox.com Git - mirror_qemu.git/commit
block: Mark bdrv_attach_child() GRAPH_WRLOCK
authorKevin Wolf <kwolf@redhat.com>
Mon, 11 Sep 2023 09:46:11 +0000 (11:46 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 20 Sep 2023 15:46:01 +0000 (17:46 +0200)
commitafdaeb9ea06ea641ccc4226964b8e278af5e7685
treeca548ea5c809b8c5c5825294e367b02b159f6deb
parent5661a00d40a59c28796a59c9df55d03efe8c56fc
block: Mark bdrv_attach_child() GRAPH_WRLOCK

Instead of taking the writer lock internally, require callers to already
hold it when calling bdrv_attach_child_common(). These callers will
typically already hold the graph lock once the locking work is
completed, which means that they can't call functions that take it
internally.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230911094620.45040-13-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/quorum.c
block/replication.c
include/block/block-global-state.h
tests/unit/test-bdrv-drain.c
tests/unit/test-bdrv-graph-mod.c