From bfb197e0d998bea8741c65492b2b42f443729249 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 7 Oct 2014 13:59:11 +0200 Subject: block: Eliminate BlockDriverState member device_name[] device_name[] can become non-empty only in bdrv_new_root() and bdrv_move_feature_fields(). The latter is used only to undo damage done by bdrv_swap(). The former is called only by blk_new_with_bs(). Therefore, when a BlockDriverState's device_name[] is non-empty, then it's been created with a BlockBackend, and vice versa. Furthermore, blk_new_with_bs() keeps the two names equal. Therefore, device_name[] is redundant. Eliminate it. Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- include/block/block.h | 2 +- include/block/block_int.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'include/block') diff --git a/include/block/block.h b/include/block/block.h index 6c97dd4..3880e05 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -417,7 +417,7 @@ int bdrv_set_key(BlockDriverState *bs, const char *key); int bdrv_query_missing_keys(void); void bdrv_iterate_format(void (*it)(void *opaque, const char *name), void *opaque); -const char *bdrv_get_device_name(BlockDriverState *bs); +const char *bdrv_get_device_name(const BlockDriverState *bs); int bdrv_get_flags(BlockDriverState *bs); int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors); diff --git a/include/block/block_int.h b/include/block/block_int.h index 14e0b7c..da00aa5 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -392,8 +392,6 @@ struct BlockDriverState { char node_name[32]; /* element of the list of named nodes building the graph */ QTAILQ_ENTRY(BlockDriverState) node_list; - /* Device name is the name associated with the "drive" the guest sees */ - char device_name[32]; /* element of the list of "drives" the guest sees */ QTAILQ_ENTRY(BlockDriverState) device_list; QLIST_HEAD(, BdrvDirtyBitmap) dirty_bitmaps; -- cgit v1.1