]> git.ipfire.org Git - thirdparty/qemu.git/commit - qemu-options.hx
block: Initial implementation of -blockdev
authorMarkus Armbruster <armbru@redhat.com>
Tue, 28 Feb 2017 21:27:07 +0000 (22:27 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 7 Mar 2017 15:07:47 +0000 (16:07 +0100)
commit42e5f39378c6e7a0ada563779bbb6f470f7c03ff
treecf440827e1da3b3b687cb34b04c3d5b2ede6a7a2
parent9d1eab4b95819006afc0ee7b88eaa83be5007f39
block: Initial implementation of -blockdev

The new command line option -blockdev works like QMP command
blockdev-add.

The option argument may be given in JSON syntax, exactly as in QMP.
Example usage:

    -blockdev '{"node-name": "foo", "driver": "raw", "file": {"driver": "file", "filename": "foo.img"} }'

The JSON argument doesn't exactly blend into the existing option
syntax, so the traditional KEY=VALUE,... syntax is also supported,
using dotted keys to do the nesting:

    -blockdev node-name=foo,driver=raw,file.driver=file,file.filename=foo.img

This does not yet support lists, but that will be addressed shortly.

Note that calling qmp_blockdev_add() (say via qmp_marshal_block_add())
right away would crash.  We need to stash the configuration for later
instead.  This is crudely done, and bypasses QemuOpts, even though
storing configuration is what QemuOpts is for.  Need to revamp option
infrastructure to support QAPI types like BlockdevOptions.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <1488317230-26248-22-git-send-email-armbru@redhat.com>
qemu-options.hx
vl.c