aboutsummaryrefslogtreecommitdiff
path: root/qmp-commands.hx
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-10-26 21:39:11 +0100
committerKevin Wolf <kwolf@redhat.com>2015-11-11 16:22:47 +0100
commitd129988289a885e57aa8790097e2d814764571bd (patch)
treec58bb2baf3d9322b56f0ae006bae083fd5c7a7f5 /qmp-commands.hx
parent2814f67271bce537f29c6a7832f89fd4f1cdaa1a (diff)
blockdev: Add blockdev-insert-medium
And a helper function for that, which directly takes a pointer to the BDS to be inserted instead of its node-name (which will be used for implementing 'change' using blockdev-insert-medium). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qmp-commands.hx')
-rw-r--r--qmp-commands.hx37
1 files changed, 37 insertions, 0 deletions
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 282596265a..203ce6ac34 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -4083,6 +4083,43 @@ Example:
EQMP
{
+ .name = "blockdev-insert-medium",
+ .args_type = "device:s,node-name:s",
+ .mhandler.cmd_new = qmp_marshal_blockdev_insert_medium,
+ },
+
+SQMP
+blockdev-insert-medium
+----------------------
+
+Inserts a medium (a block driver state tree) into a block device. That block
+device's tray must currently be open (unless there is no attached guest device)
+and there must be no medium inserted already.
+
+Arguments:
+
+- "device": block device name (json-string)
+- "node-name": root node of the BDS tree to insert into the block device
+
+Example:
+
+-> { "execute": "blockdev-add",
+ "arguments": { "options": { "node-name": "node0",
+ "driver": "raw",
+ "file": { "driver": "file",
+ "filename": "fedora.iso" } } } }
+
+<- { "return": {} }
+
+-> { "execute": "blockdev-insert-medium",
+ "arguments": { "device": "ide1-cd0",
+ "node-name": "node0" } }
+
+<- { "return": {} }
+
+EQMP
+
+ {
.name = "query-named-block-nodes",
.args_type = "",
.mhandler.cmd_new = qmp_marshal_query_named_block_nodes,