From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9DSM-0007PT-VE for qemu-devel@nongnu.org; Wed, 27 May 2009 03:21:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9DSI-0007NO-DT for qemu-devel@nongnu.org; Wed, 27 May 2009 03:21:46 -0400 Received: from [199.232.76.173] (port=43856 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9DSI-0007NL-5f for qemu-devel@nongnu.org; Wed, 27 May 2009 03:21:42 -0400 Received: from mx20.gnu.org ([199.232.41.8]:25957) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M9DSH-0002Vc-Lu for qemu-devel@nongnu.org; Wed, 27 May 2009 03:21:41 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M9DSG-0005KB-OS for qemu-devel@nongnu.org; Wed, 27 May 2009 03:21:41 -0400 Message-ID: <4A1CE9FC.7000601@web.de> Date: Wed, 27 May 2009 09:21:32 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1243335807-9495-1-git-send-email-agraf@suse.de> <4A1CE497.4070507@web.de> In-Reply-To: <4A1CE497.4070507@web.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1D2B38DCDB182B15D418DDDC" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH] User Networking: Enable removal of redirections List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1D2B38DCDB182B15D418DDDC Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Jan Kiszka wrote: > Alexander Graf wrote: >> Using the new host_net_redir command you can easily create redirection= s >> on the fly while your VM is running. >> >> While that's great, it's missing the removal of redirections, in case = you >> want to have a port closed again at a later point in time. >> >> This patch adds support for removal of redirections. >=20 > Cool. I was just too lazy to hack on slirp for this so far, but now you= > did it. >=20 >> Signed-off-by: Alexander Graf >> --- >> monitor.c | 5 +++-- >> net.c | 43 ++++++++++++++++++++++++++++++++++++++++++- >> net.h | 2 +- >> slirp/libslirp.h | 1 + >> slirp/slirp.c | 23 +++++++++++++++++++++++ >> vl.c | 2 +- >> 6 files changed, 71 insertions(+), 5 deletions(-) >> >> diff --git a/monitor.c b/monitor.c >> index 0f38c71..dbab3de 100644 >> --- a/monitor.c >> +++ b/monitor.c >> @@ -1759,8 +1759,9 @@ static const mon_cmd_t mon_cmds[] =3D { >> { "host_net_remove", "is", net_host_device_remove, >> "vlan_id name", "remove host VLAN client" }, >> #ifdef CONFIG_SLIRP >> - { "host_net_redir", "s", net_slirp_redir, >> - "[tcp|udp]:host-port:[guest-host]:guest-port", "redirect TCP or= UDP connections from host to guest (requires -net user)" }, >> + { "host_net_redir", "ss?", net_slirp_redir, >> + "[tcp|udp]:host-port:[guest-host]:guest-port", "redirect TCP or= UDP connections from host to guest (requires -net user)\n" >=20 > If going for a single command, this should rather look like this: >=20 > "[tcp|udp]:host-port:[guest-host]:guest-port | > remove [tcp|udp]:host-port" >=20 > BTW, I didn't refactor this interface along with the command line > changes, but I should actually. To remain consistent, we should call it= > host_net_fwd (-redir will be replaced with hostfwd=3D) or even ta= ke > the chance and split it into host_net_fwd_add and host_net_fwd_remove. >=20 >> + "host_net_redir remove [tcp:|udp:]host-port -- remove redirecti= on" }, >> #endif >> { "balloon", "i", do_balloon, >> "target", "request VM to change it's memory allocation (in MB)"= }, Before I forget: You also have to update to monitor-related documentation when adding/changing commands. Jan --------------enig1D2B38DCDB182B15D418DDDC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkoc6gAACgkQniDOoMHTA+l56gCfe9mVpoi7WCfPLuc+m5pEMEFV FfcAn264VT9VqhIXEcd7avlOLmYBjVO2 =S1zc -----END PGP SIGNATURE----- --------------enig1D2B38DCDB182B15D418DDDC--