From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP87H-0007i5-2P for qemu-devel@nongnu.org; Fri, 19 Oct 2012 04:39:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TP878-0003j4-S8 for qemu-devel@nongnu.org; Fri, 19 Oct 2012 04:39:38 -0400 Received: from mx4-phx2.redhat.com ([209.132.183.25]:55661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP878-0003ix-HH for qemu-devel@nongnu.org; Fri, 19 Oct 2012 04:39:30 -0400 Date: Fri, 19 Oct 2012 04:39:29 -0400 (EDT) From: Paolo Bonzini Message-ID: <499452354.13350285.1350635969770.JavaMail.root@redhat.com> In-Reply-To: <878vb2lw6d.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 20/25] qapi: add socket address types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com > >> Two port members, one is 'str', the other is 'uint16'. Ugly. > > > > This is because port can be a service name. Using a union was > > deemed > > overkill. > > Two ways to reduce the ugliness: > > 1. Make @to a string, too. Yes, users don't normally want to specify > the upper bound as service name, but if a user wanted to, it would > work just fine. > > 2. Use a number of ports instead of an upper port bound: replace @to > by @port+@nports. Both considered, but they make it an absolute pain to deal with the current QemuOpts code that expects a @to and expects it to be an integer. > >>> + '*ipv4': 'bool', > >>> + '*ipv6': 'bool' } } > >>> + > >>> +## > >>> +# @UnixSocketAddress > >>> +# > >>> +# Captures the destination address of a Unix socket > >> > >> What's a "destination address of a Unix socket"? > > "Socket address in the local namespace" Ok. > >>> + 'unix': 'UnixSocketAddress', > >>> + 'fd': 'String' } } > > 'String'? Do you mean 'str'? 'String' is a boxed 'str'. It gives more freedom to extend the API later in a backwards-compatible way. Paolo