]> git.proxmox.com Git - mirror_qemu.git/commit - net/slirp.c
net: Allow netdevs to be used with 'hostfwd_add' and 'hostfwd_remove'
authorThomas Huth <thuth@redhat.com>
Thu, 11 Jan 2018 20:02:40 +0000 (21:02 +0100)
committerJason Wang <jasowang@redhat.com>
Mon, 29 Jan 2018 08:05:37 +0000 (16:05 +0800)
commit93653066445bfab5f034225892f512af8e465dcd
treeab26fcafdab0c5bc063cc40cf9b094a32a942a76
parent18d65d225831995f9163e718ad57e839758314e0
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>
hmp-commands.hx
net/slirp.c