From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSSxM-0005aX-Kl for qemu-devel@nongnu.org; Fri, 12 Sep 2014 11:40:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSSxG-0003j5-Hn for qemu-devel@nongnu.org; Fri, 12 Sep 2014 11:40:16 -0400 Message-ID: <541313C5.40103@redhat.com> Date: Fri, 12 Sep 2014 17:39:49 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1410477659-9163-1-git-send-email-mdroth@linux.vnet.ibm.com> <1410477659-9163-2-git-send-email-mdroth@linux.vnet.ibm.com> <5412C828.2070004@redhat.com> <20140912153447.19243.81596@loki> In-Reply-To: <20140912153447.19243.81596@loki> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] qapi: add visit_start_union and visit_end_union List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth , qemu-devel@nongnu.org Cc: lcapitulino@redhat.com, famz@redhat.com, qemu-stable@nongnu.org, armbru@redhat.com Il 12/09/2014 17:34, Michael Roth ha scritto: > > { 'union': 'UserDefUnion', > 'base': 'UserDefZero', > 'data': { 'a' : 'int', 'b' : 'UserDefB' } } > > If UserDefUnion.a is 0, UserDefUnion.data will cast it to a NULL value and > cause the output visitor to bail, when really it should just be left to > continue on serializing the integer. In the case of dealloc, that'd be okay because the dealloc visit would do nothing for KIND_A, right? Paolo