From patchwork Fri Jun 15 20:47:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Supriya Kannery X-Patchwork-Id: 165219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8A44AB7017 for ; Sat, 16 Jun 2012 06:47:29 +1000 (EST) Received: from localhost ([::1]:37001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfdQV-0003aA-DK for incoming@patchwork.ozlabs.org; Fri, 15 Jun 2012 16:47:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfdQK-0003RP-2c for qemu-devel@nongnu.org; Fri, 15 Jun 2012 16:47:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfdQI-0000uo-BG for qemu-devel@nongnu.org; Fri, 15 Jun 2012 16:47:15 -0400 Received: from e2.ny.us.ibm.com ([32.97.182.142]:44633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfdQI-0000uJ-7k for qemu-devel@nongnu.org; Fri, 15 Jun 2012 16:47:14 -0400 Received: from /spool/local by e2.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Jun 2012 16:47:10 -0400 Received: from d01dlp01.pok.ibm.com (9.56.224.56) by e2.ny.us.ibm.com (192.168.1.102) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 15 Jun 2012 16:47:08 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 9859338C8052 for ; Fri, 15 Jun 2012 16:47:07 -0400 (EDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5FKl778221592 for ; Fri, 15 Jun 2012 16:47:07 -0400 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 q5FKl5Ql006371 for ; Fri, 15 Jun 2012 14:47:06 -0600 Received: from skannery.in.ibm.com ([9.79.198.24]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5FKl2IV006163; Fri, 15 Jun 2012 14:47:03 -0600 From: Supriya Kannery To: qemu-devel@nongnu.org Date: Sat, 16 Jun 2012 02:17:01 +0530 Message-Id: <20120615204701.9853.3126.sendpatchset@skannery.in.ibm.com> In-Reply-To: <20120615204648.9853.1225.sendpatchset@skannery.in.ibm.com> References: <20120615204648.9853.1225.sendpatchset@skannery.in.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061520-5112-0000-0000-000009143F45 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 32.97.182.142 Cc: Kevin Wolf , Shrinidhi Joshi , Stefan Hajnoczi , Jeff Cody , Luiz Capitulino , Christoph Hellwig Subject: [Qemu-devel] [v1 Patch 1/10]Qemu: Enhance "info block" to display host cache setting X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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]);