From 5f07c4d60d091320186e7b0edaf9ed2cc16b2d1e Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 24 Feb 2020 15:29:55 +0100 Subject: qapi: Flatten object-add Mapping object-add to the command line as is doesn't result in nice syntax because of the nesting introduced with 'props'. This becomes nicer and more consistent with device_add and netdev_add when we accept properties for the object on the top level instead. 'props' is still accepted after this patch, but marked as deprecated. Signed-off-by: Kevin Wolf Message-Id: <20200224143008.13362-8-kwolf@redhat.com> Acked-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qapi/qom.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'qapi/qom.json') diff --git a/qapi/qom.json b/qapi/qom.json index ecc60c4401..8abe998962 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -210,7 +210,12 @@ # # @id: the name of the new object # -# @props: a dictionary of properties to be passed to the backend +# @props: a dictionary of properties to be passed to the backend. Deprecated +# since 5.0, specify the properties on the top level instead. It is an +# error to specify the same option both on the top level and in @props. +# +# Additional arguments depend on qom-type and are passed to the backend +# unchanged. # # Returns: Nothing on success # Error if @qom-type is not a valid class name @@ -221,12 +226,13 @@ # # -> { "execute": "object-add", # "arguments": { "qom-type": "rng-random", "id": "rng1", -# "props": { "filename": "/dev/hwrng" } } } +# "filename": "/dev/hwrng" } } # <- { "return": {} } # ## { 'command': 'object-add', - 'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} } + 'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'}, + 'gen': false } # so we can get the additional arguments ## # @object-del: -- cgit v1.2.3