From d26c9a15738147a8dccc451c6f6d1ddc2305713d Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 23 Sep 2013 15:26:03 +0200 Subject: blockdev: 'blockdev-add' QMP command For examples see the changes to qmp-commands.hx. Signed-off-by: Kevin Wolf --- qmp-commands.hx | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'qmp-commands.hx') diff --git a/qmp-commands.hx b/qmp-commands.hx index b17c46e0b1..fba15cdc3b 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -3239,4 +3239,59 @@ Example: ] } +EQMP + + { + .name = "blockdev-add", + .args_type = "options:q", + .mhandler.cmd_new = qmp_marshal_input_blockdev_add, + }, + +SQMP +blockdev-add +------------ + +Add a block device. + +Arguments: + +- "options": block driver options + +Example (1): + +-> { "execute": "blockdev-add", + "arguments": { "options" : { "driver": "qcow2", + "file": { "driver": "file", + "filename": "test.qcow2" } } } } +<- { "return": {} } + +Example (2): + +-> { "execute": "blockdev-add", + "arguments": { + "options": { + "driver": "qcow2", + "id": "my_disk", + "discard": "unmap", + "cache": { + "direct": true, + "writeback": true + }, + "file": { + "driver": "file", + "filename": "/tmp/test.qcow2" + }, + "backing": { + "driver": "raw", + "file": { + "driver": "file", + "filename": "/dev/fdset/4" + } + } + } + } + } + +<- { "return": {} } + EQMP -- cgit v1.2.1