From 4026f1c4f320aa072fa4cd299545cbc97315e246 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 29 Sep 2023 16:51:47 +0200 Subject: block: Mark bdrv_get_parent_name() and callers GRAPH_RDLOCK This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_get_parent_name() need to hold a reader lock for the graph because it accesses the parents list of a node. For some places, we know that they will hold the lock, but we don't have the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock() with a FIXME comment. These places will be removed once everything is properly annotated. Signed-off-by: Kevin Wolf Message-ID: <20230929145157.45443-13-kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/parallels.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'block/parallels.c') diff --git a/block/parallels.c b/block/parallels.c index d026ce9e2f..6b46623241 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -1363,9 +1363,12 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, bitmap_new(DIV_ROUND_UP(s->header_size, s->bat_dirty_block)); /* Disable migration until bdrv_activate method is added */ + bdrv_graph_rdlock_main_loop(); error_setg(&s->migration_blocker, "The Parallels format used by node '%s' " "does not support live migration", bdrv_get_device_or_node_name(bs)); + bdrv_graph_rdunlock_main_loop(); + ret = migrate_add_blocker(s->migration_blocker, errp); if (ret < 0) { error_setg(errp, "Migration blocker error"); -- cgit v1.2.3