qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] qmp_device_add() ret_data argument


From: Eric Blake
Subject: Re: [Qemu-devel] qmp_device_add() ret_data argument
Date: Wed, 9 Sep 2015 21:36:58 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 09/09/2015 09:08 PM, Programmingkid wrote:
> What does the function qmp_device_add() have a ret_data argument if it isn't 
> used? This function is located in qdev-monitor.c.

[meta-comment - can you teach your mailer to wrap long lines? It's a
pain to reply to something that scrolls off the screen]

Because the function is installed as a command handler callback, and all
command handler callbacks must have the same signature (QDict *, QObject
**, Error **).

Most qapi-fied commands install a generated handler named
qmp_marshal_*() with the requisite signature, that then parses the QDict
* into a nicer breakdown of C parameters to the real handler, then
collect the returned struct back into the QObject for return.  So if you
want to know how to manipulate QDict/QObject directly, look at the
generated qmp-marshal.c for inspiration.

Meanwhile, device_add has not yet been fully qapi-fied.

I'm about to post a series that completes the qapi-fication of
netdev_add, which is somewhat similar to device_add; if you want to look
at that for ideas of what is involved, be my guest (netdev_add had an
incomplete qapi-fication in qapi-schema.json; device_add isn't even
listed there yet so it is even further behind).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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