From patchwork Fri Nov 11 10:09:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Supriya Kannery X-Patchwork-Id: 125115 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B51991007D4 for ; Fri, 11 Nov 2011 21:09:54 +1100 (EST) Received: from localhost ([::1]:52919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROo3Q-00071b-4l for incoming@patchwork.ozlabs.org; Fri, 11 Nov 2011 05:09:48 -0500 Received: from eggs.gnu.org ([140.186.70.92]:37341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROo3K-00071W-69 for qemu-devel@nongnu.org; Fri, 11 Nov 2011 05:09:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROo3I-0006kZ-Vw for qemu-devel@nongnu.org; Fri, 11 Nov 2011 05:09:42 -0500 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:38642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROo3G-0006kN-Lk for qemu-devel@nongnu.org; Fri, 11 Nov 2011 05:09:40 -0500 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by e28smtp01.in.ibm.com (8.14.4/8.13.1) with ESMTP id pABA9WBl016200 for ; Fri, 11 Nov 2011 15:39:32 +0530 Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pABA9UfC2351254 for ; Fri, 11 Nov 2011 15:39:32 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pABA9Uqr022408 for ; Fri, 11 Nov 2011 21:09:30 +1100 Received: from skannery.in.ibm.com ([9.79.212.179]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pABA9TN6022404; Fri, 11 Nov 2011 21:09:29 +1100 Message-ID: <4EBCF459.3020306@linux.vnet.ibm.com> Date: Fri, 11 Nov 2011 15:39:29 +0530 From: Supriya Kannery User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.20) Gecko/20110817 Fedora/3.1.12-1.fc14 Thunderbird/3.1.12 MIME-Version: 1.0 To: qemu-devel@nongnu.org References: <20111111064707.15024.69847.sendpatchset@skannery.in.ibm.com> <20111111064721.15024.12985.sendpatchset@skannery.in.ibm.com> In-Reply-To: <20111111064721.15024.12985.sendpatchset@skannery.in.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 122.248.162.1 Cc: Kevin Wolf , Stefan Hajnoczi , Christoph Hellwig , Luiz Capitulino Subject: Re: [Qemu-devel] [v9 Patch 1/6 - updated]Qemu: Enhance "info block" to display host cache setting X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: supriyak@linux.vnet.ibm.com 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 On 11/11/2011 12:17 PM, Supriya Kannery wrote: > Enhance "info block" to display hostcache setting for each > block device. > > > ## > Index: qemu/qapi-types.h > =================================================================== > --- qemu.orig/qapi-types.h > +++ qemu/qapi-types.h > @@ -383,6 +383,7 @@ struct BlockInfo > { > char * device; > char * type; > + bool hostcache; > bool removable; > bool locked; > bool has_inserted; > Index: qemu/block.c hostcache gets added to qapi-types.h from the change done in qapi-schema.json. Hence above change has to be ignored. Pls find updated patch. ********************************************************************* 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(-) BlockDeviceIoStatus_lookup[info->value->io_status]); Index: qemu/qapi-schema.json =================================================================== --- qemu.orig/qapi-schema.json +++ qemu/qapi-schema.json @@ -409,6 +409,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) # @@ -422,7 +424,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 @@ -1839,6 +1839,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 @@ -199,6 +199,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",