qmp: expose list of supported character device backends

Introduce 'query-chardev-backends' QMP command which lists all
supported character device backends.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Martin Kletzander
2014-02-01 12:52:42 +01:00
committed by Luiz Capitulino
parent 84d18f065f
commit 77d1c3c63f
3 changed files with 82 additions and 0 deletions

View File

@@ -1923,6 +1923,47 @@ EQMP
.mhandler.cmd_new = qmp_marshal_input_query_chardev,
},
SQMP
query-chardev-backends
-------------
List available character device backends.
Each backend is represented by a json-object, the returned value is a json-array
of all backends.
Each json-object contains:
- "name": backend name (json-string)
Example:
-> { "execute": "query-chardev-backends" }
<- {
"return":[
{
"name":"udp"
},
{
"name":"tcp"
},
{
"name":"unix"
},
{
"name":"spiceport"
}
]
}
EQMP
{
.name = "query-chardev-backends",
.args_type = "",
.mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
},
SQMP
query-block
-----------