From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpChY-000699-FI for qemu-devel@nongnu.org; Thu, 22 Oct 2015 06:02:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpChT-0002QT-Ft for qemu-devel@nongnu.org; Thu, 22 Oct 2015 06:02:28 -0400 Received: from mail-vk0-f47.google.com ([209.85.213.47]:33006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpChT-0002QK-C4 for qemu-devel@nongnu.org; Thu, 22 Oct 2015 06:02:23 -0400 Received: by vkgy127 with SMTP id y127so43979211vkg.0 for ; Thu, 22 Oct 2015 03:02:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20151022094330.GD9079@redhat.com> References: <1444648509-29179-1-git-send-email-berrange@redhat.com> <1444648509-29179-4-git-send-email-berrange@redhat.com> <1445449978.7681.367.camel@ifi.uio.no> <20151022094330.GD9079@redhat.com> From: Peter Maydell Date: Thu, 22 Oct 2015 11:02:03 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2 03/16] sockets: allow port to be NULL when listening on IP address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Paolo Bonzini , Knut Omang , "Dr. David Alan Gilbert" , QEMU Developers On 22 October 2015 at 10:43, Daniel P. Berrange wrote: > For reasons I don't understand, it appears that even string > fields which are marked as optional get a 'has_XXX' flag, > to distinguish betweeen a NULL string and an unset string. > I struggle to imagine why we need this. It makes sense for > integer/boolean types, but I would have thought just checking > for NULL was sufficient for string types. I think the argument here is pure consistency. *Every* optional field should be implemented as has_fieldname (bool) plus fieldname (actual value). Special casing string types because we happen to have a special value we can use to indicate 'no string' seems to me like it would cause more confusion than it would be worth. thanks -- PMM