From a8d8ecb77fc16da49ea2c1edae267dc9d0c01dfd Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Wed, 9 Oct 2013 10:46:17 +0200 Subject: block/qapi: Human-readable ImageInfoSpecific dump Add a function for generically dumping the ImageInfoSpecific information in a human-readable format to block/qapi.c. Use this function in bdrv_image_info_dump and qemu-io-cmds.c:info_f to allow qemu-img info resp. qemu-io -c info to print that format specific information. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- qemu-io-cmds.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qemu-io-cmds.c') diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 8565d49336..667f4e4f3a 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -10,6 +10,7 @@ #include "qemu-io.h" #include "block/block_int.h" +#include "block/qapi.h" #include "qemu/main-loop.h" #define CMD_NOFILE_OK 0x01 @@ -1678,6 +1679,7 @@ static const cmdinfo_t length_cmd = { static int info_f(BlockDriverState *bs, int argc, char **argv) { BlockDriverInfo bdi; + ImageInfoSpecific *spec_info; char s1[64], s2[64]; int ret; @@ -1699,6 +1701,13 @@ static int info_f(BlockDriverState *bs, int argc, char **argv) printf("cluster size: %s\n", s1); printf("vm state offset: %s\n", s2); + spec_info = bdrv_get_specific_info(bs); + if (spec_info) { + printf("Format specific information:\n"); + bdrv_image_info_specific_dump(fprintf, stdout, spec_info); + qapi_free_ImageInfoSpecific(spec_info); + } + return 0; } -- cgit v1.2.3