mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
block: Mark bdrv_add/del_child() and caller GRAPH_WRLOCK
The functions read the parents list in the generic block layer, so we need to hold the graph lock already there. The BlockDriver implementations actually modify the graph, so it has to be a writer lock. 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-22-kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
32a8aba37e
commit
9def6082cf
4 changed files with 27 additions and 30 deletions
|
@ -393,10 +393,11 @@ struct BlockDriver {
|
|||
*/
|
||||
int (*bdrv_probe_geometry)(BlockDriverState *bs, HDGeometry *geo);
|
||||
|
||||
void (*bdrv_add_child)(BlockDriverState *parent, BlockDriverState *child,
|
||||
Error **errp);
|
||||
void (*bdrv_del_child)(BlockDriverState *parent, BdrvChild *child,
|
||||
Error **errp);
|
||||
void GRAPH_WRLOCK_PTR (*bdrv_add_child)(
|
||||
BlockDriverState *parent, BlockDriverState *child, Error **errp);
|
||||
|
||||
void GRAPH_WRLOCK_PTR (*bdrv_del_child)(
|
||||
BlockDriverState *parent, BdrvChild *child, Error **errp);
|
||||
|
||||
/**
|
||||
* Informs the block driver that a permission change is intended. The
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue