yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-dirty-bitmap-rename-bdrv_undo_clear_dirty_bitmap.patch

26ba25
From 765f5eca1f61622a160e3e8fdf8337f00f4b7558 Mon Sep 17 00:00:00 2001
26ba25
From: John Snow <jsnow@redhat.com>
26ba25
Date: Tue, 20 Nov 2018 18:18:12 +0000
26ba25
Subject: [PATCH 18/35] dirty-bitmap: rename bdrv_undo_clear_dirty_bitmap
26ba25
26ba25
RH-Author: John Snow <jsnow@redhat.com>
26ba25
Message-id: <20181120181828.15132-9-jsnow@redhat.com>
26ba25
Patchwork-id: 83061
26ba25
O-Subject: [RHEL8/rhel qemu-kvm PATCH 08/24] dirty-bitmap: rename bdrv_undo_clear_dirty_bitmap
26ba25
Bugzilla: 1518989
26ba25
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
26ba25
RH-Acked-by: Max Reitz <mreitz@redhat.com>
26ba25
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
26ba25
26ba25
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
26ba25
26ba25
Use more generic names to reuse the function for bitmap merge in the
26ba25
following commit.
26ba25
26ba25
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
26ba25
Reviewed-by: John Snow <jsnow@redhat.com>
26ba25
(cherry picked from commit 56bd662497259400b7c9f155aaebaddde4450028)
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 block/dirty-bitmap.c      | 4 ++--
26ba25
 blockdev.c                | 2 +-
26ba25
 include/block/block_int.h | 2 +-
26ba25
 3 files changed, 4 insertions(+), 4 deletions(-)
26ba25
26ba25
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
26ba25
index 6c8761e..017ee9d 100644
26ba25
--- a/block/dirty-bitmap.c
26ba25
+++ b/block/dirty-bitmap.c
26ba25
@@ -633,12 +633,12 @@ void bdrv_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap **out)
26ba25
     bdrv_dirty_bitmap_unlock(bitmap);
26ba25
 }
26ba25
 
26ba25
-void bdrv_undo_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap *in)
26ba25
+void bdrv_restore_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap *backup)
26ba25
 {
26ba25
     HBitmap *tmp = bitmap->bitmap;
26ba25
     assert(bdrv_dirty_bitmap_enabled(bitmap));
26ba25
     assert(!bdrv_dirty_bitmap_readonly(bitmap));
26ba25
-    bitmap->bitmap = in;
26ba25
+    bitmap->bitmap = backup;
26ba25
     hbitmap_free(tmp);
26ba25
 }
26ba25
 
26ba25
diff --git a/blockdev.c b/blockdev.c
26ba25
index b3d265b..2d86465 100644
26ba25
--- a/blockdev.c
26ba25
+++ b/blockdev.c
26ba25
@@ -2142,7 +2142,7 @@ static void block_dirty_bitmap_clear_abort(BlkActionState *common)
26ba25
                                              common, common);
26ba25
 
26ba25
     if (state->backup) {
26ba25
-        bdrv_undo_clear_dirty_bitmap(state->bitmap, state->backup);
26ba25
+        bdrv_restore_dirty_bitmap(state->bitmap, state->backup);
26ba25
     }
26ba25
 }
26ba25
 
26ba25
diff --git a/include/block/block_int.h b/include/block/block_int.h
26ba25
index ff923b7..f457acb 100644
26ba25
--- a/include/block/block_int.h
26ba25
+++ b/include/block/block_int.h
26ba25
@@ -1141,7 +1141,7 @@ bool blk_dev_is_medium_locked(BlockBackend *blk);
26ba25
 void bdrv_set_dirty(BlockDriverState *bs, int64_t offset, int64_t bytes);
26ba25
 
26ba25
 void bdrv_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap **out);
26ba25
-void bdrv_undo_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap *in);
26ba25
+void bdrv_restore_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap *backup);
26ba25
 
26ba25
 void bdrv_inc_in_flight(BlockDriverState *bs);
26ba25
 void bdrv_dec_in_flight(BlockDriverState *bs);
26ba25
-- 
26ba25
1.8.3.1
26ba25