From patchwork Thu Mar 15 12:47:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 146940 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 1137AB6F9F for ; Thu, 15 Mar 2012 23:48:43 +1100 (EST) Received: from localhost ([::1]:45314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8A6i-00010C-Vt for incoming@patchwork.ozlabs.org; Thu, 15 Mar 2012 08:48:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8A6V-0000gv-OU for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:48:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8A64-0000Qj-A6 for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:48:27 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:36241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8A63-0000QI-Ow for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:48:00 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2012 12:30:53 +1000 Received: from d23relay05.au.ibm.com (202.81.31.247) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2012 12:30:52 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q2FCfjev594156 for ; Thu, 15 Mar 2012 23:41:45 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q2FClZ51020954 for ; Thu, 15 Mar 2012 23:47:36 +1100 Received: from wdongxu-T410.ibm.com ([9.125.29.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q2FClQSW020742; Thu, 15 Mar 2012 23:47:34 +1100 From: Dong Xu Wang To: qemu-devel@nongnu.org Date: Thu, 15 Mar 2012 20:47:21 +0800 Message-Id: <1331815641-4789-3-git-send-email-wdongxu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1331815641-4789-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1331815641-4789-1-git-send-email-wdongxu@linux.vnet.ibm.com> x-cbid: 12031502-5490-0000-0000-000000F2A298 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.81.31.144 Cc: kwolf@redhat.com, Dong Xu Wang , stefanha@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 3/4 v3] block: add dirty flag status to qemu-img 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 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.h | 1 + qemu-img.c | 3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/block.h b/block.h index 32e1e58..12219d0 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') {