From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnMEN-0006if-8M for qemu-devel@nongnu.org; Wed, 29 Apr 2015 03:16:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnMEJ-0003ed-C7 for qemu-devel@nongnu.org; Wed, 29 Apr 2015 03:16:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnMEJ-0003eY-4k for qemu-devel@nongnu.org; Wed, 29 Apr 2015 03:16:23 -0400 From: Markus Armbruster References: <1427995743-7865-1-git-send-email-armbru@redhat.com> <1427995743-7865-18-git-send-email-armbru@redhat.com> <552C8D2B.20603@redhat.com> Date: Wed, 29 Apr 2015 09:15:37 +0200 In-Reply-To: <552C8D2B.20603@redhat.com> (Eric Blake's message of "Mon, 13 Apr 2015 21:44:43 -0600") Message-ID: <877fsve76u.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH RFC 17/19] qobject: Add a special null QObject List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, akong@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > On 04/02/2015 11:29 AM, Markus Armbruster wrote: >> I'm going to fix the JSON parser to recognize null. The obvious >> representation of JSON null as (QObject *)NULL doesn't work, because >> the parser already uses it as an error value. Perhaps we should >> change it to free NULL for null, but that's more than I can do right >> now. Create a special null QObject instead. >> >> Signed-off-by: Markus Armbruster >> --- >> include/qapi/qmp/qobject.h | 9 +++++++++ >> qobject/Makefile.objs | 2 +- >> qobject/qjson.c | 3 +++ >> qobject/qnull.c | 29 +++++++++++++++++++++++++++++ >> 4 files changed, 42 insertions(+), 1 deletion(-) >> create mode 100644 qobject/qnull.c >> > >> +static const QType qnull_type = { >> + .code = QTYPE_QINT, > > s/QINT/QNULL/ Oww. >> + .destroy = qnull_destroy_obj, >> +}; >> + >> +QObject qnull_ = { >> + .type = &qnull_type, >> + .refcnt = 1 >> +}; > > Worth a trailing comma in the initializer? Unlikely to require more initializers, but I don't mind. Conflicts with your "qapi: Accept 'null' in QMP". Current plan: you pick the best of both into a new series.