From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkzPx-0007sp-OT for qemu-devel@nongnu.org; Wed, 11 Jan 2012 09:44:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkzPr-00027U-UU for qemu-devel@nongnu.org; Wed, 11 Jan 2012 09:44:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkzPr-00027O-NA for qemu-devel@nongnu.org; Wed, 11 Jan 2012 09:44:39 -0500 Message-ID: <4F0DA104.7000509@redhat.com> Date: Wed, 11 Jan 2012 15:47:32 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1325322388-4825-1-git-send-email-wdongxu@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] block: add dirty flag status to qemu-img List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Dong Xu Wang , qemu-devel@nongnu.org, Stefan Hajnoczi Am 11.01.2012 15:35, schrieb Stefan Hajnoczi: > On Sat, Dec 31, 2011 at 9:06 AM, Dong Xu Wang > wrote: >> +int bdrv_is_dirty(BlockDriverState *bs) > > bool would be nicer instead of int. Traditionally we used int but C99 > has been around for a long time now and it's more appropriate. > >> diff --git a/qemu-img.c b/qemu-img.c >> index 01cc0d3..a79c274 100644 >> --- a/qemu-img.c >> +++ b/qemu-img.c >> @@ -1153,6 +1153,9 @@ static int img_info(int argc, char **argv) >> if (bdrv_is_encrypted(bs)) { >> printf("encrypted: yes\n"); >> } >> + if (bdrv_is_dirty(bs)) { >> + printf("dirty,need check: yes\n"); >> + } > > I suggest avoiding the comma and just saying "needs check: yes\n". In fact I would reverse the logic and make it something like "cleanly shut down: no", it will better describe the situation when the VM is still running. Same for the function names, "dirty" could mean anything. Kevin