From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrZ1L-0003AW-Dx for qemu-devel@nongnu.org; Wed, 28 Oct 2015 18:16:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrZ1H-0000yf-UF for qemu-devel@nongnu.org; Wed, 28 Oct 2015 18:16:39 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:58968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrZ1H-0000th-9y for qemu-devel@nongnu.org; Wed, 28 Oct 2015 18:16:35 -0400 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 29 Oct 2015 08:16:30 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id AA5802BB0051 for ; Thu, 29 Oct 2015 09:16:26 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9SMGHY954001818 for ; Thu, 29 Oct 2015 09:16:26 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9SMFrrl004451 for ; Thu, 29 Oct 2015 09:15:53 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t9SMFrSS003983 for ; Thu, 29 Oct 2015 09:15:53 +1100 Received: from tungsten.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 2D076A01A7 for ; Thu, 29 Oct 2015 09:15:29 +1100 (AEDT) From: Sam Bobroff Date: Thu, 29 Oct 2015 09:15:08 +1100 Message-Id: Subject: [Qemu-devel] [PATCH 1/1] monitor: correct socket listen port List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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); -- 2.1.4