Examples:
* Single protocol:
-blockdev id=blk1,format=raw,protocol=[file,file=fedora.img]
Requires suitable syntactic sugar to get the simple form (*).
* blkdebug
-blockdev id=blk2,format=qcow2,\
protocol=[blkdebug,config=test.blkdebug,\
protocol=[file,file=test.qcow2]]
* Avi's mirror:
-blockdev id=blk3,format=raw,\
protocol=[mirror,\
[file,file=local.img],\
[nbd,domain=unix,sockert=nbd-sock]]
2. We already have a syntax to specify trees, namely JSON, so use it
If -blockdev's argument starts with '{', it's a JSON object suitable
as argument of blockdev_add in QMP.
We still provide ordinary QemuOpts syntax for the cases that can be
expressed with it, i.e. single protocol.
I figure we'd want syntactic sugar for blkdebug, to permit its use
from the command line without having to resort to JSON.
3. Stack protocols through named references
The first protocol is "inlined" into -blockdev. Any further
protocols need to be referenced by name.
Best explained by example:
* Single protocol:
-blockdev id=blk1,format=raw,protocol=file,file=fedora.img
To get the simple form (*), make protocol optional with a suitable
default.
* blkdebug
-blockdev id=blk2,format=qcow2,protocol=blkdebug,config=test.blkdebug,\
base=blk2-base
-blockproto id=blk2-base,protocol=file,file=test.qcow2
* Avi's mirror:
-blockdev id=blk3,format=raw,protocol=mirror,\
base=blk3-base1,base=blk3=base2
-blockproto id=blk3-base1,protocol=file,file=local.img
-blockproto id=blk3-base2,protocol=nbd,domain=unix,sockert=nbd-sock
Anything but a single protocol becomes pretty verbose. Syntactic
sugar for the blkdebug case would be possible; not sure it's worth
it.
No QemuOpts syntax changes. INI can handle this just fine.