[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] drop Re: [PATCH] block/qcow2: fix logic around dirty_bitmap

From: Vladimir Sementsov-Ogievskiy
Subject: [Qemu-devel] drop Re: [PATCH] block/qcow2: fix logic around dirty_bitmaps_loaded
Date: Thu, 21 Jun 2018 21:26:29 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

12.06.2018 20:26, Vladimir Sementsov-Ogievskiy wrote:
First: this variable was introduced to handle reopens. We need it on
following qcow2_do_open, to don't try loading bitmaps again. So, we are
fixing qcow2_invalidate_cache().

However, if we fix only qcow2_invalidate_cache, iotest 169 fails on
case test__persistent__not_migbitmap__online_shared, because on first
target open, source is not yet closed, and is not yet stored bitmaps,
so, we are load nothing. And on second open, dirty_bitmaps_loaded is
already true, but we have no bitmaps to reopen with
qcow2_reopen_bitmaps_rw_hint(). So, we are fixing qcow2_do_open() too.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
  block/qcow2.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index 6fa5e1d71a..b4216a5830 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1499,7 +1499,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState 
*bs, QDict *options,
              qcow2_reopen_bitmaps_rw_hint(bs, &header_updated, &local_err);
-    } else {
+    } else if (s->nb_bitmaps > 0) {
          header_updated = qcow2_load_dirty_bitmaps(bs, &local_err);
          s->dirty_bitmaps_loaded = true;
@@ -2178,6 +2178,7 @@ static void coroutine_fn 
qcow2_co_invalidate_cache(BlockDriverState *bs,
      QDict *options;
      Error *local_err = NULL;
      int ret;
+    bool dirty_bitmaps_loaded = s->dirty_bitmaps_loaded;
       * Backing files are read-only which makes all of their metadata 
@@ -2190,6 +2191,7 @@ static void coroutine_fn 
qcow2_co_invalidate_cache(BlockDriverState *bs,
memset(s, 0, sizeof(BDRVQcow2State));
+    s->dirty_bitmaps_loaded = dirty_bitmaps_loaded;
      options = qdict_clone_shallow(bs->options);
flags &= ~BDRV_O_INACTIVE;

Drop this, I'll resend better patch.

Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]