[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 18/18] block/backup: loosen restriction on readon
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH v2 18/18] block/backup: loosen restriction on readonly bitmaps |
Date: |
Wed, 3 Jul 2019 17:55:42 -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>
---
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 495d8f71aa..4abe90d462 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -598,6 +598,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 d5b089a446..020ce7e960 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3492,7 +3492,7 @@ static BlockJob *do_backup_common(BackupCommon *backup,
error_setg(errp, "Bitmap '%s' could not be found", backup->bitmap);
goto out;
}
- if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_DEFAULT, errp)) {
+ if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_ALLOW_RO, errp)) {
goto out;
}
}
--
2.21.0
- Re: [Qemu-devel] [PATCH v2 11/18] block/backup: upgrade copy_bitmap to BdrvDirtyBitmap, (continued)
[Qemu-devel] [PATCH v2 13/18] iotests: add testing shim for script-style python tests, John Snow, 2019/07/03
[Qemu-devel] [PATCH v2 15/18] iotests: teach FilePath to produce multiple paths, John Snow, 2019/07/03
[Qemu-devel] [PATCH v2 16/18] iotests: Add virtio-scsi device helper, John Snow, 2019/07/03
[Qemu-devel] [PATCH v2 18/18] block/backup: loosen restriction on readonly bitmaps,
John Snow <=
[Qemu-devel] [PATCH v2 17/18] iotests: add test 257 for bitmap-mode backups, John Snow, 2019/07/03
Re: [Qemu-devel] [PATCH v2 00/18] bitmaps: introduce 'bitmap' sync mode, no-reply, 2019/07/03
Re: [Qemu-devel] [PATCH v2 00/18] bitmaps: introduce 'bitmap' sync mode, no-reply, 2019/07/03
Re: [Qemu-devel] [PATCH v2 00/18] bitmaps: introduce 'bitmap' sync mode, no-reply, 2019/07/04
Re: [Qemu-devel] [PATCH v2 00/18] bitmaps: introduce 'bitmap' sync mode, no-reply, 2019/07/04