From: Supriya Kannery <supriyak@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Shrinidhi Joshi <spjoshi31@gmail.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
Jeff Cody <jcody@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
Christoph Hellwig <hch@lst.de>
Subject: [Qemu-devel] [v1 Patch 1/10]Qemu: Enhance "info block" to display host cache setting
Date: Sat, 16 Jun 2012 02:17:01 +0530 [thread overview]
Message-ID: <20120615204701.9853.3126.sendpatchset@skannery.in.ibm.com> (raw)
In-Reply-To: <20120615204648.9853.1225.sendpatchset@skannery.in.ibm.com>
Enhance "info block" to display hostcache setting for each
block device.
Example:
(qemu) info block
ide0-hd0: removable=0 file=../rhel6-32.raw ro=0 drv=raw encrypted=0
Enhanced to display "hostcache" setting:
(qemu) info block
ide0-hd0: removable=0 hostcache=1 file=../rhel6-32.raw ro=0 drv=raw encrypted=0
Signed-off-by: Supriya Kannery <supriyak@linux.vnet.ibm.com>
---
block.c | 20 ++++++++++++++++----
qmp-commands.hx | 2 ++
2 files changed, 18 insertions(+), 4 deletions(-)
Index: qemu/qapi-schema.json
===================================================================
--- qemu.orig/qapi-schema.json
+++ qemu/qapi-schema.json
@@ -447,6 +447,8 @@
# @locked: True if the guest has locked this device from having its media
# removed
#
+# @hostcache: True if host pagecache is enabled.
+#
# @tray_open: #optional True if the device has a tray and it is open
# (only present if removable is true)
#
@@ -460,7 +462,7 @@
##
{ 'type': 'BlockInfo',
'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
- 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
+ 'locked': 'bool','hostcache': 'bool', '*inserted': 'BlockDeviceInfo',
'*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus'} }
##
Index: qemu/block.c
===================================================================
--- qemu.orig/block.c
+++ qemu/block.c
@@ -2581,6 +2581,7 @@ BlockInfoList *qmp_query_block(Error **e
info->value->device = g_strdup(bs->device_name);
info->value->type = g_strdup("unknown");
info->value->locked = bdrv_dev_is_medium_locked(bs);
+ info->value->hostcache = !(bs->open_flags & BDRV_O_NOCACHE);
info->value->removable = bdrv_dev_has_removable_media(bs);
if (bdrv_dev_has_removable_media(bs)) {
Index: qemu/hmp.c
===================================================================
--- qemu.orig/hmp.c
+++ qemu/hmp.c
@@ -212,6 +212,8 @@ void hmp_info_block(Monitor *mon)
monitor_printf(mon, " tray-open=%d", info->value->tray_open);
}
+ monitor_printf(mon, " hostcache=%d", info->value->hostcache);
+
if (info->value->has_io_status) {
monitor_printf(mon, " io-status=%s",
BlockDeviceIoStatus_lookup[info->value->io_status]);
next prev parent reply other threads:[~2012-06-15 20:47 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 20:46 [Qemu-devel] [v1 Patch 0/10]Qemu: Dynamic host pagecache change and image file reopen Supriya Kannery
2012-06-15 20:47 ` Supriya Kannery [this message]
2012-06-15 21:07 ` [Qemu-devel] [v1 Patch 1/10]Qemu: Enhance "info block" to display host cache setting Eric Blake
2012-07-09 14:43 ` Kevin Wolf
2012-07-11 14:03 ` Luiz Capitulino
2012-07-29 6:21 ` Supriya Kannery
2012-07-05 16:38 ` Jeff Cody
2012-07-29 6:54 ` Supriya Kannery
2012-06-15 20:47 ` [Qemu-devel] [v1 Patch 2/10]Qemu: Error classes for hostcache setting and data sync failures Supriya Kannery
2012-07-09 14:47 ` Kevin Wolf
2012-07-29 6:58 ` Supriya Kannery
2012-06-15 20:47 ` [Qemu-devel] [v1 Patch 3/10]Qemu: Cmd "block_set_hostcache" for dynamic cache change Supriya Kannery
2012-06-15 21:56 ` Eric Blake
2012-07-29 7:33 ` Supriya Kannery
2012-06-20 18:18 ` Jeff Cody
2012-07-04 5:10 ` Shrinidhi Joshi
2012-07-04 6:30 ` Kevin Wolf
2012-07-09 14:52 ` Kevin Wolf
2012-07-11 14:16 ` Luiz Capitulino
2012-07-29 7:56 ` Supriya Kannery
2012-06-15 20:47 ` [Qemu-devel] [v1 Patch 4/10]Qemu: Framework for reopening image files safely Supriya Kannery
2012-06-15 22:02 ` Eric Blake
2012-07-09 15:06 ` Kevin Wolf
2012-06-15 20:48 ` [Qemu-devel] [v1 Patch 5/10]Qemu: raw-posix image file reopen Supriya Kannery
2012-06-15 22:11 ` Eric Blake
2012-07-04 5:15 ` Shrinidhi Joshi
2012-07-04 11:32 ` Eric Blake
2012-06-15 20:48 ` [Qemu-devel] [v1 Patch 6/10]Qemu: raw-win32 " Supriya Kannery
2012-06-15 20:48 ` [Qemu-devel] [v1 Patch 7/10]Qemu: vmdk " Supriya Kannery
2012-06-15 20:48 ` [Qemu-devel] [v1 Patch 8/10]Qemu: qcow2 " Supriya Kannery
2012-06-15 20:48 ` [Qemu-devel] [v1 Patch 9/10]Qemu: qcow " Supriya Kannery
2012-06-15 20:49 ` [Qemu-devel] [v1 Patch 10/10]Qemu: qed " Supriya Kannery
2012-07-09 17:51 ` [Qemu-devel] [v1 Patch 0/10]Qemu: Dynamic host pagecache change and " Stefan Weil
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=20120615204701.9853.3126.sendpatchset@skannery.in.ibm.com \
--to=supriyak@linux.vnet.ibm.com \
--cc=hch@lst.de \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=spjoshi31@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.