Skip to content

Commit

Permalink
block: Remove unnecessary variable in bdrv_block_device_info
Browse files Browse the repository at this point in the history
The commit 5d88135 ("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'.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230901184605.32260-3-farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
Fabiano Rosas authored and kevmw committed Sep 4, 2023
1 parent bd0285e commit bb86eb4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions block/qapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -145,15 +145,14 @@ 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;

/*
* 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;
Expand Down

0 comments on commit bb86eb4

Please sign in to comment.