From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7O6t-0000tF-19 for qemu-devel@nongnu.org; Tue, 13 Mar 2012 05:33:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7O6Y-0006Ml-51 for qemu-devel@nongnu.org; Tue, 13 Mar 2012 05:33:38 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:51209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7O6X-0006MH-Sv for qemu-devel@nongnu.org; Tue, 13 Mar 2012 05:33:18 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Mar 2012 09:33:13 -0000 Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q2D9XAsN2334950 for ; Tue, 13 Mar 2012 09:33:11 GMT Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q2D9X8qY021449 for ; Tue, 13 Mar 2012 03:33:09 -0600 Date: Tue, 13 Mar 2012 09:33:07 +0000 From: Stefan Hajnoczi Message-ID: <20120313093307.GA19267@stefanha-thinkpad.localdomain> References: <1331112179-12726-1-git-send-email-wdongxu@linux.vnet.ibm.com> <1331112179-12726-3-git-send-email-wdongxu@linux.vnet.ibm.com> <20120312181813.GA21109@stefanha-thinkpad.localdomain> <4F5F0D77.5050100@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F5F0D77.5050100@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/4 v2 RESEND] block: add dirty flag status to qemu-img List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Stefan Hajnoczi , Dong Xu Wang , qemu-devel@nongnu.org On Tue, Mar 13, 2012 at 10:03:51AM +0100, Kevin Wolf wrote: > Am 12.03.2012 19:18, schrieb Stefan Hajnoczi: > > On Wed, Mar 07, 2012 at 05:22:58PM +0800, Dong Xu Wang wrote: > >> From: Dong Xu Wang > >> > >> Some block drivers can verify their image files are clean or not. So we can show > >> it while using "qemu-img info. > >> > >> Signed-off-by: Dong Xu Wang > >> --- > >> block.c | 14 ++++++++++++++ > >> block.h | 2 ++ > >> block_int.h | 1 + > >> qemu-img.c | 3 +++ > >> 4 files changed, 20 insertions(+), 0 deletions(-) > >> > >> diff --git a/block.c b/block.c > >> index 947607b..17e9ba8 100644 > >> --- a/block.c > >> +++ b/block.c > >> @@ -193,6 +193,20 @@ static void bdrv_io_limits_intercept(BlockDriverState *bs, > >> qemu_co_queue_next(&bs->throttled_reqs); > >> } > >> > >> +/* check if the image was cleanly shut down */ > >> +bool bdrv_not_cleanly_down(BlockDriverState *bs) > > > > The name is a little cryptic to me and I suggest avoiding 'not' in > > function names because it easily leads to double-negatives (!not_foo()). > > > > How about: > > > > bool bdrv_was_shutdown_cleanly() > > > > if (!bdrv_was_shutdown_cleanly(bs)) { > > printf(...); > > } > > > > This patch and the QED patch look fine otherwise. > > Should we rather add a new field to BlockDriverInfo and use the existing > bdrv_get_info() function? Yeah, that sounds good. In that case it's best to make the "clean" value false and the "dirty" value true, so that block drivers that don't care about this feature automatically report "clean". struct BlockDriverInfo { bool is_dirty; } Stefan