diff options
-rw-r--r-- | block.c | 15 | ||||
-rw-r--r-- | blockdev.c | 3 | ||||
-rw-r--r-- | include/block/block.h | 1 |
3 files changed, 3 insertions, 16 deletions
@@ -2242,16 +2242,6 @@ void bdrv_close_all(void) } } -/* make a BlockDriverState anonymous by removing from graph_bdrv_state list. - * Also, NULL terminate the device_name to prevent double remove */ -void bdrv_make_anon(BlockDriverState *bs) -{ - if (bs->node_name[0] != '\0') { - QTAILQ_REMOVE(&graph_bdrv_states, bs, node_list); - } - bs->node_name[0] = '\0'; -} - /* Fields that need to stay with the top-level BDS */ static void bdrv_move_feature_fields(BlockDriverState *bs_dest, BlockDriverState *bs_src) @@ -2381,8 +2371,9 @@ static void bdrv_delete(BlockDriverState *bs) bdrv_close(bs); /* remove from list, if necessary */ - bdrv_make_anon(bs); - + if (bs->node_name[0] != '\0') { + QTAILQ_REMOVE(&graph_bdrv_states, bs, node_list); + } QTAILQ_REMOVE(&all_bdrv_states, bs, bs_list); g_free(bs); diff --git a/blockdev.c b/blockdev.c index 3eb05d1a90..efb1107e80 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2869,9 +2869,6 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict) /* Make the BlockBackend and the attached BlockDriverState anonymous */ monitor_remove_blk(blk); - if (blk_bs(blk)) { - bdrv_make_anon(blk_bs(blk)); - } /* If this BlockBackend has a device attached to it, its refcount will be * decremented when the device is removed; otherwise we have to do so here. diff --git a/include/block/block.h b/include/block/block.h index 47e80bc204..a48ad49397 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -201,7 +201,6 @@ int bdrv_create(BlockDriver *drv, const char* filename, int bdrv_create_file(const char *filename, QemuOpts *opts, Error **errp); BlockDriverState *bdrv_new_root(void); BlockDriverState *bdrv_new(void); -void bdrv_make_anon(BlockDriverState *bs); void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top); void bdrv_replace_in_backing_chain(BlockDriverState *old, BlockDriverState *new); |