block: Accept device model name for x-blockdev-remove-medium

In order to remove the need for BlockBackend names in the external API,
we want to allow qdev device names in all device related commands.

This converts x-blockdev-remove-medium to accept a qdev device name.

As the command is experimental, we can still remove the 'device' option
that uses the BlockBackend name. This requires some test case changes
and is left for another series.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2016-09-20 13:38:45 +02:00
parent 716df21707
commit 00949babe9
3 changed files with 28 additions and 19 deletions

View file

@ -3290,18 +3290,20 @@ Stay away from it unless you want to help with its development.
Arguments:
- "device": block device name (json-string)
- "device": block device name (deprecated, use @id instead)
(json-string, optional)
- "id": the name or QOM path of the guest device (json-string, optional)
Example:
-> { "execute": "x-blockdev-remove-medium",
"arguments": { "device": "ide1-cd0" } }
"arguments": { "id": "ide0-1-0" } }
<- { "error": { "class": "GenericError",
"desc": "Tray of device 'ide1-cd0' is not open" } }
"desc": "Tray of device 'ide0-1-0' is not open" } }
-> { "execute": "blockdev-open-tray",
"arguments": { "device": "ide1-cd0" } }
"arguments": { "id": "ide0-1-0" } }
<- { "timestamp": { "seconds": 1418751627,
"microseconds": 549958 },
@ -3312,7 +3314,7 @@ Example:
<- { "return": {} }
-> { "execute": "x-blockdev-remove-medium",
"arguments": { "device": "ide1-cd0" } }
"arguments": { "device": "ide0-1-0" } }
<- { "return": {} }