The QEMU commit (along with other supporting commits) added '-blockdev' implementation that is available from QEMU 2.9 release onwards. commit 42e5f39378c6e7a0ada563779bbb6f470f7c03ff Author: Markus Armbruster Date: Tue Feb 28 22:27:07 2017 +0100 block: Initial implementation of -blockdev [...] Examples ======== [I included the '-qmp' QMP server, but that optional, I added it here for my own convenience.] Example-1: The traditiona dotted-key syntax: ----------------------------------------------------------------------- $ ./x86_64-softmmu/qemu-system-x86_64 -display none -nodefconfig \ -nodefaults -m 512 \ -blockdev node-name=node-A,driver=qcow2,file.driver=file,file.filename=./a.qcow2 \ -device virtio-blk,drive=node-A,id=virtio0 \ -monitor stdio -qmp unix:./qmp-sock,server,nowait ----------------------------------------------------------------------- Example-2: The equivalent JSON syntax for '-blockdev': ----------------------------------------------------------------------- $ ./x86_64-softmmu/qemu-system-x86_64 -display none -nodefconfig \ -nodefaults -m 512 \ -blockdev '{"node-name": "node-A", "driver": "qcow2", "file": {"driver": "file", "filename": "a.qcow2"} }' -device virtio-blk,drive=node-A,id=virtio0 \ -monitor stdio -qmp unix:./qmp-sock,server,nowait ----------------------------------------------------------------------- * * * Notes ===== Since QEMU 2.9, command-line '-blockdev' is a flattenned mapping of QMP `blockdev-add`: Therefore, QMP `blockdev-add`: ----------------------------------------------------------------------- { "execute":"blockdev-add", "arguments":{ "driver":"qcow2", "node-name":"node1", "file":{ "driver":"file", "filename":"./disk1.qcow2" } } } ----------------------------------------------------------------------- Becomes the following command-line '-blockdev' equivalent: ----------------------------------------------------------------------- $ qemu-system-x86 [...]\ -blockdev driver=qcow2,node-name=node1, \ file.driver=file,file.filename=./disk1.qcow2 [...] ----------------------------------------------------------------------- Additional info =============== To create an overlay chain: [A] <-- [B] <-- [C] <-- [D] Using the QMP `blockdev-snapshot-sync`, using 'qmp-shell', use the following (so that 'node-name' parameters are included): ----------------------------------------------------------------------- $ ./qmp-shell -v -p /tmp/qmp-sock (QEMU) (QEMU) blockdev-snapshot-sync node-name=node-A snapshot-file=b.qcow2 snapshot-node-name=node-B format=qcow2 { "execute": "blockdev-snapshot-sync", "arguments": { "node-name": "node-A", "snapshot-file": "b.qcow2", "format": "qcow2", "snapshot-node-name": "node-B" } } { "return": {} } ----------------------------------------------------------------------- And so on for further overlays, [C], and [D]: (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