qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 02/12] qapi-schema: add 'device_add'


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2 02/12] qapi-schema: add 'device_add'
Date: Fri, 05 Aug 2016 14:10:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

address@hidden writes:

> From: Marc-André Lureau <address@hidden>
>
> Even though device_add is not fully qapi'fied, we may add it to the json
> schema with 'gen': false, so registration and documentation can be
> generated.
>
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  qapi-schema.json | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 03c15d8..e950264 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -2200,6 +2200,35 @@
>  ##
>  { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
>  
> +##
> +# @device_add:
> +#
> +# @driver: the name of the new device's driver
> +# @bus: #optional the device's parent bus (device tree path)
> +# @id: the device's ID, must be unique
> +# @props: #optional a dictionary of properties to be passed to the backend

I'm afraid @props is wrong.  The properties are passed inline, like
this:

    { "execute": "device_add",
      "arguments": { "driver": "e1000", "id": "nic1", "netdev": "netdev1" } }

*not* in a separate @props object.  See also commit b8a9832
"qapi-schema: Fix up misleading specification of netdev_add".

> +#
> +# Add a device.
> +#
> +# Notes:
> +# 1. For detailed information about this command, please refer to the
> +#    'docs/qdev-device-use.txt' file.
> +#
> +# 2. It's possible to list device properties by running QEMU with the
> +#    "-device DEVICE,help" command-line argument, where DEVICE is the
> +#    device's name
> +#
> +# Example:
> +#
> +# -> { "execute": "device_add",
> +#      "arguments": { "driver": "e1000", "id": "net1" } }

Please include at least one property in the example.

> +# <- { "return": {} }
> +#
> +# Since: 0.13
> +##
> +{ 'command': 'device_add',
> +  'data': {'driver': 'str', 'id': 'str'}, 'gen': false }
> +
>  ##
>  # @device_del:
>  #

I like the general idea to do the non-qapi device_add like the simplarly
non-qapi netdev_add.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]