Intermediate `block-stream`, with 'node-name' for 'base' parameter ================================================================== Goal: Given, the chain: [A] <-- [B] <-- [C] <-- [D] Merge contents of images [B] into [C], where [C] ends up referring to [A] as its backing image, and the final image chain will end up being: [A] <-- [C] <-- [D] #---------------------------------------------------------------------- (1) Launch QEMU as following: $ ~/build/qemu-upstream/x86_64-softmmu/qemu-system-x86_64 -M q35 \ -display none -nodefconfig -nodefaults -m 512 \ -blockdev node-name=node-A,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./a.qcow2 \ -device virtio-blk,drive=node-A,id=virtio0 \ -S -monitor stdio -qmp unix:./qmp-sock,server,nowait #---------------------------------------------------------------------- (2) Create three overlays: (QEMU) blockdev-snapshot-sync node-name=node-A snapshot-file=b.qcow2 snapshot-node-name=node-B format=qcow2 (QEMU) blockdev-snapshot-sync node-name=node-B snapshot-file=c.qcow2 snapshot-node-name=node-C format=qcow2 (QEMU) blockdev-snapshot-sync node-name=node-C snapshot-file=d.qcow2 snapshot-node-name=node-D format=qcow2 #---------------------------------------------------------------------- (3) Check the backing file depth, it is indeed: A <- B <- C <- D: $ qemu-img info --backing-chain d.qcow2 | grep "backing file:" backing file: c.qcow2 backing file: b.qcow2 backing file: ./a.qcow2 #---------------------------------------------------------------------- (4) Perform intermediate streaming: (QEMU) block-stream device=node-C base-node=node-A job-id=job0 { "execute": "block-stream", "arguments": { "device": "node-D", "job-id": "job0", "base-node": "node-A" } } { "return": {} } (QEMU) {u'timestamp': {u'seconds': 1496325065, u'microseconds': 808768}, u'data': {u'device': u'job0', u'type': u'stream', u'speed': 0, u'len': 41126400, u'offset': 41126400}, u'event': u'BLOCK_JOB_COMPLETED'} #---------------------------------------------------------------------- (5) Check the backing file depth, it is now: A <- C <- D: $ qemu-img info --backing-chain d.qcow2 | grep "backing file:" backing file: c.qcow2 backing file: ./a.qcow2 #----------------------------------------------------------------------