thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
26ba25
From c7289a21c999e767a12e4c8daff7e498167a3859 Mon Sep 17 00:00:00 2001
26ba25
From: John Snow <jsnow@redhat.com>
26ba25
Date: Tue, 20 Nov 2018 18:18:17 +0000
26ba25
Subject: [PATCH 23/35] block/dirty-bitmaps: fix merge permissions
26ba25
26ba25
RH-Author: John Snow <jsnow@redhat.com>
26ba25
Message-id: <20181120181828.15132-14-jsnow@redhat.com>
26ba25
Patchwork-id: 83069
26ba25
O-Subject: [RHEL8/rhel qemu-kvm PATCH 13/24] block/dirty-bitmaps: fix merge permissions
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
In prior commits that made merge transactionable, we removed the
26ba25
assertion that merge cannot operate on disabled bitmaps. In addition,
26ba25
we want to make sure that we are prohibiting merges to "locked" bitmaps.
26ba25
26ba25
Use the new user_locked function to check.
26ba25
26ba25
Reported-by: Eric Blake <eblake@redhat.com>
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
Reviewed-by: Eric Blake <eblake@redhat.com>
26ba25
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
26ba25
Message-id: 20181002230218.13949-3-jsnow@redhat.com
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
(cherry picked from commit 283d7a04f2addcc51468635300208b60c19a0db3)
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 | 6 +++---
26ba25
 1 file changed, 3 insertions(+), 3 deletions(-)
26ba25
26ba25
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
26ba25
index 9603cdd..bfccb0e 100644
26ba25
--- a/block/dirty-bitmap.c
26ba25
+++ b/block/dirty-bitmap.c
26ba25
@@ -806,9 +806,9 @@ void bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const BdrvDirtyBitmap *src,
26ba25
 
26ba25
     qemu_mutex_lock(dest->mutex);
26ba25
 
26ba25
-    if (bdrv_dirty_bitmap_frozen(dest)) {
26ba25
-        error_setg(errp, "Bitmap '%s' is frozen and cannot be modified",
26ba25
-                   dest->name);
26ba25
+    if (bdrv_dirty_bitmap_user_locked(dest)) {
26ba25
+        error_setg(errp, "Bitmap '%s' is currently in use by another"
26ba25
+        " operation and cannot be modified", dest->name);
26ba25
         goto out;
26ba25
     }
26ba25
 
26ba25
-- 
26ba25
1.8.3.1
26ba25