[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 03/16] sockets: allow port to be NULL when li
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 03/16] sockets: allow port to be NULL when listening on IP address |
Date: |
Thu, 22 Oct 2015 11:02:03 +0100 |
On 22 October 2015 at 10:43, Daniel P. Berrange <address@hidden> 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
[Qemu-devel] [PATCH v2 04/16] ui: convert VNC startup code to use SocketAddress, Daniel P. Berrange, 2015/10/12