From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Wenchao Xia <xiawenc@linux.vnet.ibm.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PULL 25/26] hmp: show ImageInfo in 'info block'
Date: Fri, 7 Jun 2013 13:58:44 +0200 [thread overview]
Message-ID: <1370606325-10680-26-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1370606325-10680-1-git-send-email-stefanha@redhat.com>
From: Wenchao Xia <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>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
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
next prev parent reply other threads:[~2013-06-07 11:59 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 11:58 [Qemu-devel] [PULL 00/26] Block patches Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 01/26] blockdev: reset werror/rerror on drive_del Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 02/26] qemu-io: Remove unused args_command Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 03/26] cutils: Support 'P' and 'E' suffixes in strtosz() Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 04/26] qemu-io: Make cvtnum() a wrapper around strtosz_suffix() Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 05/26] qemu-io: Handle cvtnum() errors in 'alloc' Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 06/26] qemu-io: Don't use global bs in command implementations Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 07/26] qemu-io: Split off commands to qemu-io-cmds.c Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 08/26] qemu-io: Factor out qemuio_command Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 09/26] qemu-io: Move 'help' function Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 10/26] qemu-io: Move 'quit' function Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 11/26] qemu-io: Move qemu_strsep() to cutils.c Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 12/26] qemu-io: Move functions for registering and running commands Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 13/26] qemu-io: Move command_loop() and friends Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 14/26] qemu-io: Move remaining helpers from cmd.c Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 15/26] qemu-io: Interface cleanup Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 16/26] qemu-io: Use the qemu version for -V Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 17/26] Make qemu-io commands available in HMP Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 18/26] blkdebug: Add BLKDBG_FLUSH_TO_OS/DISK events Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 19/26] ide-test: Add enum value for DEV Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 20/26] ide: Set BSY bit during FLUSH Stefan Hajnoczi
2013-06-07 12:10 ` Paolo Bonzini
2013-06-07 11:58 ` [Qemu-devel] [PULL 21/26] ide-test: Add FLUSH CACHE test case Stefan Hajnoczi
2013-06-14 17:54 ` Peter Maydell
2013-06-14 18:11 ` Peter Maydell
2013-06-14 18:18 ` Anthony Liguori
2013-06-17 12:45 ` Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 22/26] block: add snapshot info query function bdrv_query_snapshot_info_list() Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 23/26] block: add image info query function bdrv_query_image_info() Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 24/26] qmp: add ImageInfo in BlockDeviceInfo used by query-block Stefan Hajnoczi
2013-06-07 11:58 ` Stefan Hajnoczi [this message]
2013-06-07 11:58 ` [Qemu-devel] [PULL 26/26] hmp: add parameters device and -v for info block Stefan Hajnoczi
2013-06-17 21:17 ` [Qemu-devel] [PULL 00/26] Block patches Anthony Liguori
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=1370606325-10680-26-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=xiawenc@linux.vnet.ibm.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).