cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-block-backup-prohibit-backup-from-using-in-use-bitma.patch

26ba25
From 238718e949e885a511fbc9c2486bddec78682341 Mon Sep 17 00:00:00 2001
26ba25
From: John Snow <jsnow@redhat.com>
26ba25
Date: Tue, 20 Nov 2018 18:18:20 +0000
26ba25
Subject: [PATCH 26/35] block/backup: prohibit backup from using in use bitmaps
26ba25
26ba25
RH-Author: John Snow <jsnow@redhat.com>
26ba25
Message-id: <20181120181828.15132-17-jsnow@redhat.com>
26ba25
Patchwork-id: 83076
26ba25
O-Subject: [RHEL8/rhel qemu-kvm PATCH 16/24] block/backup: prohibit backup from using in use bitmaps
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
If the bitmap is frozen, we shouldn't touch it.
26ba25
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
26ba25
Message-id: 20181002230218.13949-6-jsnow@redhat.com
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
(cherry picked from commit b27a6b8b329a8dcbab9dc1af45586f7585f3d47b)
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 blockdev.c | 12 ++++++------
26ba25
 1 file changed, 6 insertions(+), 6 deletions(-)
26ba25
26ba25
diff --git a/blockdev.c b/blockdev.c
26ba25
index 916153e..56a3d0f 100644
26ba25
--- a/blockdev.c
26ba25
+++ b/blockdev.c
26ba25
@@ -3622,10 +3622,10 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
26ba25
             bdrv_unref(target_bs);
26ba25
             goto out;
26ba25
         }
26ba25
-        if (bdrv_dirty_bitmap_qmp_locked(bmap)) {
26ba25
+        if (bdrv_dirty_bitmap_user_locked(bmap)) {
26ba25
             error_setg(errp,
26ba25
-                       "Bitmap '%s' is currently locked and cannot be used for "
26ba25
-                       "backup", backup->bitmap);
26ba25
+                       "Bitmap '%s' is currently in use by another operation"
26ba25
+                       " and cannot be used for backup", backup->bitmap);
26ba25
             goto out;
26ba25
         }
26ba25
     }
26ba25
@@ -3730,10 +3730,10 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
26ba25
             error_setg(errp, "Bitmap '%s' could not be found", backup->bitmap);
26ba25
             goto out;
26ba25
         }
26ba25
-        if (bdrv_dirty_bitmap_qmp_locked(bmap)) {
26ba25
+        if (bdrv_dirty_bitmap_user_locked(bmap)) {
26ba25
             error_setg(errp,
26ba25
-                       "Bitmap '%s' is currently locked and cannot be used for "
26ba25
-                       "backup", backup->bitmap);
26ba25
+                       "Bitmap '%s' is currently in use by another operation"
26ba25
+                       " and cannot be used for backup", backup->bitmap);
26ba25
             goto out;
26ba25
         }
26ba25
     }
26ba25
-- 
26ba25
1.8.3.1
26ba25