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