block/qapi: Dead code cleanup
cover block/qapi: Dead code cleanup
Hi,
I'm resending a couple of already reviewed patches that were part of a larger series[1].
Thanks
1- https://lore.kernel.org/r/[email protected]
Fabiano Rosas (2):
block: Remove bdrv_query_block_node_info
block: Remove unnecessary variable in bdrv_block_device_info
block/qapi.c | 32 ++------------------------------ include/block/qapi.h | 3 --- 2 files changed, 2 insertions(+), 33 deletions(-)
Signature · 1 line
2.35.3
PATCH RESEND 1/2 block: Remove bdrv_query_block_node_info
The last call site of this function has been removed by commit c04d0ab026 ("qemu-img: Let info print block graph").
--- block/qapi.c | 27 --------------------------- include/block/qapi.h | 3 --- 2 files changed, 30 deletions(-)
block/qapi.c +0 -27
@@ -309,33 +309,6 @@ out:aio_context_release (bdrv_get_aio_context (bs)); } -/** -* bdrv_query_block_node_info: -* @bs: block node to examine -* @p_info: location to store node information -* @errp: location to store error information -* -* Store image information about @bs in @p_info. -* -* @p_info will be set only on success. On error, store error in @errp. -*/ -void bdrv_query_block_node_info (BlockDriverState *bs, -BlockNodeInfo **p_info, -Error **errp) -{ -BlockNodeInfo *info; -ERRP_GUARD (); - - info =g_new0 (BlockNodeInfo,1 ); -bdrv_do_query_node_info (bs, info, errp); -if (*errp) { -qapi_free_BlockNodeInfo (info); -return ; - } - - *p_info = info; -} -/** * bdrv_query_image_info: * @bs: block node to examine
include/block/qapi.h +0 -3
@@ -36,9 +36,6 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,int bdrv_query_snapshot_info_list (BlockDriverState *bs,SnapshotInfoList **p_list,Error **errp); -void bdrv_query_block_node_info (BlockDriverState *bs, -BlockNodeInfo **p_info, -Error **errp); void bdrv_query_image_info(BlockDriverState *bs, ImageInfo **p_info, bool flat,
Signature · 1 line
2.35.3
PATCH RESEND 2/2 block: Remove unnecessary variable in bdrv_block_device_info
In reply to Fabiano RosasThe commit 5d8813593f ("block/qapi: Let bdrv_query_image_info() recurse") removed the loop where we set the 'bs0' variable, so now it is just the same as 'bs'.
--- block/qapi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
block/qapi.c +2 -3
@@ -48,7 +48,7 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk, {ImageInfo **p_image_info;ImageInfo *backing_info; -BlockDriverState *bs0, *backing; +BlockDriverState *backing;BlockDeviceInfo *info;ERRP_GUARD ();
@@ -145,7 +145,6 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk, info->write_threshold =bdrv_write_threshold_get (bs); - bs0 = bs; p_image_info = &info->image; info->backing_file_depth =0 ;
@@ -153,7 +152,7 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,* Skip automatically inserted nodes that the user isn't aware of for * query-block (blk != NULL), but not for query-named-block-nodes */ -bdrv_query_image_info (bs0, p_image_info, flat, blk !=NULL , errp); +bdrv_query_image_info (bs, p_image_info, flat, blk !=NULL , errp);if (*errp) {qapi_free_BlockDeviceInfo (info);return NULL ;
Signature · 1 line
2.35.3
Kevin Wolf
AppliedAm 01.09.2023 um 20:46 hat Fabiano Rosas geschrieben:
Quoted 5 lines
Hi,
I'm resending a couple of already reviewed patches that were part of a larger series[1].
Quoted 7 lines
Thanks
1- https://lore.kernel.org/r/[email protected]
Fabiano Rosas (2):
block: Removebdrv_query_block_node_info
block: Remove unnecessary variable inbdrv_block_device_info
Thanks, applied to the block branch.
Kevin