From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, phrdina@redhat.com, stefanha@gmail.com,
armbru@redhat.com, lcapitulino@redhat.com, pbonzini@redhat.com,
Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH V13 5/6] hmp: show ImageInfo in 'info block'
Date: Sat, 25 May 2013 12:24:45 +0800 [thread overview]
Message-ID: <1369455886-30677-6-git-send-email-xiawenc@linux.vnet.ibm.com> (raw)
In-Reply-To: <1369455886-30677-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-05-25 4:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-25 4:24 [Qemu-devel] [PATCH V13 0/6] enhancement for qmp/hmp interfaces of block info Wenchao Xia
2013-05-25 4:24 ` [Qemu-devel] [PATCH V13 1/6] block: add snapshot info query function bdrv_query_snapshot_info_list() Wenchao Xia
2013-05-25 4:24 ` [Qemu-devel] [PATCH V13 2/6] block: add image info query function bdrv_query_image_info() Wenchao Xia
2013-05-25 12:50 ` Eric Blake
2013-05-25 4:24 ` [Qemu-devel] [PATCH V13 3/6] qmp: add recursive member in ImageInfo Wenchao Xia
2013-05-25 16:10 ` Eric Blake
2013-05-27 1:28 ` Wenchao Xia
2013-06-05 10:56 ` Stefan Hajnoczi
2013-05-25 4:24 ` [Qemu-devel] [PATCH V13 4/6] qmp: add ImageInfo in BlockDeviceInfo used by query-block Wenchao Xia
2013-05-25 4:24 ` Wenchao Xia [this message]
2013-05-25 4:24 ` [Qemu-devel] [PATCH V13 6/6] hmp: add parameters device and -v for info block Wenchao Xia
2013-06-05 11:06 ` Stefan Hajnoczi
2013-05-25 12:33 ` [Qemu-devel] [PATCH V13 0/6] enhancement for qmp/hmp interfaces of block info Eric Blake
2013-06-05 11:07 ` 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=1369455886-30677-6-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=phrdina@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).