From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZboYD-0005F3-Vg for qemu-devel@nongnu.org; Tue, 15 Sep 2015 07:37:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZboYC-00081r-Nv for qemu-devel@nongnu.org; Tue, 15 Sep 2015 07:37:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZboYC-00081m-J8 for qemu-devel@nongnu.org; Tue, 15 Sep 2015 07:37:28 -0400 Date: Tue, 15 Sep 2015 12:37:22 +0100 From: "Daniel P. Berrange" Message-ID: <20150915113722.GO23145@redhat.com> References: <1442253477-15422-1-git-send-email-armbru@redhat.com> <1442253477-15422-21-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1442253477-15422-21-git-send-email-armbru@redhat.com> Subject: Re: [Qemu-devel] [PATCH v7 20/26] qapi: Make output visitor return qnull() instead of NULL Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Mon, Sep 14, 2015 at 07:57:51PM +0200, Markus Armbruster wrote: > Before commit 1d10b44, it crashed. Since then, it returns NULL, with > a FIXME comment. The FIXME is valid: code that assumes QObject * > can't be null exists. I'm not aware of a way to feed this problematic > return value to code that actually chokes on null in the current code, > but the next few commits will create one, failing "make check". > > Commit 481b002 solved a very similar problem by introducing a special > null QObject. Using this special null QObject is clearly the right > way to resolve this FIXME, so do that, and update the test > accordingly. > > However, the patch isn't quite right: it messes up the reference > counting. After about SIZE_MAX visits, the reference counter > overflows, failing the assertion in qnull_destroy_obj(). Because > that's many orders of magnitude more visits of nulls than we expect, > we take this patch despite its flaws, to get the QMP introspection > stuff in without further delay. > > Naturally, we'll have to fix it for real before the release. Do we actually ever get near to SIZE_MAX visits ? If not, then it would not seem critical to fix before release, as this is just the generator code > > Signed-off-by: Markus Armbruster > --- > qapi/qmp-output-visitor.c | 8 ++++++-- > tests/test-qmp-output-visitor.c | 3 ++- > 2 files changed, 8 insertions(+), 3 deletions(-) Reviewed-by: Daniel P. Berrange Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|