To allow using blockdev-create we need to be able to generate the properties for it, this series adds the necessary bits and also converts to use 'auto-read-only' instead of 'read-only'. Kevin, please look into the test data to see if there's something wrong with the semantic usage. The data is validated against the QMP schema. Format in 2/11 will be used as the 'backing-store' string via the json:// pseudo protocol for recording into new files for network use. 5/11 is the conversion to use auto-read-only. The test data in the patch covers stadard use with -blockdev/blockdev-add 11/11 is the format to be used with 'blockdev-create' Thanks. Peter Krempa (11): qemu: block: Allow skipping non-target related data when formating disk JSON tests: qemublock: Add testing of pure disk source specification JSON generator util: json: Introduce helper to prepend string into a virJSONValueObject qemu: block: Extract formating of 'driver' attribute from child formatters qemu: block: Use 'auto-read-only' instead of 'read-only' for backing chain qemu: block: Add generator for image format creation properties qemu: block: Add generator for creating storage with blockdev-create qemu: domain: Export qemuDomainPrepareStorageSourceBlockdev conf: snapshot: Export virDomainSnapshotDiskDefParseXML conf: snapshot: Provide a function to free virDomainSnapshotDiskDefPtr tests: qemublock: Add testing of 'blockdev-create' generators src/conf/snapshot_conf.c | 13 +- src/conf/snapshot_conf.h | 6 + src/libvirt_private.syms | 1 + src/qemu/qemu_block.c | 584 ++++++++++++++++-- src/qemu/qemu_block.h | 18 +- src/qemu/qemu_command.c | 4 +- src/qemu/qemu_domain.c | 9 +- src/qemu/qemu_domain.h | 5 + src/qemu/qemu_migration.c | 4 +- src/util/virjson.c | 50 +- src/util/virjson.h | 1 + tests/qemublocktest.c | 244 +++++++- .../imagecreate/luks-encopts.json | 19 + .../imagecreate/luks-encopts.xml | 16 + .../imagecreate/luks-noopts.json | 14 + .../imagecreate/luks-noopts.xml | 14 + .../imagecreate/network-gluster-qcow2.json | 28 + .../imagecreate/network-gluster-qcow2.xml | 13 + .../imagecreate/network-rbd-qcow2.json | 26 + .../imagecreate/network-rbd-qcow2.xml | 13 + .../imagecreate/network-sheepdog-qcow2.json | 20 + .../imagecreate/network-sheepdog-qcow2.xml | 12 + .../imagecreate/network-ssh-qcow2.json | 19 + .../imagecreate/network-ssh-qcow2.xml | 12 + .../imagecreate/qcow2-backing-luks.json | 15 + .../imagecreate/qcow2-backing-luks.xml | 1 + .../imagecreate/qcow2-backing-raw-nbd.json | 15 + .../imagecreate/qcow2-backing-raw-nbd.xml | 1 + .../imagecreate/qcow2-backing-raw.json | 15 + .../imagecreate/qcow2-backing-raw.xml | 1 + .../qcow2-luks-encopts-backing.json | 24 + .../qcow2-luks-encopts-backing.xml | 1 + .../imagecreate/qcow2-luks-encopts.json | 22 + .../imagecreate/qcow2-luks-encopts.xml | 16 + .../imagecreate/qcow2-luks-noopts.json | 17 + .../imagecreate/qcow2-luks-noopts.xml | 14 + .../qemublocktestdata/imagecreate/qcow2.json | 13 + tests/qemublocktestdata/imagecreate/qcow2.xml | 11 + .../imagecreate/raw-nbd.json | 4 + .../qemublocktestdata/imagecreate/raw-nbd.xml | 12 + tests/qemublocktestdata/imagecreate/raw.json | 9 + tests/qemublocktestdata/imagecreate/raw.xml | 11 + .../xml2json/block-raw-noopts-srconly.json | 4 + .../xml2json/block-raw-noopts.json | 2 +- .../block-raw-reservations-srconly.json | 4 + .../xml2json/block-raw-reservations.json | 2 +- .../xml2json/dir-fat-cache-srconly.json | 5 + .../xml2json/dir-fat-cache.json | 2 +- .../xml2json/dir-fat-floppy-srconly.json | 5 + .../xml2json/dir-fat-floppy.json | 2 +- .../xml2json/dir-fat-readonly-srconly.json | 5 + .../xml2json/dir-fat-readonly.json | 2 +- ...ile-backing_basic-aio_threads-srconly.json | 24 + .../file-backing_basic-aio_threads.json | 8 +- ...acking_basic-cache-directsync-srconly.json | 24 + .../file-backing_basic-cache-directsync.json | 8 +- ...file-backing_basic-cache-none-srconly.json | 24 + .../file-backing_basic-cache-none.json | 8 +- ...le-backing_basic-cache-unsafe-srconly.json | 24 + .../file-backing_basic-cache-unsafe.json | 8 +- ...backing_basic-cache-writeback-srconly.json | 24 + .../file-backing_basic-cache-writeback.json | 8 +- ...king_basic-cache-writethrough-srconly.json | 24 + ...file-backing_basic-cache-writethrough.json | 8 +- .../file-backing_basic-detect-srconly.json | 24 + .../xml2json/file-backing_basic-detect.json | 8 +- .../file-backing_basic-noopts-srconly.json | 16 + .../xml2json/file-backing_basic-noopts.json | 8 +- ...le-backing_basic-unmap-detect-srconly.json | 24 + .../file-backing_basic-unmap-detect.json | 8 +- ...le-backing_basic-unmap-ignore-srconly.json | 24 + .../file-backing_basic-unmap-ignore.json | 8 +- .../file-backing_basic-unmap-srconly.json | 24 + .../xml2json/file-backing_basic-unmap.json | 8 +- .../xml2json/file-bochs-noopts-srconly.json | 4 + .../xml2json/file-bochs-noopts.json | 2 +- .../xml2json/file-cloop-noopts-srconly.json | 4 + .../xml2json/file-cloop-noopts.json | 2 +- .../xml2json/file-dmg-noopts-srconly.json | 4 + .../xml2json/file-dmg-noopts.json | 2 +- .../xml2json/file-ploop-noopts-srconly.json | 4 + .../xml2json/file-ploop-noopts.json | 2 +- ...cow2-backing-chain-encryption-srconly.json | 8 + .../file-qcow2-backing-chain-encryption.json | 4 +- ...le-qcow2-backing-chain-noopts-srconly.json | 40 ++ .../file-qcow2-backing-chain-noopts.json | 20 +- ...w2-backing-chain-unterminated-srconly.json | 8 + ...file-qcow2-backing-chain-unterminated.json | 4 +- .../xml2json/file-raw-aio_native-srconly.json | 4 + .../xml2json/file-raw-aio_native.json | 2 +- .../xml2json/file-raw-luks-srconly.json | 4 + .../xml2json/file-raw-luks.json | 2 +- .../xml2json/file-raw-noopts-srconly.json | 4 + .../xml2json/file-raw-noopts.json | 2 +- .../xml2json/file-vdi-noopts-srconly.json | 4 + .../xml2json/file-vdi-noopts.json | 2 +- .../xml2json/file-vhd-noopts-srconly.json | 4 + .../xml2json/file-vhd-noopts.json | 2 +- .../xml2json/file-vpc-noopts-srconly.json | 4 + .../xml2json/file-vpc-noopts.json | 2 +- .../xml2json/network-nbd-tls-srconly.json | 8 + .../xml2json/network-nbd-tls.json | 2 +- ...w2-backing-chain-cache-unsafe-srconly.json | 22 + ...work-qcow2-backing-chain-cache-unsafe.json | 4 +- ...backing-chain-encryption_auth-srconly.json | 22 + ...k-qcow2-backing-chain-encryption_auth.json | 4 +- .../qemu-ns.x86_64-4.0.0.args | 2 +- .../qemu-ns.x86_64-latest.args | 2 +- 108 files changed, 1764 insertions(+), 170 deletions(-) create mode 100644 tests/qemublocktestdata/imagecreate/luks-encopts.json create mode 100644 tests/qemublocktestdata/imagecreate/luks-encopts.xml create mode 100644 tests/qemublocktestdata/imagecreate/luks-noopts.json create mode 100644 tests/qemublocktestdata/imagecreate/luks-noopts.xml create mode 100644 tests/qemublocktestdata/imagecreate/network-gluster-qcow2.json create mode 100644 tests/qemublocktestdata/imagecreate/network-gluster-qcow2.xml create mode 100644 tests/qemublocktestdata/imagecreate/network-rbd-qcow2.json create mode 100644 tests/qemublocktestdata/imagecreate/network-rbd-qcow2.xml create mode 100644 tests/qemublocktestdata/imagecreate/network-sheepdog-qcow2.json create mode 100644 tests/qemublocktestdata/imagecreate/network-sheepdog-qcow2.xml create mode 100644 tests/qemublocktestdata/imagecreate/network-ssh-qcow2.json create mode 100644 tests/qemublocktestdata/imagecreate/network-ssh-qcow2.xml create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-backing-luks.json create mode 120000 tests/qemublocktestdata/imagecreate/qcow2-backing-luks.xml create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-backing-raw-nbd.json create mode 120000 tests/qemublocktestdata/imagecreate/qcow2-backing-raw-nbd.xml create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-backing-raw.json create mode 120000 tests/qemublocktestdata/imagecreate/qcow2-backing-raw.xml create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-luks-encopts-backing.json create mode 120000 tests/qemublocktestdata/imagecreate/qcow2-luks-encopts-backing.xml create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-luks-encopts.json create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-luks-encopts.xml create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-luks-noopts.json create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-luks-noopts.xml create mode 100644 tests/qemublocktestdata/imagecreate/qcow2.json create mode 100644 tests/qemublocktestdata/imagecreate/qcow2.xml create mode 100644 tests/qemublocktestdata/imagecreate/raw-nbd.json create mode 100644 tests/qemublocktestdata/imagecreate/raw-nbd.xml create mode 100644 tests/qemublocktestdata/imagecreate/raw.json create mode 100644 tests/qemublocktestdata/imagecreate/raw.xml create mode 100644 tests/qemublocktestdata/xml2json/block-raw-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/block-raw-reservations-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/dir-fat-cache-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/dir-fat-floppy-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/dir-fat-readonly-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-aio_threads-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-none-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-detect-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-unmap-detect-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-unmap-ignore-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-unmap-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-bochs-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-cloop-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-dmg-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-ploop-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-raw-aio_native-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-raw-luks-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-raw-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-vdi-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-vhd-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-vpc-noopts-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/network-nbd-tls-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth-srconly.json -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list