[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 25/26] hmp: show ImageInfo in 'info block'
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 25/26] hmp: show ImageInfo in 'info block' |
Date: |
Fri, 7 Jun 2013 13:58:44 +0200 |
From: Wenchao Xia <address@hidden>
Now human monitor can show image details, include internal
snapshot and backing chain info for every block device.
Signed-off-by: Wenchao Xia <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hmp.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hmp.c b/hmp.c
index 64e0baa..4fc3bfe 100644
--- a/hmp.c
+++ b/hmp.c
@@ -22,6 +22,7 @@
#include "qemu/sockets.h"
#include "monitor/monitor.h"
#include "ui/console.h"
+#include "block/qapi.h"
#include "qemu-io.h"
static void hmp_handle_error(Monitor *mon, Error **errp)
@@ -278,6 +279,7 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
void hmp_info_block(Monitor *mon, const QDict *qdict)
{
BlockInfoList *block_list, *info;
+ ImageInfo *image_info;
block_list = qmp_query_block(NULL);
@@ -319,6 +321,18 @@ void hmp_info_block(Monitor *mon, const QDict *qdict)
info->value->inserted->iops,
info->value->inserted->iops_rd,
info->value->inserted->iops_wr);
+
+ monitor_printf(mon, " images:\n");
+ image_info = info->value->inserted->image;
+ while (1) {
+ bdrv_image_info_dump((fprintf_function)monitor_printf, mon,
+ image_info);
+ if (image_info->has_backing_image) {
+ image_info = image_info->backing_image;
+ } else {
+ break;
+ }
+ }
} else {
monitor_printf(mon, " [not inserted]");
}
--
1.8.1.4
- [Qemu-devel] [PULL 21/26] ide-test: Add FLUSH CACHE test case, (continued)
- [Qemu-devel] [PULL 21/26] ide-test: Add FLUSH CACHE test case, Stefan Hajnoczi, 2013/06/07
- [Qemu-devel] [PULL 20/26] ide: Set BSY bit during FLUSH, Stefan Hajnoczi, 2013/06/07
- [Qemu-devel] [PULL 22/26] block: add snapshot info query function bdrv_query_snapshot_info_list(), Stefan Hajnoczi, 2013/06/07
- [Qemu-devel] [PULL 23/26] block: add image info query function bdrv_query_image_info(), Stefan Hajnoczi, 2013/06/07
- [Qemu-devel] [PULL 24/26] qmp: add ImageInfo in BlockDeviceInfo used by query-block, Stefan Hajnoczi, 2013/06/07
- [Qemu-devel] [PULL 25/26] hmp: show ImageInfo in 'info block',
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 26/26] hmp: add parameters device and -v for info block, Stefan Hajnoczi, 2013/06/07
- Re: [Qemu-devel] [PULL 00/26] Block patches, Anthony Liguori, 2013/06/17