From patchwork Wed Oct 28 22:15:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Bobroff X-Patchwork-Id: 537583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 61DA8140B0F for ; Thu, 29 Oct 2015 09:16:59 +1100 (AEDT) Received: from localhost ([::1]:40916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrZ1d-0003Rw-4J for incoming@patchwork.ozlabs.org; Wed, 28 Oct 2015 18:16:57 -0400 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 d23dlp02.au.ibm.com (202.81.31.213) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 29 Oct 2015 08:16:27 +1000 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: sam.bobroff@au1.ibm.com X-IBM-RcptTo: qemu-devel@nongnu.org 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 To: qemu-devel@nongnu.org Date: Thu, 29 Oct 2015 09:15:08 +1100 Message-Id: X-Mailer: git-send-email 2.1.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15102822-0009-0000-0000-0000024AD08E X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 202.81.31.145 Subject: [Qemu-devel] [PATCH 1/1] monitor: correct socket listen port X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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);