From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX88H-0003Fy-HB for qemu-devel@nongnu.org; Tue, 09 Aug 2016 10:35:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX88D-0006ti-BG for qemu-devel@nongnu.org; Tue, 09 Aug 2016 10:35:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX88D-0006tc-5P for qemu-devel@nongnu.org; Tue, 09 Aug 2016 10:35:49 -0400 From: Markus Armbruster References: <20160808141439.16908-1-marcandre.lureau@redhat.com> <20160808141439.16908-6-marcandre.lureau@redhat.com> <87lh06iczk.fsf@dusky.pond.sub.org> Date: Tue, 09 Aug 2016 16:35:42 +0200 In-Reply-To: (=?utf-8?Q?=22Marc-Andr=C3=A9?= Lureau"'s message of "Tue, 09 Aug 2016 08:38:14 +0000") Message-ID: <87bn12dn7l.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 05/15] qapi: add 'export-marshal' command key List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Cc: qemu-devel@nongnu.org Marc-Andr=C3=A9 Lureau writes: > Hi > > On Tue, Aug 9, 2016 at 12:07 PM Markus Armbruster wro= te: > >> marcandre.lureau@redhat.com writes: >> >> > From: Marc-Andr=C3=A9 Lureau >> > >> > When a command sets the 'export-marshal' key to true, the generated >> > marshaller will be exported, so it can be called from outside. >> > >> > Signed-off-by: Marc-Andr=C3=A9 Lureau >> >> Sure we need to make linkage configurable in the schema? Why can't we >> simply make all the marshallers extern? >> > > Why would you expose all marshallers if you don't have to? Also, they > shouldn't be called directly, but through qmp_dispatch() which does > preliminary checks. We have plenty of functions with external linkage that you're not supposed to call directly. It's nice to give things internal linkage. But I don't want to complicate the QAPI schema language just so we can give a few more functions internal linkage. Functions that have had external linkage forever, which has caused us no problems at all. > Alternatively, we could save the marshaller call: > > return qobject_from_jsonf("{'QMP': {'version': {'qemu': " > "{'micro': %d. 'minor': %d, 'major': %d}," > "'package': '%s'}, " > "'capabilities': []}}", > QEMU_VERSION_MICRO, QEMU_VERSION_MINOR, > QEMU_VERSION_MAJOR, QEMU_PKGVERSION); I'm afraid I'm not getting this part...