From 93653066445bfab5f034225892f512af8e465dcd Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 11 Jan 2018 21:02:40 +0100 Subject: net: Allow netdevs to be used with 'hostfwd_add' and 'hostfwd_remove' It does not make much sense to limit these commands to the legacy 'vlan' concept only, they should work with the modern netdevs, too. So now it is possible to use this command with one, two or three parameters. With one parameter, the command installs a hostfwd rule on the default "user" network: hostfwd_add tcp:... With two parameters, the command installs a hostfwd rule on a netdev (that's the new way of using this command): hostfwd_add netdev_id tcp:... With three parameters, the command installs a rule on a 'vlan' (aka hub): hostfwd_add hub_id name tcp:... Same applies to the hostfwd_remove command now. Signed-off-by: Thomas Huth Signed-off-by: Jason Wang --- hmp-commands.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hmp-commands.hx') diff --git a/hmp-commands.hx b/hmp-commands.hx index 6d5ebdf6ab..45eebf27e6 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1383,7 +1383,7 @@ ETEXI { .name = "hostfwd_add", .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport", + .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport", .help = "redirect TCP or UDP connections from host to guest (requires -net user)", .cmd = hmp_hostfwd_add, }, @@ -1398,7 +1398,7 @@ ETEXI { .name = "hostfwd_remove", .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport", + .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport", .help = "remove host-to-guest TCP or UDP redirection", .cmd = hmp_hostfwd_remove, }, -- cgit v1.2.1