]> git.proxmox.com Git - mirror_qemu.git/commit - block/throttle.c
block: Take graph lock for most of .bdrv_open
authorKevin Wolf <kwolf@redhat.com>
Fri, 27 Oct 2023 15:53:32 +0000 (17:53 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 8 Nov 2023 16:56:18 +0000 (17:56 +0100)
commita4b740db5ee3db0d5b76a6ea9895875763453187
tree096757e6b1a3828e67daa3264a7d73e51e5c432c
parent65ff757df04a541ae6a34c51267e54244627efef
block: Take graph lock for most of .bdrv_open

Most implementations of .bdrv_open first open their file child (which is
an operation that internally takes the write lock and therefore we
shouldn't hold the graph lock while calling it), and afterwards many
operations that require holding the graph lock, e.g. for accessing
bs->file.

This changes block drivers that follow this pattern to take the graph
lock after opening the child node.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20231027155333.420094-24-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
16 files changed:
block/blkdebug.c
block/bochs.c
block/cloop.c
block/copy-before-write.c
block/copy-on-read.c
block/crypto.c
block/dmg.c
block/filter-compress.c
block/parallels.c
block/preallocate.c
block/qcow.c
block/raw-format.c
block/snapshot-access.c
block/throttle.c
block/vdi.c
block/vpc.c