qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] User Networking: Enable removal of redirections


From: Jan Kiszka
Subject: [Qemu-devel] Re: [PATCH] User Networking: Enable removal of redirections
Date: Wed, 27 May 2009 10:04:56 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Alexander Graf wrote:
> 
> On 27.05.2009, at 09:21, Jan Kiszka wrote:
> 
>> Jan Kiszka wrote:
>>> 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 <address@hidden>
>>>> ---
>>>> 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)" },
>>
>> Before I forget: You also have to update to monitor-related
>> documentation when adding/changing commands.
> 
> What monitor-related documentation? I did a grep -R host_net_redir qemu
> and didn't find any other occurence of that command :o.

Yeah, I also failed in the discipline of properly updating qemu-doc.texi
when adding host_net_redir. :->

I think Blueswirl recently posted patch to fold monitor options and
documentations into one file just like we already have for the command
line. Would be helpful if that get merged soon

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux




reply via email to

[Prev in Thread] Current Thread [Next in Thread]