[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/33] block/backup: drop support for copy_range
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v2 08/33] block/backup: drop support for copy_range |
Date: |
Thu, 20 May 2021 17:21:40 +0300 |
copy_range is not a default behavior since 6a30f663d4c0b3c, and it's
now available only though x-perf experimantal argument, so it's OK to
drop it.
Even when backup is used to copy disk to same filesystem, and
filesystem supports zero-copy copy_range, copy_range is probably not
what we want for backup: backup has good property of making a copy of
active disk, with no impact to active disk itself (unlike creating a
snapshot). And if copy_range instead of copying data adds fs-level
references, and on next guest write COW operation occurs, it's seems
most possible, that new block will be allocated for original vm disk,
not for backup disk. Thus, fragmentation of original disk will
increase.
We can simply add support back on demand. Now we want to publish
copy-before-write filter, and instead of thinking how to pass
use-copy-range argument to block-copy (create x-block-copy parameter
for new public filter driver, or may be set it by hand after filter
node creation?), instead of this let's just drop copy-range support in
backup for now.
After this patch copy-range support in block-copy becomes unused. Let's
keep it for a while, it won't hurt:
1. If there would be request for supporting copy_range in backup
(and/or in a new public copy-before-write filter), it will be easy
to satisfy it.
2. Probably, qemu-img convert will reuse block-copy, and qemu-img has
option to enable copy-range. qemu-img convert is not a backup, and
copy_range may be more reasonable for some cases in context of
qemu-img convert.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
---
block/copy-before-write.h | 1 -
block/backup.c | 3 +--
block/copy-before-write.c | 4 +---
3 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/block/copy-before-write.h b/block/copy-before-write.h
index 5977b7aa31..e284dfb6a7 100644
--- a/block/copy-before-write.h
+++ b/block/copy-before-write.h
@@ -33,7 +33,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
BlockDriverState *target,
const char *filter_node_name,
uint64_t cluster_size,
- BackupPerf *perf,
BdrvRequestFlags write_flags,
BlockCopyState **bcs,
Error **errp);
diff --git a/block/backup.c b/block/backup.c
index ac91821b08..d41dd30e25 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -522,8 +522,7 @@ BlockJob *backup_job_create(const char *job_id,
BlockDriverState *bs,
(compress ? BDRV_REQ_WRITE_COMPRESSED : 0),
cbw = bdrv_cbw_append(bs, target, filter_node_name,
- cluster_size, perf,
- write_flags, &bcs, errp);
+ cluster_size, write_flags, &bcs, errp);
if (!cbw) {
goto error;
}
diff --git a/block/copy-before-write.c b/block/copy-before-write.c
index 0dc5a107cf..bc795adb87 100644
--- a/block/copy-before-write.c
+++ b/block/copy-before-write.c
@@ -170,7 +170,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
BlockDriverState *target,
const char *filter_node_name,
uint64_t cluster_size,
- BackupPerf *perf,
BdrvRequestFlags write_flags,
BlockCopyState **bcs,
Error **errp)
@@ -217,8 +216,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
state->cluster_size = cluster_size;
state->bcs = block_copy_state_new(top->backing, state->target,
- cluster_size, perf->use_copy_range,
- write_flags, errp);
+ cluster_size, false, write_flags, errp);
if (!state->bcs) {
error_prepend(errp, "Cannot create block-copy-state: ");
goto fail;
--
2.29.2
- Re: [PATCH v2 01/33] block: rename bdrv_replace_child to bdrv_replace_child_tran, (continued)
- [PATCH v2 05/33] qdev-properties: PropertyInfo: add realized_set_allowed field, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 04/33] block: introduce blk_replace_bs, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 06/33] qdev: allow setting drive property for realized device, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 10/33] block/backup: move cluster size calculation to block-copy, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 07/33] block: rename backup-top to copy-before-write, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 09/33] block-copy: always set BDRV_REQ_SERIALISING flag, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 08/33] block/backup: drop support for copy_range,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v2 11/33] block/copy-before-write: relax permission requirements when no parents, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 12/33] block/copy-before-write: drop extra bdrv_unref on failure path, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 13/33] block/copy-before-write: use file child instead of backing, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 23/33] python/qemu/machine.py: refactor _qemu_args(), Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 28/33] iotests: move 222 to tests/image-fleecing, Vladimir Sementsov-Ogievskiy, 2021/05/20
- [PATCH v2 14/33] block/copy-before-write: bdrv_cbw_append(): replace child at last, Vladimir Sementsov-Ogievskiy, 2021/05/20