From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, armbru@redhat.com, lcapitulino@redhat.com,
stefanha@redhat.com, pbonzini@redhat.com,
Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH V15 4/5] hmp: show ImageInfo in 'info block'
Date: Thu, 6 Jun 2013 12:28:00 +0800 [thread overview]
Message-ID: <1370492881-12410-5-git-send-email-xiawenc@linux.vnet.ibm.com> (raw)
In-Reply-To: <1370492881-12410-1-git-send-email-xiawenc@linux.vnet.ibm.com>
Now human monitor can show image details, include internal
snapshot and backing chain info for every block device.
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
---
hmp.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/hmp.c b/hmp.c
index 4fb76ec..2aa832c 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"
static void hmp_handle_error(Monitor *mon, Error **errp)
{
@@ -277,6 +278,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);
@@ -318,6 +320,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.7.1
next prev parent reply other threads:[~2013-06-06 4:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-06 4:27 [Qemu-devel] [PATCH V15 0/5] enhancement for qmp/hmp interfaces of block info Wenchao Xia
2013-06-06 4:27 ` [Qemu-devel] [PATCH V15 1/5] block: add snapshot info query function bdrv_query_snapshot_info_list() Wenchao Xia
2013-06-06 4:27 ` [Qemu-devel] [PATCH V15 2/5] block: add image info query function bdrv_query_image_info() Wenchao Xia
2013-06-06 4:27 ` [Qemu-devel] [PATCH V15 3/5] qmp: add ImageInfo in BlockDeviceInfo used by query-block Wenchao Xia
2013-06-06 4:28 ` Wenchao Xia [this message]
2013-06-06 4:28 ` [Qemu-devel] [PATCH V15 5/5] hmp: add parameters device and -v for info block Wenchao Xia
2013-06-06 6:42 ` [Qemu-devel] [PATCH V15 0/5] enhancement for qmp/hmp interfaces of block info Fam Zheng
2013-06-06 8:44 ` Wenchao Xia
2013-06-07 11:46 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370492881-12410-5-git-send-email-xiawenc@linux.vnet.ibm.com \
--to=xiawenc@linux.vnet.ibm.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).