From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrvNW-0008WS-ER for qemu-devel@nongnu.org; Thu, 29 Oct 2015 18:09:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrvNR-0007x4-Do for qemu-devel@nongnu.org; Thu, 29 Oct 2015 18:09:02 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:39232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrvNQ-0007vA-PP for qemu-devel@nongnu.org; Thu, 29 Oct 2015 18:08:57 -0400 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Oct 2015 08:08:53 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 55E372BB0051 for ; Fri, 30 Oct 2015 09:08:50 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9TM8hUA21299384 for ; Fri, 30 Oct 2015 09:08:51 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9TM8HNt000683 for ; Fri, 30 Oct 2015 09:08:17 +1100 Date: Fri, 30 Oct 2015 09:07:31 +1100 From: Sam Bobroff Message-ID: <20151029220731.GA1907@tungsten.ozlabs.ibm.com> References: <871tce8a2h.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871tce8a2h.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH 1/1] monitor: correct socket listen port List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org On Thu, Oct 29, 2015 at 07:26:14AM +0100, Markus Armbruster wrote: > Sam Bobroff writes: > > > Currently when constructing an inet socket monitor (e.g. via "-monitor > > telent:localhost:12345,server,nowait") the port is ignored and a > > random one is used instead. It appears this behaviour was accidentally > > introduced by commit dafd325d "qemu-char: Convert socket backend to > > QAPI". > > > > The cause is that the has_port field is not set in the address, so > > later it is not copied by qapi_copy_SocketAddress(). This patch simply > > adds the missing "has_port = true". > > > > Signed-off-by: Sam Bobroff > > --- > > > > qemu-char.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/qemu-char.c b/qemu-char.c > > index c4eb4ee..4fb9279 100644 > > --- a/qemu-char.c > > +++ b/qemu-char.c > > @@ -3605,6 +3605,7 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, > > addr->kind = SOCKET_ADDRESS_KIND_INET; > > addr->inet = g_new0(InetSocketAddress, 1); > > addr->inet->host = g_strdup(host); > > + addr->inet->has_port = true; > > addr->inet->port = g_strdup(port); > > addr->inet->has_to = qemu_opt_get(opts, "to"); > > addr->inet->to = qemu_opt_get_number(opts, "to", 0); > > Please see "[PATCH] qapi-schema: mark InetSocketAddress as mandatory > again" > Message-Id: <1445509543-30679-1-git-send-email-berrange@redhat.com> > http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg05222.html Ah thanks, that's obviously the correct fix too. (Guess I'm one of the ones who got bitten ;-) Cheers, Sam.