All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Programmingkid <programmingkidx@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] qmp_device_add() ret_data argument
Date: Wed, 9 Sep 2015 21:36:58 -0600	[thread overview]
Message-ID: <55F0FADA.4010400@redhat.com> (raw)
In-Reply-To: <0FB3A50B-7B60-4AB8-8BE0-DA40AC91692E@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1358 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-09-10  3:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10  3:08 [Qemu-devel] qmp_device_add() ret_data argument Programmingkid
2015-09-10  3:36 ` Eric Blake [this message]
2015-09-10  9:01 ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55F0FADA.4010400@redhat.com \
    --to=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.