aboutsummaryrefslogtreecommitdiff
path: root/qmp-commands.hx
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-10-26 21:39:10 +0100
committerKevin Wolf <kwolf@redhat.com>2015-11-11 16:22:47 +0100
commit2814f67271bce537f29c6a7832f89fd4f1cdaa1a (patch)
treed94904f6f9dbe9f8a4a3f6941cb076977f6b35ab /qmp-commands.hx
parentabaaf59d245b6984644497b6745f88912c715c39 (diff)
blockdev: Add blockdev-remove-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.hx45
1 files changed, 45 insertions, 0 deletions
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 0e896c8e45..282596265a 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -4038,6 +4038,51 @@ Example:
EQMP
{
+ .name = "blockdev-remove-medium",
+ .args_type = "device:s",
+ .mhandler.cmd_new = qmp_marshal_blockdev_remove_medium,
+ },
+
+SQMP
+blockdev-remove-medium
+----------------------
+
+Removes a medium (a block driver state tree) from a block device. That block
+device's tray must currently be open (unless there is no attached guest device).
+
+If the tray is open and there is no medium inserted, this will be a no-op.
+
+Arguments:
+
+- "device": block device name (json-string)
+
+Example:
+
+-> { "execute": "blockdev-remove-medium",
+ "arguments": { "device": "ide1-cd0" } }
+
+<- { "error": { "class": "GenericError",
+ "desc": "Tray of device 'ide1-cd0' is not open" } }
+
+-> { "execute": "blockdev-open-tray",
+ "arguments": { "device": "ide1-cd0" } }
+
+<- { "timestamp": { "seconds": 1418751627,
+ "microseconds": 549958 },
+ "event": "DEVICE_TRAY_MOVED",
+ "data": { "device": "ide1-cd0",
+ "tray-open": true } }
+
+<- { "return": {} }
+
+-> { "execute": "blockdev-remove-medium",
+ "arguments": { "device": "ide1-cd0" } }
+
+<- { "return": {} }
+
+EQMP
+
+ {
.name = "query-named-block-nodes",
.args_type = "",
.mhandler.cmd_new = qmp_marshal_query_named_block_nodes,