Patchwork [2/2,v2] block: track dirty flag status in qed

login
register
mail settings
Submitter Robert Wang
Date Jan. 12, 2012, 8:56 a.m.
Message ID <1326358562-20525-2-git-send-email-wdongxu@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/135595/
State New
Headers show

Comments

Robert Wang - Jan. 12, 2012, 8:56 a.m.
From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>

qed driver use QED_F_NEED_CHECK to mark if the image is clean.

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 block/qed.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Patch

diff --git a/block/qed.c b/block/qed.c
index 8da3ebe..c1392a3 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -1429,6 +1429,12 @@  static int bdrv_qed_check(BlockDriverState *bs, BdrvCheckResult *result)
     return qed_check(s, result, false);
 }
 
+static bool bdrv_qed_not_cleanly_down(BlockDriverState *bs)
+{
+    BDRVQEDState *s = bs->opaque;
+    return s->header.features & QED_F_NEED_CHECK;
+}
+
 static QEMUOptionParameter qed_create_options[] = {
     {
         .name = BLOCK_OPT_SIZE,
@@ -1474,6 +1480,7 @@  static BlockDriver bdrv_qed = {
     .bdrv_get_info            = bdrv_qed_get_info,
     .bdrv_change_backing_file = bdrv_qed_change_backing_file,
     .bdrv_check               = bdrv_qed_check,
+    .bdrv_not_cleanly_down    = bdrv_qed_not_cleanly_down,
 };
 
 static void bdrv_qed_init(void)