qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] User Networking: Enable removal of redirections
Date: Wed, 27 May 2009 08:58:31 +0200	[thread overview]
Message-ID: <4A1CE497.4070507@web.de> (raw)
In-Reply-To: <1243335807-9495-1-git-send-email-agraf@suse.de>

[-- Attachment #1: Type: text/plain, Size: 2127 bytes --]

Alexander Graf wrote:
> Using the new host_net_redir command you can easily create redirections
> 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.

Cool. I was just too lazy to hack on slirp for this so far, but now you
did it.

> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  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[] = {
>      { "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"

If going for a single command, this should rather look like this:

"[tcp|udp]:host-port:[guest-host]:guest-port |
 remove [tcp|udp]:host-port"

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=<rule>) or even take
the chance and split it into host_net_fwd_add and host_net_fwd_remove.

> +      "host_net_redir remove [tcp:|udp:]host-port -- remove redirection" },
>  #endif
>      { "balloon", "i", do_balloon,
>        "target", "request VM to change it's memory allocation (in MB)" },

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  parent reply	other threads:[~2009-05-27  6:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26 11:03 [Qemu-devel] [PATCH] User Networking: Enable removal of redirections Alexander Graf
2009-05-26 11:03 ` [Qemu-devel] [PATCH] User networking: Show active connections Alexander Graf
2009-05-27  6:58   ` [Qemu-devel] " Jan Kiszka
2009-05-27  6:58 ` Jan Kiszka [this message]
2009-05-27  7:21   ` [Qemu-devel] Re: [PATCH] User Networking: Enable removal of redirections Jan Kiszka
2009-05-27  7:26     ` Alexander Graf
2009-05-27  8:04       ` Jan Kiszka
2009-05-28 21:31 ` Jan Kiszka
2009-05-28 22:17   ` Alexander Graf
2009-05-29  7:48     ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A1CE497.4070507@web.de \
    --to=jan.kiszka@web.de \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).