Hi On Fri, Jul 22, 2016 at 12:44 AM, Eric Blake <ebl...@redhat.com> wrote: > On 07/21/2016 08:00 AM, marcandre.lur...@redhat.com wrote: >> From: Marc-André Lureau <marcandre.lur...@redhat.com> >> >> 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 <marcandre.lur...@redhat.com> >> --- >> qapi-schema.json | 29 +++++++++++++++++++++++++++++ >> 1 file changed, 29 insertions(+) > > >> +++ 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 >> +# >> +# 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" } } > > Is it worth an example that includes 'bus' and/or 'props'?
done > >> +# <- { "return": {} } >> +# >> +# Since: 0.13 >> +## >> +{ 'command': 'device_add', >> + 'data': {'driver': 'str', 'id': 'str'}, 'gen': false } > > The documentation mentions fields not listed here, but the 'gen':false > explains why. We may yet get device_add QAPIfied for 2.8, but there's > nothing wrong with documenting things now. > > Reviewed-by: Eric Blake <ebl...@redhat.com> > > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > -- Marc-André Lureau