From cff8b2c6fcdc9492d1141da11f55615843fa0a5e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Dec 2013 23:21:10 +0100 Subject: monitor: add object-add (QMP) and object_add (HMP) command Add two commands that are the monitor counterparts of -object. The commands have the same Visitor-based implementation, but use different kinds of visitors so that the HMP command has a DWIM string-based syntax, while the QMP variant accepts a stricter JSON-based properties dictionary. Signed-off-by: Paolo Bonzini Reviewed-by: Igor Mammedov Tested-by: Igor Mammedov Signed-off-by: Luiz Capitulino --- qmp-commands.hx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'qmp-commands.hx') diff --git a/qmp-commands.hx b/qmp-commands.hx index 71422cd99c..02cc815bc5 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -876,6 +876,32 @@ Example: <- { "return": {} } +EQMP + + { + .name = "object-add", + .args_type = "qom-type:s,id:s,props:q?", + .mhandler.cmd_new = qmp_object_add, + }, + +SQMP +object-add +---------- + +Create QOM object. + +Arguments: + +- "qom-type": the object's QOM type, i.e. the class name (json-string) +- "id": the object's ID, must be unique (json-string) +- "props": a dictionary of object property values (optional, json-dict) + +Example: + +-> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1", + "props": { "filename": "/dev/hwrng" } } } +<- { "return": {} } + EQMP { -- cgit v1.2.1