[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/36] block/backup: loosen restriction on readonly b
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 18/36] block/backup: loosen restriction on readonly bitmaps |
Date: |
Fri, 16 Aug 2019 19:13:00 -0400 |
With the "never" sync policy, we actually can utilize readonly bitmaps
now. Loosen the check at the QMP level, and tighten it based on
provided arguments down at the job creation level instead.
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: John Snow <address@hidden>
---
block/backup.c | 6 ++++++
blockdev.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/block/backup.c b/block/backup.c
index 2be570c0bfd..f8309be01b3 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -617,6 +617,12 @@ BlockJob *backup_job_create(const char *job_id,
BlockDriverState *bs,
return NULL;
}
+ /* If we need to write to this bitmap, check that we can: */
+ if (bitmap_mode != BITMAP_SYNC_MODE_NEVER &&
+ bdrv_dirty_bitmap_check(sync_bitmap, BDRV_BITMAP_DEFAULT, errp)) {
+ return NULL;
+ }
+
/* Create a new bitmap, and freeze/disable this one. */
if (bdrv_dirty_bitmap_create_successor(bs, sync_bitmap, errp) < 0) {
return NULL;
diff --git a/blockdev.c b/blockdev.c
index 985b6cd75c0..a44ab1f709e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3491,7 +3491,7 @@ static BlockJob *do_backup_common(BackupCommon *backup,
"when providing a bitmap");
return NULL;
}
- if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_DEFAULT, errp)) {
+ if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_ALLOW_RO, errp)) {
return NULL;
}
}
--
2.21.0
- [Qemu-devel] [PULL 06/36] block/backup: add 'never' policy to bitmap sync mode, (continued)
- [Qemu-devel] [PULL 06/36] block/backup: add 'never' policy to bitmap sync mode, John Snow, 2019/08/16
- [Qemu-devel] [PULL 04/36] qapi: add BitmapSyncMode enum, John Snow, 2019/08/16
- [Qemu-devel] [PULL 08/36] hbitmap: enable merging across granularities, John Snow, 2019/08/16
- [Qemu-devel] [PULL 07/36] hbitmap: Fix merge when b is empty, and result is not an alias of a, John Snow, 2019/08/16
- [Qemu-devel] [PULL 09/36] block/dirty-bitmap: add bdrv_dirty_bitmap_merge_internal, John Snow, 2019/08/16
- [Qemu-devel] [PULL 10/36] block/dirty-bitmap: add bdrv_dirty_bitmap_get, John Snow, 2019/08/16
- [Qemu-devel] [PULL 05/36] block/backup: Add mirror sync mode 'bitmap', John Snow, 2019/08/16
- [Qemu-devel] [PULL 14/36] iotests: teach run_job to cancel pending jobs, John Snow, 2019/08/16
- [Qemu-devel] [PULL 15/36] iotests: teach FilePath to produce multiple paths, John Snow, 2019/08/16
- [Qemu-devel] [PULL 13/36] iotests: add testing shim for script-style python tests, John Snow, 2019/08/16
- [Qemu-devel] [PULL 18/36] block/backup: loosen restriction on readonly bitmaps,
John Snow <=
- [Qemu-devel] [PULL 16/36] iotests: Add virtio-scsi device helper, John Snow, 2019/08/16
- [Qemu-devel] [PULL 12/36] block/backup: add 'always' bitmap sync policy, John Snow, 2019/08/16
- [Qemu-devel] [PULL 11/36] block/backup: upgrade copy_bitmap to BdrvDirtyBitmap, John Snow, 2019/08/16
- [Qemu-devel] [PULL 21/36] iotests: test bitmap moving inside 254, John Snow, 2019/08/16
- [Qemu-devel] [PULL 19/36] blockdev: reduce aio_context locked sections in bitmap add/remove, John Snow, 2019/08/16
- [Qemu-devel] [PULL 20/36] qapi: implement block-dirty-bitmap-remove transaction action, John Snow, 2019/08/16
- [Qemu-devel] [PULL 22/36] iotests/257: add Pattern class, John Snow, 2019/08/16
- [Qemu-devel] [PULL 25/36] block/backup: hoist bitmap check into QMP interface, John Snow, 2019/08/16
- [Qemu-devel] [PULL 23/36] iotests/257: add EmulatedBitmap class, John Snow, 2019/08/16
- [Qemu-devel] [PULL 29/36] block/backup: add backup_is_cluster_allocated, John Snow, 2019/08/16