From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ1Ye-0004Kt-On for qemu-devel@nongnu.org; Tue, 02 Oct 2012 08:26:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJ1YY-0001tP-WE for qemu-devel@nongnu.org; Tue, 02 Oct 2012 08:26:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ1YY-0001t9-NE for qemu-devel@nongnu.org; Tue, 02 Oct 2012 08:26:34 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q92CQYF7006123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Oct 2012 08:26:34 -0400 Date: Tue, 2 Oct 2012 09:27:27 -0300 From: Luiz Capitulino Message-ID: <20121002092727.1a1cf31d@doriath.home> In-Reply-To: <506AD288.7010204@redhat.com> References: <1349103144-6827-1-git-send-email-pbonzini@redhat.com> <1349103144-6827-3-git-send-email-pbonzini@redhat.com> <506A2D98.4080300@redhat.com> <506AAD22.5040305@redhat.com> <506AD288.7010204@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/9] qapi: add socket address types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Paolo Bonzini , qemu-devel@nongnu.org On Tue, 02 Oct 2012 05:39:52 -0600 Eric Blake wrote: > On 10/02/2012 03:00 AM, Paolo Bonzini wrote: > > Il 02/10/2012 01:56, Eric Blake ha scritto: > >> On 10/01/2012 08:52 AM, Paolo Bonzini wrote: > >>> Signed-off-by: Paolo Bonzini > >>> --- > > >>> +# > >>> +# @port: port part of the address, or lowest port if @to is present > >>> +# > >>> +# @to: highest port to try > >>> +# > > >>> +{ 'type': 'IPSocketAddress', > >>> + 'data': { > >>> + 'host': 'str', > >>> + 'port': 'str', > >>> + '*to': 'uint16', > >> > >> I still think it's a bit weird to have: > >> > >> 'host':'localhost', 'port':'1000', 'to':1001 > >> > >> for a port range, all because of the possibility of named ports; should > >> '*to' be a 'str' if only for symmetry in the output? But it's > >> bike-shedding, so I'll live with whatever works (that is, I'm not > >> requesting a v3 on this patch). > > > > Would it be better if I changed 'to' to 'count'? > > That does look a little better: > > 'host':'localhost', 'port':'1000', 'count':2 > > for the 2-port range 1000-1001. But it's all the same information, so > I'm not strongly tied to any particular representation, as long as > libvirt can parse it when querying and produce it when starting NBD. Wouldn't it be cleaner to pass a list of port numbers? We could have: *port-list: [ 'int' ] *service: 'str' Or, we could make this an union.