From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 26 Apr 2021 12:09:35 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1layBL-00032U-Va for lore@lore.pengutronix.de; Mon, 26 Apr 2021 12:09:35 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1layBL-0000Yl-BP; Mon, 26 Apr 2021 12:09:35 +0200 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1layBJ-0000YZ-V4; Mon, 26 Apr 2021 12:09:33 +0200 Received: from rsc by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1layBJ-0006WZ-Kj; Mon, 26 Apr 2021 12:09:33 +0200 Date: Mon, 26 Apr 2021 12:09:33 +0200 From: Robert Schwebel To: Roland Hieber Message-ID: <20210426100933.vt5jtg6sqpioxth5@pengutronix.de> References: <20210426060526.32029-5-rhi@pengutronix.de> <20210426100714.10944-1-rhi@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210426100714.10944-1-rhi@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 12:09:18 up 145 days, 15 min, 48 users, load average: 0,11, 0,09, 0,06 User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [DistroKit] [PATCH v3] v7a: run: make the SSH forwarding port multiprocess-compatible X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: distrokit@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On Mon, Apr 26, 2021 at 12:07:15PM +0200, Roland Hieber wrote: > When multiple ./configs/platform-v7a/run scripts are run at the same > time, the first qemu process will open port 4445, and following runs > will fail. To prevent that, first look at the environment variable > QEMU_SSH_PORT to determine the port to be used (so that users can set > this in their shell to keep the port constant), or fall back to a port > between 1025 and 65025 based on the shell's PID, which should have a > good chance of choosing an unused, but stable port. > > Also print the port forwarding before starting qemu, so we don't have to > bother about grepping the process list. > > Signed-off-by: Roland Hieber > > --- > v3: > * rebase onto next > * adapt subject and log message (Robert Schwebel) > v2: > * use PPID instead of RANDOM to make the port reproducible in the same > shell session (Michael Olbrich) > --- > configs/platform-v7a/run | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied to next. rsc -- Pengutronix e.K. | Dipl.-Ing. Robert Schwebel | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | _______________________________________________ DistroKit mailing list DistroKit@pengutronix.de