From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S365v-0007Kg-Kz for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:31:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S365Y-0001Z3-Co for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:30:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S365Y-0001Yy-3y for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:30:32 -0500 Date: Thu, 1 Mar 2012 10:30:15 -0300 From: Luiz Capitulino Message-ID: <20120301103015.32ac019d@doriath.home> In-Reply-To: <4F4E42E8.8060003@redhat.com> References: <1330522650-15357-1-git-send-email-pbonzini@redhat.com> <1330522650-15357-4-git-send-email-pbonzini@redhat.com> <4F4E3559.3010801@redhat.com> <20120229120842.6866b559@doriath.home> <4F4E42E8.8060003@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Stefan Hajnoczi , Jeff Cody , qemu-devel , Federico Simoncelli , Eric Blake On Wed, 29 Feb 2012 16:23:20 +0100 Paolo Bonzini wrote: > Il 29/02/2012 16:08, Luiz Capitulino ha scritto: > >> > > >> > but it can just be omitted, I wasn't sure of how QAPI handled optionals. > > Do you now? > > Perhaps not. :) > > > All optionals will be accompanied of a 'bool has_OPTIONAL_NAME', this bool > > will be true if the optional has been passed by the caller/client or false > > otherwise (in which case you shouldn't trust it). > > My understanding was that in this case I can trust the value to be > all-zeros (zero, false, 0.0, NULL), at least in the context of QAPI. > The QmpInputVisitor uses g_malloc0. Yes, as a side effect :) I mean, I don't think the reason for using g_malloc0() was to have optionals zeroed. If we're going to count on this, then it's better to make it explicit and/or document it.