Hi all! We have image fleecing scheme to export point-in-time state of active disk (iotest 222):
backup(sync=none) ┌───────────────────────────────────────┐ ▼ │ ┌────────────┐ ┌────────────────┐ backing ┌─────────────┐ │ NBD export │ ─── │ temp qcow2 img │ ───────────────────▶ │ active disk │ └────────────┘ └────────────────┘ └─────────────┘ ▲ ┌────────────┐ │ │ guest blk │ ──────────────────────────────────────────────┘ └────────────┘ Actually, backup job inserts a backup-top filter, so in detail it looks like: backup(sync=none) ┌───────────────────────────────────────┐ ▼ │ ┌────────────┐ ┌────────────────┐ backing ┌─────────────┐ │ NBD export │ ─── │ temp qcow2 img │ ───────────────────▶ │ active disk │ └────────────┘ └────────────────┘ └─────────────┘ ▲ ▲ │ target │ │ │ ┌────────────┐ ┌────────────────┐ backing │ │ guest blk │ ──▶ │ backup-top │ ───────────────────────┘ └────────────┘ └────────────────┘ And job does nothing here. In a new blockdev world user is intended to operate on node level, and insert/remove filters by hand. Let's get rid of job in the scheme: ┌────────────┐ ┌────────────────┐ backing ┌─────────────┐ │ NBD export │ ─── │ temp qcow2 img │ ───────────────────▶ │ active disk │ └────────────┘ └────────────────┘ └─────────────┘ ▲ ▲ │ target │ │ │ ┌────────────┐ ┌────────────────┐ backing │ │ guest blk │ ──▶ │ backup-top │ ───────────────────────┘ └────────────┘ └────────────────┘ The series prepares qom-set to make possible inserting filters above root node (patches 01-04), rename backup-top to copy-before-write, do other preparations for publishing the filter, and finally publish it, add qapi interface and test new fleecing scheme in 222. Vladimir Sementsov-Ogievskiy (21): block: introduce bdrv_replace_child_bs() block: introduce blk_replace_bs qdev-properties: PropertyInfo: add realized_set_allowed field qdev: allow setting drive property for realized device block: rename backup-top to copy-before-write block/backup: drop support for copy_range block-copy: always set BDRV_REQ_SERIALISING flag block/backup: stricter backup_calculate_cluster_size() block/backup: move cluster size calculation to block-copy block/copy-before-write: relax permission requirements when no parents block/copy-before-write: use file child instead of backing block/copy-before-write: bdrv_cbw_append(): replace child at last block/copy-before-write: introduce cbw_init() block/copy-before-write: cbw_init(): rename variables block/copy-before-write: cbw_init(): use file child after attaching block/copy-before-write: cbw_init(): use options block/block-copy: switch to fully set bitmap by default block/block-copy: make setting progress optional block/copy-before-write: make public block driver qapi: publish copy-before-write filter itotests/222: add test-case for copy-before-write filter qapi/block-core.json | 22 +- block/{backup-top.h => copy-before-write.h} | 26 +- include/block/block-copy.h | 4 +- include/block/block.h | 2 + include/hw/qdev-properties.h | 1 + include/sysemu/block-backend.h | 1 + block.c | 36 +++ block/backup-top.c | 253 ------------------- block/backup.c | 115 ++------- block/block-backend.c | 8 + block/block-copy.c | 95 +++++++- block/copy-before-write.c | 257 ++++++++++++++++++++ hw/core/qdev-properties-system.c | 30 ++- hw/core/qdev-properties.c | 6 +- MAINTAINERS | 4 +- block/meson.build | 2 +- tests/qemu-iotests/222 | 56 ++++- tests/qemu-iotests/222.out | 72 ++++++ tests/qemu-iotests/283 | 35 ++- tests/qemu-iotests/283.out | 4 +- 20 files changed, 606 insertions(+), 423 deletions(-) rename block/{backup-top.h => copy-before-write.h} (56%) delete mode 100644 block/backup-top.c create mode 100644 block/copy-before-write.c -- 2.29.2