From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Dong Xu Wang <wdongxu@linux.vnet.ibm.com>,
stefanha@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 3/4 v3] block: add dirty flag status to qemu-img
Date: Thu, 15 Mar 2012 20:13:33 +0800 [thread overview]
Message-ID: <1331813614-3754-3-git-send-email-wdongxu@linux.vnet.ibm.com> (raw)
In-Reply-To: <1331813614-3754-1-git-send-email-wdongxu@linux.vnet.ibm.com>
From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
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 <wdongxu@linux.vnet.ibm.com>
---
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') {
--
1.7.5.4
next prev parent reply other threads:[~2012-03-15 12:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-15 12:13 [Qemu-devel] [PATCH 1/4 v3] block: add image fragmentation statistics to qemu-img Dong Xu Wang
2012-03-15 12:13 ` [Qemu-devel] [PATCH 2/4 v3] block: image fragmentation statistics for qed Dong Xu Wang
2012-03-15 12:13 ` Dong Xu Wang [this message]
2012-03-15 12:13 ` [Qemu-devel] [PATCH 4/4] block: track dirty flag status in qed Dong Xu Wang
2012-03-15 12:45 ` [Qemu-devel] [PATCH 1/4 v3] block: add image fragmentation statistics to qemu-img Stefan Hajnoczi
2012-03-29 15:56 ` Stefan Hajnoczi
2012-03-29 16:00 ` Stefan Hajnoczi
2012-04-02 16:13 ` Kevin Wolf
-- strict thread matches above, loose matches on Subject: below --
2012-03-15 12:47 Dong Xu Wang
2012-03-15 12:47 ` [Qemu-devel] [PATCH 3/4 v3] block: add dirty flag status " Dong Xu Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331813614-3754-3-git-send-email-wdongxu@linux.vnet.ibm.com \
--to=wdongxu@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).