Currently the format-specific compression option is ignored during creation of the restored qcow image (wihch is not that bad, because nowadays its zlib by default, anyway:
format-specific": {
"type": "qcow2",
"data": {
"compat": "1.1",
"compression-type": "zlib"
parse compression type and append it to qemu--img create command if set.
In addition the nbd server needs probably set options for compression, like:
qemu-nbd .. driver=compress,file.driver=qcow2,file.file.driver=file,file.file.filename=test.qcow2
otherwise restored blocks in the image end up uncompressed.