diff options
author | Markus Armbruster <armbru@redhat.com> | 2017-02-28 22:27:07 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-03-07 16:07:47 +0100 |
commit | 42e5f39378c6e7a0ada563779bbb6f470f7c03ff (patch) | |
tree | cf440827e1da3b3b687cb34b04c3d5b2ede6a7a2 /qemu-options.hx | |
parent | 9d1eab4b95819006afc0ee7b88eaa83be5007f39 (diff) | |
download | qemu-42e5f39378c6e7a0ada563779bbb6f470f7c03ff.zip qemu-42e5f39378c6e7a0ada563779bbb6f470f7c03ff.tar.gz qemu-42e5f39378c6e7a0ada563779bbb6f470f7c03ff.tar.bz2 |
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>
Diffstat (limited to 'qemu-options.hx')
-rw-r--r-- | qemu-options.hx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qemu-options.hx b/qemu-options.hx index 2292438..8dd8ee3 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -550,6 +550,13 @@ Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and using @file{/dev/cdrom} as filename (@pxref{host_drives}). ETEXI +DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev, + "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n" + " [,cache.direct=on|off][,cache.no-flush=on|off]\n" + " [,read-only=on|off][,detect-zeroes=on|off|unmap]\n" + " [,driver specific parameters...]\n" + " configure a block backend\n", QEMU_ARCH_ALL) + DEF("drive", HAS_ARG, QEMU_OPTION_drive, "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" " [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n" |