qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] QOM vs QAPI for QMP APIs
@ 2014-02-21  9:16 Stefan Hajnoczi
  2014-02-21 14:29 ` Anthony Liguori
  2014-02-21 14:32 ` Stefan Hajnoczi
  0 siblings, 2 replies; 15+ messages in thread
From: Stefan Hajnoczi @ 2014-02-21  9:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael Roth, Luiz Capitulino, Anthony Liguori, Paolo Bonzini,
	Andreas Faerber

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

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-02-25 13:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-21  9:16 [Qemu-devel] QOM vs QAPI for QMP APIs Stefan Hajnoczi
2014-02-21 14:29 ` Anthony Liguori
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

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).