From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFpLG-0003qm-5y for qemu-devel@nongnu.org; Thu, 05 Apr 2012 12:15:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFpL9-0004tT-1r for qemu-devel@nongnu.org; Thu, 05 Apr 2012 12:15:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFpL8-0004lg-Q9 for qemu-devel@nongnu.org; Thu, 05 Apr 2012 12:15:14 -0400 From: Kevin Wolf Date: Thu, 5 Apr 2012 17:52:08 +0200 Message-Id: <1333641144-13612-31-git-send-email-kwolf@redhat.com> In-Reply-To: <1333641144-13612-1-git-send-email-kwolf@redhat.com> References: <1333641144-13612-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 30/46] qemu-img: add dirty flag status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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 Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block.h | 1 + qemu-img.c | 3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/block.h b/block.h index ea12f5d..4e99e18 100644 --- a/block.h +++ b/block.h @@ -15,6 +15,7 @@ typedef struct BlockDriverInfo { int cluster_size; /* offset at which the VM state can be saved (0 if not possible) */ int64_t vm_state_offset; + bool is_dirty; } BlockDriverInfo; typedef struct BlockFragInfo { diff --git a/qemu-img.c b/qemu-img.c index 4de48ba..6a61ca8 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1132,6 +1132,9 @@ static int img_info(int argc, char **argv) if (bdi.cluster_size != 0) { printf("cluster_size: %d\n", bdi.cluster_size); } + if (bdi.is_dirty) { + printf("cleanly shut down: no\n"); + } } bdrv_get_backing_filename(bs, backing_filename, sizeof(backing_filename)); if (backing_filename[0] != '\0') { -- 1.7.6.5