From b1f4cd1589a16fec02f264a09bd3560e4ccce3c2 Mon Sep 17 00:00:00 2001 From: Hanna Reitz Date: Mon, 20 Jun 2022 18:26:57 +0200 Subject: qemu-img: Use BlockNodeInfo qemu-img info never uses ImageInfo's backing-image field, because it opens the backing chain one by one with BDRV_O_NO_BACKING, and prints all backing chain nodes' information consecutively. Use BlockNodeInfo to make it clear that we only print information about a single node, and that we are not using the backing-image field. Notably, bdrv_image_info_dump() does not evaluate the backing-image field, so we can easily make it take a BlockNodeInfo pointer (and consequentially rename it to bdrv_node_info_dump()). It makes more sense this way, because again, the interface now makes it syntactically clear that backing-image is ignored by this function. Signed-off-by: Hanna Reitz Message-Id: <20220620162704.80987-6-hreitz@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/monitor/block-hmp-cmds.c | 2 +- block/qapi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'block') diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c index 0ff7c84039..d6eaacdb12 100644 --- a/block/monitor/block-hmp-cmds.c +++ b/block/monitor/block-hmp-cmds.c @@ -725,7 +725,7 @@ static void print_block_info(Monitor *mon, BlockInfo *info, monitor_printf(mon, "\nImages:\n"); image_info = inserted->image; while (1) { - bdrv_image_info_dump(image_info); + bdrv_node_info_dump(qapi_ImageInfo_base(image_info)); if (image_info->backing_image) { image_info = image_info->backing_image; } else { diff --git a/block/qapi.c b/block/qapi.c index e947562e5d..e8926c992b 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -848,7 +848,7 @@ void bdrv_image_info_specific_dump(ImageInfoSpecific *info_spec, visit_free(v); } -void bdrv_image_info_dump(ImageInfo *info) +void bdrv_node_info_dump(BlockNodeInfo *info) { char *size_buf, *dsize_buf; if (!info->has_actual_size) { -- cgit v1.2.3