Received: from eggs.gnu.org ([208.118.235.92]:38131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Svxek-0004Kl-4X for qemu-devel@nongnu.org; Mon, 30 Jul 2012 17:37:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Svxej-0002zZ-1B for qemu-devel@nongnu.org; Mon, 30 Jul 2012 17:37:38 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:39234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Svxei-0002z3-Qe for qemu-devel@nongnu.org; Mon, 30 Jul 2012 17:37:36 -0400 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Jul 2012 15:37:35 -0600 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id B059E19D803C for ; Mon, 30 Jul 2012 21:37:12 +0000 (WET) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6ULajW9038048 for ; Mon, 30 Jul 2012 15:37:00 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6ULaTAS031947 for ; Mon, 30 Jul 2012 15:36:29 -0600 From: Supriya Kannery Date: Tue, 31 Jul 2012 03:06:25 +0530 Message-Id: <20120730213625.21536.69391.sendpatchset@skannery.in.ibm.com> In-Reply-To: <20120730213409.21536.7589.sendpatchset@skannery.in.ibm.com> References: <20120730213409.21536.7589.sendpatchset@skannery.in.ibm.com> Subject: [Qemu-devel] [v2 Patch 9/9]block: Enhance "info block" to display host cache setting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Shrinidhi Joshi , Stefan Hajnoczi , Jeff Cody , Luiz Capitulino , Christoph Hellwig 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 --- Index: qemu/qapi-schema.json =================================================================== --- qemu.orig/qapi-schema.json +++ qemu/qapi-schema.json @@ -453,6 +453,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) # @@ -466,7 +468,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 @@ -2504,6 +2504,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 @@ -215,6 +215,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]);