aboutsummaryrefslogtreecommitdiff
path: root/hmp-commands.hx
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2018-01-11 21:02:40 +0100
committerJason Wang <jasowang@redhat.com>2018-01-29 16:05:37 +0800
commit93653066445bfab5f034225892f512af8e465dcd (patch)
treeab26fcafdab0c5bc063cc40cf9b094a32a942a76 /hmp-commands.hx
parent18d65d225831995f9163e718ad57e839758314e0 (diff)
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 <thuth@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hmp-commands.hx')
-rw-r--r--hmp-commands.hx4
1 files changed, 2 insertions, 2 deletions
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,
},