On Fri, Feb 21, 2014 at 10:16 AM, Stefan Hajnoczi <stefa...@redhat.com> wrote: > 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 :).
I'm replying to myself because we had an interesting discussion on IRC. Thanks Paolo, Markus, and Peter! I'm biased, but here are the points collected from the discussion: Why QOM *should* be QEMU's external API: * QOM eliminates hand-written QMP API code. We get query-foo APIs for free using qom-list, qom-get, qom-set, and friends Why QOM should *not* be QEMU's external API: * Internal objects will diverge from the external QOM objects over time, we'll have to maintain a backwards compatible QOM object layer on top of QEMU's internal objects - that defeats the whole point of getting APIs for free from QOM * We lose the easy-to-review qapi-schema.json. Would need new documentation and review tools for QOM model changes. * query-foo APIs are simple to implement, not a huge win to get them via QOM * QAPI is mature and well-understood, QMP is incomplete * qom-list, qom-get, qom-set are too low-level, need more powerful APIs to save clients from elaborate back-and-forth conversations Stefan