F: qapi/job.json
F: block/block-copy.c
F: include/block/block-copy.c
-F: block/backup-top.h
-F: block/backup-top.c
+F: block/copy-before-write.h
+F: block/copy-before-write.c
F: include/block/aio_task.h
F: block/aio_task.c
F: util/qemu-co-shared-resource.c
+++ /dev/null
-/*
- * backup-top filter driver
- *
- * The driver performs Copy-Before-Write (CBW) operation: it is injected above
- * some node, and before each write it copies _old_ data to the target node.
- *
- * Copyright (c) 2018-2019 Virtuozzo International GmbH.
- *
- * Author:
- * Sementsov-Ogievskiy Vladimir <vsementsov@virtuozzo.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "qemu/osdep.h"
-
-#include "sysemu/block-backend.h"
-#include "qemu/cutils.h"
-#include "qapi/error.h"
-#include "block/block_int.h"
-#include "block/qdict.h"
-#include "block/block-copy.h"
-
-#include "block/backup-top.h"
-
-typedef struct BDRVBackupTopState {
- BlockCopyState *bcs;
- BdrvChild *target;
- int64_t cluster_size;
-} BDRVBackupTopState;
-
-static coroutine_fn int backup_top_co_preadv(
- BlockDriverState *bs, uint64_t offset, uint64_t bytes,
- QEMUIOVector *qiov, int flags)
-{
- return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags);
-}
-
-static coroutine_fn int backup_top_cbw(BlockDriverState *bs, uint64_t offset,
- uint64_t bytes, BdrvRequestFlags flags)
-{
- BDRVBackupTopState *s = bs->opaque;
- uint64_t off, end;
-
- if (flags & BDRV_REQ_WRITE_UNCHANGED) {
- return 0;
- }
-
- off = QEMU_ALIGN_DOWN(offset, s->cluster_size);
- end = QEMU_ALIGN_UP(offset + bytes, s->cluster_size);
-
- return block_copy(s->bcs, off, end - off, true);
-}
-
-static int coroutine_fn backup_top_co_pdiscard(BlockDriverState *bs,
- int64_t offset, int bytes)
-{
- int ret = backup_top_cbw(bs, offset, bytes, 0);
- if (ret < 0) {
- return ret;
- }
-
- return bdrv_co_pdiscard(bs->backing, offset, bytes);
-}
-
-static int coroutine_fn backup_top_co_pwrite_zeroes(BlockDriverState *bs,
- int64_t offset, int bytes, BdrvRequestFlags flags)
-{
- int ret = backup_top_cbw(bs, offset, bytes, flags);
- if (ret < 0) {
- return ret;
- }
-
- return bdrv_co_pwrite_zeroes(bs->backing, offset, bytes, flags);
-}
-
-static coroutine_fn int backup_top_co_pwritev(BlockDriverState *bs,
- uint64_t offset,
- uint64_t bytes,
- QEMUIOVector *qiov, int flags)
-{
- int ret = backup_top_cbw(bs, offset, bytes, flags);
- if (ret < 0) {
- return ret;
- }
-
- return bdrv_co_pwritev(bs->backing, offset, bytes, qiov, flags);
-}
-
-static int coroutine_fn backup_top_co_flush(BlockDriverState *bs)
-{
- if (!bs->backing) {
- return 0;
- }
-
- return bdrv_co_flush(bs->backing->bs);
-}
-
-static void backup_top_refresh_filename(BlockDriverState *bs)
-{
- if (bs->backing == NULL) {
- /*
- * we can be here after failed bdrv_attach_child in
- * bdrv_set_backing_hd
- */
- return;
- }
- pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
- bs->backing->bs->filename);
-}
-
-static void backup_top_child_perm(BlockDriverState *bs, BdrvChild *c,
- BdrvChildRole role,
- BlockReopenQueue *reopen_queue,
- uint64_t perm, uint64_t shared,
- uint64_t *nperm, uint64_t *nshared)
-{
- if (!(role & BDRV_CHILD_FILTERED)) {
- /*
- * Target child
- *
- * Share write to target (child_file), to not interfere
- * with guest writes to its disk which may be in target backing chain.
- * Can't resize during a backup block job because we check the size
- * only upfront.
- */
- *nshared = BLK_PERM_ALL & ~BLK_PERM_RESIZE;
- *nperm = BLK_PERM_WRITE;
- } else {
- /* Source child */
- bdrv_default_perms(bs, c, role, reopen_queue,
- perm, shared, nperm, nshared);
-
- if (perm & BLK_PERM_WRITE) {
- *nperm = *nperm | BLK_PERM_CONSISTENT_READ;
- }
- *nshared &= ~(BLK_PERM_WRITE | BLK_PERM_RESIZE);
- }
-}
-
-BlockDriver bdrv_backup_top_filter = {
- .format_name = "backup-top",
- .instance_size = sizeof(BDRVBackupTopState),
-
- .bdrv_co_preadv = backup_top_co_preadv,
- .bdrv_co_pwritev = backup_top_co_pwritev,
- .bdrv_co_pwrite_zeroes = backup_top_co_pwrite_zeroes,
- .bdrv_co_pdiscard = backup_top_co_pdiscard,
- .bdrv_co_flush = backup_top_co_flush,
-
- .bdrv_refresh_filename = backup_top_refresh_filename,
-
- .bdrv_child_perm = backup_top_child_perm,
-
- .is_filter = true,
-};
-
-BlockDriverState *bdrv_backup_top_append(BlockDriverState *source,
- BlockDriverState *target,
- const char *filter_node_name,
- uint64_t cluster_size,
- BackupPerf *perf,
- BdrvRequestFlags write_flags,
- BlockCopyState **bcs,
- Error **errp)
-{
- ERRP_GUARD();
- int ret;
- BDRVBackupTopState *state;
- BlockDriverState *top;
- bool appended = false;
-
- assert(source->total_sectors == target->total_sectors);
-
- top = bdrv_new_open_driver(&bdrv_backup_top_filter, filter_node_name,
- BDRV_O_RDWR, errp);
- if (!top) {
- return NULL;
- }
-
- state = top->opaque;
- top->total_sectors = source->total_sectors;
- top->supported_write_flags = BDRV_REQ_WRITE_UNCHANGED |
- (BDRV_REQ_FUA & source->supported_write_flags);
- top->supported_zero_flags = BDRV_REQ_WRITE_UNCHANGED |
- ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) &
- source->supported_zero_flags);
-
- bdrv_ref(target);
- state->target = bdrv_attach_child(top, target, "target", &child_of_bds,
- BDRV_CHILD_DATA, errp);
- if (!state->target) {
- bdrv_unref(target);
- bdrv_unref(top);
- return NULL;
- }
-
- bdrv_drained_begin(source);
-
- ret = bdrv_append(top, source, errp);
- if (ret < 0) {
- error_prepend(errp, "Cannot append backup-top filter: ");
- goto fail;
- }
- appended = true;
-
- state->cluster_size = cluster_size;
- state->bcs = block_copy_state_new(top->backing, state->target,
- cluster_size, perf->use_copy_range,
- write_flags, errp);
- if (!state->bcs) {
- error_prepend(errp, "Cannot create block-copy-state: ");
- goto fail;
- }
- *bcs = state->bcs;
-
- bdrv_drained_end(source);
-
- return top;
-
-fail:
- if (appended) {
- bdrv_backup_top_drop(top);
- } else {
- bdrv_unref(top);
- }
-
- bdrv_drained_end(source);
-
- return NULL;
-}
-
-void bdrv_backup_top_drop(BlockDriverState *bs)
-{
- BDRVBackupTopState *s = bs->opaque;
-
- bdrv_drop_filter(bs, &error_abort);
-
- block_copy_state_free(s->bcs);
-
- bdrv_unref(bs);
-}
+++ /dev/null
-/*
- * backup-top filter driver
- *
- * The driver performs Copy-Before-Write (CBW) operation: it is injected above
- * some node, and before each write it copies _old_ data to the target node.
- *
- * Copyright (c) 2018-2019 Virtuozzo International GmbH.
- *
- * Author:
- * Sementsov-Ogievskiy Vladimir <vsementsov@virtuozzo.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef BACKUP_TOP_H
-#define BACKUP_TOP_H
-
-#include "block/block_int.h"
-#include "block/block-copy.h"
-
-BlockDriverState *bdrv_backup_top_append(BlockDriverState *source,
- BlockDriverState *target,
- const char *filter_node_name,
- uint64_t cluster_size,
- BackupPerf *perf,
- BdrvRequestFlags write_flags,
- BlockCopyState **bcs,
- Error **errp);
-void bdrv_backup_top_drop(BlockDriverState *bs);
-
-#endif /* BACKUP_TOP_H */
#include "qemu/bitmap.h"
#include "qemu/error-report.h"
-#include "block/backup-top.h"
+#include "block/copy-before-write.h"
#define BACKUP_CLUSTER_SIZE_DEFAULT (1 << 16)
typedef struct BackupBlockJob {
BlockJob common;
- BlockDriverState *backup_top;
+ BlockDriverState *cbw;
BlockDriverState *source_bs;
BlockDriverState *target_bs;
{
BackupBlockJob *s = container_of(job, BackupBlockJob, common.job);
block_job_remove_all_bdrv(&s->common);
- bdrv_backup_top_drop(s->backup_top);
+ bdrv_cbw_drop(s->cbw);
}
void backup_do_checkpoint(BlockJob *job, Error **errp)
BackupBlockJob *job = NULL;
int64_t cluster_size;
BdrvRequestFlags write_flags;
- BlockDriverState *backup_top = NULL;
+ BlockDriverState *cbw = NULL;
BlockCopyState *bcs = NULL;
assert(bs);
write_flags = (bdrv_chain_contains(target, bs) ? BDRV_REQ_SERIALISING : 0) |
(compress ? BDRV_REQ_WRITE_COMPRESSED : 0),
- backup_top = bdrv_backup_top_append(bs, target, filter_node_name,
+ cbw = bdrv_cbw_append(bs, target, filter_node_name,
cluster_size, perf,
write_flags, &bcs, errp);
- if (!backup_top) {
+ if (!cbw) {
goto error;
}
/* job->len is fixed, so we can't allow resize */
- job = block_job_create(job_id, &backup_job_driver, txn, backup_top,
+ job = block_job_create(job_id, &backup_job_driver, txn, cbw,
0, BLK_PERM_ALL,
speed, creation_flags, cb, opaque, errp);
if (!job) {
goto error;
}
- job->backup_top = backup_top;
+ job->cbw = cbw;
job->source_bs = bs;
job->target_bs = target;
job->on_source_error = on_source_error;
block_copy_set_progress_meter(bcs, &job->common.job.progress);
block_copy_set_speed(bcs, speed);
- /* Required permissions are already taken by backup-top target */
+ /* Required permissions are taken by copy-before-write filter target */
block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL,
&error_abort);
if (sync_bitmap) {
bdrv_reclaim_dirty_bitmap(sync_bitmap, NULL);
}
- if (backup_top) {
- bdrv_backup_top_drop(backup_top);
+ if (cbw) {
+ bdrv_cbw_drop(cbw);
}
return NULL;
--- /dev/null
+/*
+ * copy-before-write filter driver
+ *
+ * The driver performs Copy-Before-Write (CBW) operation: it is injected above
+ * some node, and before each write it copies _old_ data to the target node.
+ *
+ * Copyright (c) 2018-2021 Virtuozzo International GmbH.
+ *
+ * Author:
+ * Sementsov-Ogievskiy Vladimir <vsementsov@virtuozzo.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+
+#include "sysemu/block-backend.h"
+#include "qemu/cutils.h"
+#include "qapi/error.h"
+#include "block/block_int.h"
+#include "block/qdict.h"
+#include "block/block-copy.h"
+
+#include "block/copy-before-write.h"
+
+typedef struct BDRVCopyBeforeWriteState {
+ BlockCopyState *bcs;
+ BdrvChild *target;
+ int64_t cluster_size;
+} BDRVCopyBeforeWriteState;
+
+static coroutine_fn int cbw_co_preadv(
+ BlockDriverState *bs, uint64_t offset, uint64_t bytes,
+ QEMUIOVector *qiov, int flags)
+{
+ return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags);
+}
+
+static coroutine_fn int cbw_do_copy_before_write(BlockDriverState *bs,
+ uint64_t offset, uint64_t bytes, BdrvRequestFlags flags)
+{
+ BDRVCopyBeforeWriteState *s = bs->opaque;
+ uint64_t off, end;
+
+ if (flags & BDRV_REQ_WRITE_UNCHANGED) {
+ return 0;
+ }
+
+ off = QEMU_ALIGN_DOWN(offset, s->cluster_size);
+ end = QEMU_ALIGN_UP(offset + bytes, s->cluster_size);
+
+ return block_copy(s->bcs, off, end - off, true);
+}
+
+static int coroutine_fn cbw_co_pdiscard(BlockDriverState *bs,
+ int64_t offset, int bytes)
+{
+ int ret = cbw_do_copy_before_write(bs, offset, bytes, 0);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return bdrv_co_pdiscard(bs->backing, offset, bytes);
+}
+
+static int coroutine_fn cbw_co_pwrite_zeroes(BlockDriverState *bs,
+ int64_t offset, int bytes, BdrvRequestFlags flags)
+{
+ int ret = cbw_do_copy_before_write(bs, offset, bytes, flags);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return bdrv_co_pwrite_zeroes(bs->backing, offset, bytes, flags);
+}
+
+static coroutine_fn int cbw_co_pwritev(BlockDriverState *bs,
+ uint64_t offset,
+ uint64_t bytes,
+ QEMUIOVector *qiov, int flags)
+{
+ int ret = cbw_do_copy_before_write(bs, offset, bytes, flags);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return bdrv_co_pwritev(bs->backing, offset, bytes, qiov, flags);
+}
+
+static int coroutine_fn cbw_co_flush(BlockDriverState *bs)
+{
+ if (!bs->backing) {
+ return 0;
+ }
+
+ return bdrv_co_flush(bs->backing->bs);
+}
+
+static void cbw_refresh_filename(BlockDriverState *bs)
+{
+ if (bs->backing == NULL) {
+ /*
+ * we can be here after failed bdrv_attach_child in
+ * bdrv_set_backing_hd
+ */
+ return;
+ }
+ pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
+ bs->backing->bs->filename);
+}
+
+static void cbw_child_perm(BlockDriverState *bs, BdrvChild *c,
+ BdrvChildRole role,
+ BlockReopenQueue *reopen_queue,
+ uint64_t perm, uint64_t shared,
+ uint64_t *nperm, uint64_t *nshared)
+{
+ if (!(role & BDRV_CHILD_FILTERED)) {
+ /*
+ * Target child
+ *
+ * Share write to target (child_file), to not interfere
+ * with guest writes to its disk which may be in target backing chain.
+ * Can't resize during a backup block job because we check the size
+ * only upfront.
+ */
+ *nshared = BLK_PERM_ALL & ~BLK_PERM_RESIZE;
+ *nperm = BLK_PERM_WRITE;
+ } else {
+ /* Source child */
+ bdrv_default_perms(bs, c, role, reopen_queue,
+ perm, shared, nperm, nshared);
+
+ if (perm & BLK_PERM_WRITE) {
+ *nperm = *nperm | BLK_PERM_CONSISTENT_READ;
+ }
+ *nshared &= ~(BLK_PERM_WRITE | BLK_PERM_RESIZE);
+ }
+}
+
+BlockDriver bdrv_cbw_filter = {
+ .format_name = "copy-before-write",
+ .instance_size = sizeof(BDRVCopyBeforeWriteState),
+
+ .bdrv_co_preadv = cbw_co_preadv,
+ .bdrv_co_pwritev = cbw_co_pwritev,
+ .bdrv_co_pwrite_zeroes = cbw_co_pwrite_zeroes,
+ .bdrv_co_pdiscard = cbw_co_pdiscard,
+ .bdrv_co_flush = cbw_co_flush,
+
+ .bdrv_refresh_filename = cbw_refresh_filename,
+
+ .bdrv_child_perm = cbw_child_perm,
+
+ .is_filter = true,
+};
+
+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)
+{
+ ERRP_GUARD();
+ int ret;
+ BDRVCopyBeforeWriteState *state;
+ BlockDriverState *top;
+ bool appended = false;
+
+ assert(source->total_sectors == target->total_sectors);
+
+ top = bdrv_new_open_driver(&bdrv_cbw_filter, filter_node_name,
+ BDRV_O_RDWR, errp);
+ if (!top) {
+ return NULL;
+ }
+
+ state = top->opaque;
+ top->total_sectors = source->total_sectors;
+ top->supported_write_flags = BDRV_REQ_WRITE_UNCHANGED |
+ (BDRV_REQ_FUA & source->supported_write_flags);
+ top->supported_zero_flags = BDRV_REQ_WRITE_UNCHANGED |
+ ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) &
+ source->supported_zero_flags);
+
+ bdrv_ref(target);
+ state->target = bdrv_attach_child(top, target, "target", &child_of_bds,
+ BDRV_CHILD_DATA, errp);
+ if (!state->target) {
+ bdrv_unref(target);
+ bdrv_unref(top);
+ return NULL;
+ }
+
+ bdrv_drained_begin(source);
+
+ ret = bdrv_append(top, source, errp);
+ if (ret < 0) {
+ error_prepend(errp, "Cannot append copy-before-write filter: ");
+ goto fail;
+ }
+ appended = true;
+
+ state->cluster_size = cluster_size;
+ state->bcs = block_copy_state_new(top->backing, state->target,
+ cluster_size, perf->use_copy_range,
+ write_flags, errp);
+ if (!state->bcs) {
+ error_prepend(errp, "Cannot create block-copy-state: ");
+ goto fail;
+ }
+ *bcs = state->bcs;
+
+ bdrv_drained_end(source);
+
+ return top;
+
+fail:
+ if (appended) {
+ bdrv_cbw_drop(top);
+ } else {
+ bdrv_unref(top);
+ }
+
+ bdrv_drained_end(source);
+
+ return NULL;
+}
+
+void bdrv_cbw_drop(BlockDriverState *bs)
+{
+ BDRVCopyBeforeWriteState *s = bs->opaque;
+
+ bdrv_drop_filter(bs, &error_abort);
+
+ block_copy_state_free(s->bcs);
+
+ bdrv_unref(bs);
+}
--- /dev/null
+/*
+ * copy-before-write filter driver
+ *
+ * The driver performs Copy-Before-Write (CBW) operation: it is injected above
+ * some node, and before each write it copies _old_ data to the target node.
+ *
+ * Copyright (c) 2018-2021 Virtuozzo International GmbH.
+ *
+ * Author:
+ * Sementsov-Ogievskiy Vladimir <vsementsov@virtuozzo.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef COPY_BEFORE_WRITE_H
+#define COPY_BEFORE_WRITE_H
+
+#include "block/block_int.h"
+#include "block/block-copy.h"
+
+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);
+void bdrv_cbw_drop(BlockDriverState *bs);
+
+#endif /* COPY_BEFORE_WRITE_H */
'aio_task.c',
'amend.c',
'backup.c',
- 'backup-top.c',
+ 'copy-before-write.c',
'blkdebug.c',
'blklogwrites.c',
'blkverify.c',
#!/usr/bin/env python3
# group: auto quick
#
-# Test for backup-top filter permission activation failure
+# Test for copy-before-write filter permission conflict
#
# Copyright (c) 2019 Virtuozzo International GmbH.
#
""" Test description
When performing a backup, all writes on the source subtree must go through the
-backup-top filter so it can copy all data to the target before it is changed.
-backup-top filter is appended above source node, to achieve this thing, so all
-parents of source node are handled. A configuration with side parents of source
-sub-tree with write permission is unsupported (we'd have append several
-backup-top filter like nodes to handle such parents). The test create an
-example of such configuration and checks that a backup is then not allowed
-(blockdev-backup command should fail).
+copy-before-write filter so it can copy all data to the target before it is
+changed. copy-before-write filter is appended above source node, to achieve
+this thing, so all parents of source node are handled. A configuration with
+side parents of source sub-tree with write permission is unsupported (we'd have
+append several copy-before-write filter like nodes to handle such parents). The
+test create an example of such configuration and checks that a backup is then
+not allowed (blockdev-backup command should fail).
The configuration:
│ base │ ◀──────────── │ other │
└─────────────┘ └───────┘
-On activation (see .active field of backup-top state in block/backup-top.c),
-backup-top is going to unshare write permission on its source child. Write
-unsharing will be propagated to the "source->base" link and will conflict with
-other node write permission. So permission update will fail and backup job will
-not be started.
+copy-before-write filter wants to unshare write permission on its source child.
+Write unsharing will be propagated to the "source->base" link and will conflict
+with other node write permission. So permission update will fail and backup job
+will not be started.
Note, that the only thing which prevents backup of running on such
configuration is default permission propagation scheme. It may be altered by
vm.shutdown()
-print('\n=== backup-top should be gone after job-finalize ===\n')
+print('\n=== copy-before-write filter should be gone after job-finalize ===\n')
-# Check that the backup-top node is gone after job-finalize.
-#
-# During finalization, the node becomes inactive and can no longer
-# function. If it is still present, new parents might be attached, and
-# there would be no meaningful way to handle their I/O requests.
+# Check that the copy-before-write node is gone after job-finalize.
vm = iotests.VM()
vm.launch()
vm.event_wait('BLOCK_JOB_PENDING', 5.0)
-# The backup-top filter should still be present prior to finalization
+# The copy-before-write filter should still be present prior to finalization
assert vm.node_info('backup-filter') is not None
vm.qmp_log('job-finalize', id='backup')
{"execute": "blockdev-add", "arguments": {"driver": "blkdebug", "image": "base", "node-name": "other", "take-child-perms": ["write"]}}
{"return": {}}
{"execute": "blockdev-backup", "arguments": {"device": "source", "sync": "full", "target": "target"}}
-{"error": {"class": "GenericError", "desc": "Cannot append backup-top filter: Permission conflict on node 'base': permissions 'write' are both required by node 'other' (uses node 'base' as 'image' child) and unshared by node 'source' (uses node 'base' as 'image' child)."}}
+{"error": {"class": "GenericError", "desc": "Cannot append copy-before-write filter: Permission conflict on node 'base': permissions 'write' are both required by node 'other' (uses node 'base' as 'image' child) and unshared by node 'source' (uses node 'base' as 'image' child)."}}
-=== backup-top should be gone after job-finalize ===
+=== copy-before-write filter should be gone after job-finalize ===
{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "source"}}
{"return": {}}