qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
	Anthony Liguori <aliguori@amazon.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Andreas Faerber <afaerber@suse.de>
Subject: Re: [Qemu-devel] QOM vs QAPI for QMP APIs
Date: Fri, 21 Feb 2014 06:29:35 -0800	[thread overview]
Message-ID: <CA+aC4kubVf1sVCQQGRWEpP7+ZA33WSCB1TEjjC_XveKidNXCRw@mail.gmail.com> (raw)
In-Reply-To: <20140221091629.GE11907@stefanha-thinkpad.redhat.com>

On Fri, Feb 21, 2014 at 1:16 AM, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> I need to add a QMP API that lists dataplane threads.  This is similar
> to "query-cpus" where the thread IDs are reported.  It allows the client
> to bind threads to host CPUs.
>
> I'm inclined to add a "query-iothreads" QMP command:
>  * It's easy to implement using QAPI
>  * We've developed best practices for QMP APIs
>  * We know how to version and make QMP APIs extensible
>  * Clients (including libvirt) are used to QMP JSON RPC
>
> But maybe I should use QOM instead:
>  * Add a "qom-find-objects-by-class" QMP command (Paolo's idea)
>  * Client does "qom-find-objects-by-class IOThread /objects"
>  * Client then uses "qom-get" to fetch the thread_id property on each
>    IOThread object
>  * But we haven't really established how QOM APIs will work

I have no objection to introducing a QMP command.

I think qom-find-objects-by-class is a reasonable approach but I would
also consider just grouping all of the IOThreads in a well known path
instead of just having them live in /objects.  So something like
/objects/threads/thread0/pid.

It ends up being very similar to working with sysfs at that point.

Regards,

Anthony Liguori

> So my question is: should we use QOM as the external API or continue
> using QAPI?
>
> I don't think we gain much by switching to QOM other than opening a
> whole new design space that we've yet to master.  We'll make plenty of
> mistakes just like we did with QMP and QAPI.
>
> Although QOM eliminates the need to implement dedicated QMP commands, it
> exposes a more complex model to the client.  Instead of a JSON
> command/response model we now expose a general object-oriented namespace
> with properties, links, etc.  The client has to make sense of all that
> and has to perform multiple qom-list/qom-get/etc commands for something
> that would take a single dedicated QMP command.
>
> Maybe I just need some convincing but it seems that QAPI is the simplest
> and cleanest way to define external APIs.
>
> Disagree?  Tell me why :).
>
> Stefan
>

  reply	other threads:[~2014-02-21 14:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21  9:16 [Qemu-devel] QOM vs QAPI for QMP APIs Stefan Hajnoczi
2014-02-21 14:29 ` Anthony Liguori [this message]
2014-02-21 14:37   ` Paolo Bonzini
2014-02-21 21:00     ` Eric Blake
2014-02-24  8:29       ` Markus Armbruster
2014-02-24 16:08         ` Eric Blake
2014-02-25  8:25           ` Markus Armbruster
2014-02-25  8:30             ` Andreas Färber
2014-02-25  8:30             ` Paolo Bonzini
2014-02-25  8:33               ` Andreas Färber
2014-02-21 14:32 ` Stefan Hajnoczi
2014-02-25  9:46   ` Kevin Wolf
2014-02-25 10:15     ` Stefan Hajnoczi
2014-02-25 10:47       ` Paolo Bonzini
2014-02-25 13:39         ` Kevin Wolf

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=CA+aC4kubVf1sVCQQGRWEpP7+ZA33WSCB1TEjjC_XveKidNXCRw@mail.gmail.com \
    --to=anthony@codemonkey.ws \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).