On Wed, 29 Feb 2012 16:23:20 +0100 Paolo Bonzini <pbonz...@redhat.com> 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.