net: Remove deprecated [hub_id name] tuple of 'hostfwd_add' / 'hostfwd_remove'
PATCH 1/1 net: Remove deprecated [hub_id name] tuple of 'hostfwd_add' / 'hostfwd_remove'
It's been deprecated since QEMU v3.1.0. Time to finally remove it now.
--- hmp-commands.hx | 8 ++++---- net/hub.c | 23 ----------------------- net/hub.h | 2 -- net/slirp.c | 44 ++++++++++++-------------------------------- qemu-deprecated.texi | 13 ++++++++----- 5 files changed, 24 insertions(+), 66 deletions(-)
hmp-commands.hx +4 -4
@@ -1463,8 +1463,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_add", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport", + .args_type = "arg1:s,arg2:s?", + .params = "[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, },
@@ -1478,8 +1478,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_remove", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport", + .args_type = "arg1:s,arg2:s?", + .params = "[netdev_id] [tcp|udp]:[hostaddr]:hostport", .help = "remove host-to-guest TCP or UDP redirection", .cmd = hmp_hostfwd_remove, },
net/hub.c +0 -23
@@ -193,29 +193,6 @@ NetClientState *net_hub_add_port(int hub_id, const char *name,return &port->nc; } -/** -* Find a specific client on a hub -*/ -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name) -{ -NetHub *hub; -NetHubPort *port; -NetClientState *peer; - - QLIST_FOREACH(hub, &hubs, next) { -if (hub->id == hub_id) { - QLIST_FOREACH(port, &hub->ports, next) { - peer = port->nc.peer; - -if (peer &&strcmp (peer->name, name) ==0 ) { -return peer; - } - } - } - } -return NULL ; -} -/** * Find a available port on a hub; otherwise create one new port */
net/hub.h +0 -2
@@ -15,10 +15,8 @@#ifndef NET_HUB_H #define NET_HUB_H -NetClientState *net_hub_add_port (int hub_id,const char *name,NetClientState *hubpeer); -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name);void net_hub_info (Monitor *mon);void net_hub_check_clients (void );bool net_hub_flush (NetClientState *nc);
net/slirp.c +12 -32
69 lines not on this page · raw message
qemu-deprecated.texi +8 -5
@@ -206,11 +206,6 @@ the 'wait' field, which is only applicable to sockets in server mode @section Human Monitor Protocol (HMP) commands -@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1) - -The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and -'hostfwd_remove' HMP commands has been replaced by @option{netdev_id}. - @subsection cpu-add (since 4.0) Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See
@@ -376,6 +371,14 @@ What follows is a record of recently removed, formerly deprecated features that serves as a record for users who have encountered trouble after a recent upgrade. +@section Human Monitor Protocol (HMP) commands + +@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (removed in 5.0) + +The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and +'hostfwd_remove' HMP commands has been replaced by the single option +@option{netdev_id}. + @section QEMU Machine Protocol (QMP) commands @subsection block-dirty-bitmap-add "autoload" parameter (since 4.2.0)
Signature · 1 line
2.18.1
Quoted 27 lines · * Thomas Huth ([email protected]) wrote:
It's been deprecated since QEMU v3.1.0. Time to finally remove it now.
Signed-off-by Thomas Huth <[email protected]>--- hmp-commands.hx | 8 ++++---- net/hub.c | 23 ----------------------- net/hub.h | 2 -- net/slirp.c | 44 ++++++++++++-------------------------------- qemu-deprecated.texi | 13 ++++++++----- 5 files changed, 24 insertions(+), 66 deletions(-)hmp-commands.hx +2
-2@@ -1463,8 +1463,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_add", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport", + .args_type = "arg1:s,arg2:s?", + .params = "[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, },
hmp-commands.hx ETEXI · line 1485
Quoted 10 lines
hmp-commands.hx +2
-2@@ -1478,8 +1478,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_remove", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport", + .args_type = "arg1:s,arg2:s?", + .params = "[netdev_id] [tcp|udp]:[hostaddr]:hostport", .help = "remove host-to-guest TCP or UDP redirection", .cmd = hmp_hostfwd_remove, },
for HMP:
Quoted 159 lines
net/hub.c +0
-23@@ -193,29 +193,6 @@ NetClientState *net_hub_add_port(int hub_id, const char *name,return &port->nc; } -/** -* Find a specific client on a hub -*/ -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name) -{ -NetHub *hub; -NetHubPort *port; -NetClientState *peer; - - QLIST_FOREACH(hub, &hubs, next) { -if (hub->id == hub_id) { - QLIST_FOREACH(port, &hub->ports, next) { - peer = port->nc.peer; - -if (peer &&strcmp (peer->name, name) ==0 ) { -return peer; - } - } - } - } -return NULL ; -} -/** * Find a available port on a hub; otherwise create one new port */ net/hub.h +0
-2@@ -15,10 +15,8 @@#ifndef NET_HUB_H #define NET_HUB_H -NetClientState *net_hub_add_port (int hub_id,const char *name,NetClientState *hubpeer); -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name);void net_hub_info (Monitor *mon);void net_hub_check_clients (void );bool net_hub_flush (NetClientState *nc);net/slirp.c +12
-32@@ -610,25 +610,13 @@ error:return -1 ; } -static SlirpState *slirp_lookup (Monitor *mon,const char *hub_id, -const char *name) +static SlirpState *slirp_lookup (Monitor *mon,const char *id) { -if (name) { -NetClientState *nc; -if (hub_id) { - nc =net_hub_find_client_by_name (strtol (hub_id,NULL ,0 ), name); -if (!nc) { -monitor_printf (mon,"unrecognized (hub-id, stackname) pair\n" ); -return NULL ; - } -warn_report ("Using 'hub-id' is deprecated, specify the netdev id " -"directly instead" ); - }else { - nc =qemu_find_netdev (name); -if (!nc) { -monitor_printf (mon,"unrecognized netdev id '%s'\n" , name); -return NULL ; - } +if (id) { +NetClientState *nc =qemu_find_netdev (id); +if (!nc) { +monitor_printf (mon,"unrecognized netdev id '%s'\n" , id); +return NULL ; }if (strcmp (nc->model,"user" )) {monitor_printf (mon,"invalid device specified\n" );@@ -655,16 +643,12 @@ void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict)int err;const char *arg1 =qdict_get_str (qdict,"arg1" );const char *arg2 =qdict_get_try_str (qdict,"arg2" ); -const char *arg3 =qdict_get_try_str (qdict,"arg3" ); -if (arg3) { - s =slirp_lookup (mon, arg1, arg2); - src_str = arg3; - }else if (arg2) { - s =slirp_lookup (mon,NULL , arg1); +if (arg2) { + s =slirp_lookup (mon, arg1); src_str = arg2; }else { - s =slirp_lookup (mon,NULL ,NULL ); + s =slirp_lookup (mon,NULL ); src_str = arg1; }if (!s) {@@ -784,16 +768,12 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict)SlirpState *s;const char *arg1 =qdict_get_str (qdict,"arg1" );const char *arg2 =qdict_get_try_str (qdict,"arg2" ); -const char *arg3 =qdict_get_try_str (qdict,"arg3" ); -if (arg3) { - s =slirp_lookup (mon, arg1, arg2); - redir_str = arg3; - }else if (arg2) { - s =slirp_lookup (mon,NULL , arg1); +if (arg2) { + s =slirp_lookup (mon, arg1); redir_str = arg2; }else { - s =slirp_lookup (mon,NULL ,NULL ); + s =slirp_lookup (mon,NULL ); redir_str = arg1; }if (s) {qemu-deprecated.texi +8
-5@@ -206,11 +206,6 @@ the 'wait' field, which is only applicable to sockets in server mode @section Human Monitor Protocol (HMP) commands -@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1) - -The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and -'hostfwd_remove' HMP commands has been replaced by @option{netdev_id}. - @subsection cpu-add (since 4.0) Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See@@ -376,6 +371,14 @@ What follows is a record of recently removed, formerly deprecated features that serves as a record for users who have encountered trouble after a recent upgrade. +@section Human Monitor Protocol (HMP) commands + +@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (removed in 5.0) + +The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and +'hostfwd_remove' HMP commands has been replaced by the single option +@option{netdev_id}. + @section QEMU Machine Protocol (QMP) commands @subsection block-dirty-bitmap-add "autoload" parameter (since 4.2.0)Signature · 1 line
2.18.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Quoted 184 lines · Thomas Huth
It's been deprecated since QEMU v3.1.0. Time to finally remove it now.
Signed-off-by Thomas Huth <[email protected]>--- hmp-commands.hx | 8 ++++---- net/hub.c | 23 ----------------------- net/hub.h | 2 -- net/slirp.c | 44 ++++++++++++-------------------------------- qemu-deprecated.texi | 13 ++++++++----- 5 files changed, 24 insertions(+), 66 deletions(-)hmp-commands.hx +4
-4@@ -1463,8 +1463,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_add", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport", + .args_type = "arg1:s,arg2:s?", + .params = "[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, },@@ -1478,8 +1478,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_remove", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport", + .args_type = "arg1:s,arg2:s?", + .params = "[netdev_id] [tcp|udp]:[hostaddr]:hostport", .help = "remove host-to-guest TCP or UDP redirection", .cmd = hmp_hostfwd_remove, },net/hub.c +0
-23@@ -193,29 +193,6 @@ NetClientState *net_hub_add_port(int hub_id, const char *name,return &port->nc; } -/** -* Find a specific client on a hub -*/ -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name) -{ -NetHub *hub; -NetHubPort *port; -NetClientState *peer; - - QLIST_FOREACH(hub, &hubs, next) { -if (hub->id == hub_id) { - QLIST_FOREACH(port, &hub->ports, next) { - peer = port->nc.peer; - -if (peer &&strcmp (peer->name, name) ==0 ) { -return peer; - } - } - } - } -return NULL ; -} -/** * Find a available port on a hub; otherwise create one new port */ net/hub.h +0
-2@@ -15,10 +15,8 @@#ifndef NET_HUB_H #define NET_HUB_H -NetClientState *net_hub_add_port (int hub_id,const char *name,NetClientState *hubpeer); -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name);void net_hub_info (Monitor *mon);void net_hub_check_clients (void );bool net_hub_flush (NetClientState *nc);net/slirp.c +12
-32@@ -610,25 +610,13 @@ error:return -1 ; } -static SlirpState *slirp_lookup (Monitor *mon,const char *hub_id, -const char *name) +static SlirpState *slirp_lookup (Monitor *mon,const char *id) { -if (name) { -NetClientState *nc; -if (hub_id) { - nc =net_hub_find_client_by_name (strtol (hub_id,NULL ,0 ), name); -if (!nc) { -monitor_printf (mon,"unrecognized (hub-id, stackname) pair\n" ); -return NULL ; - } -warn_report ("Using 'hub-id' is deprecated, specify the netdev id " -"directly instead" ); - }else { - nc =qemu_find_netdev (name); -if (!nc) { -monitor_printf (mon,"unrecognized netdev id '%s'\n" , name); -return NULL ; - } +if (id) { +NetClientState *nc =qemu_find_netdev (id); +if (!nc) { +monitor_printf (mon,"unrecognized netdev id '%s'\n" , id); +return NULL ; }if (strcmp (nc->model,"user" )) {monitor_printf (mon,"invalid device specified\n" );@@ -655,16 +643,12 @@ void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict)int err;const char *arg1 =qdict_get_str (qdict,"arg1" );const char *arg2 =qdict_get_try_str (qdict,"arg2" ); -const char *arg3 =qdict_get_try_str (qdict,"arg3" ); -if (arg3) { - s =slirp_lookup (mon, arg1, arg2); - src_str = arg3; - }else if (arg2) { - s =slirp_lookup (mon,NULL , arg1); +if (arg2) { + s =slirp_lookup (mon, arg1); src_str = arg2; }else { - s =slirp_lookup (mon,NULL ,NULL ); + s =slirp_lookup (mon,NULL ); src_str = arg1; }if (!s) {@@ -784,16 +768,12 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict)SlirpState *s;const char *arg1 =qdict_get_str (qdict,"arg1" );const char *arg2 =qdict_get_try_str (qdict,"arg2" ); -const char *arg3 =qdict_get_try_str (qdict,"arg3" ); -if (arg3) { - s =slirp_lookup (mon, arg1, arg2); - redir_str = arg3; - }else if (arg2) { - s =slirp_lookup (mon,NULL , arg1); +if (arg2) { + s =slirp_lookup (mon, arg1); redir_str = arg2; }else { - s =slirp_lookup (mon,NULL ,NULL ); + s =slirp_lookup (mon,NULL ); redir_str = arg1; }if (s) {qemu-deprecated.texi +1
-5@@ -206,11 +206,6 @@ the 'wait' field, which is only applicable to sockets in server mode @section Human Monitor Protocol (HMP) commands -@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1) - -The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and -'hostfwd_remove' HMP commands has been replaced by @option{netdev_id}. - @subsection cpu-add (since 4.0) Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See@@ -376,6 +371,14 @@ What follows is a record of recently removed, formerly deprecated features that serves as a record for users who have encountered trouble after a recent upgrade. +@section Human Monitor Protocol (HMP) commands
qemu-deprecated.texi What follows is a record of recently removed, formerly deprecated · line 384
Quoted 10 lines
qemu-deprecated.texi +7
-0+ +@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (removed in 5.0) + +The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and +'hostfwd_remove' HMP commands has been replaced by the single option +@option{netdev_id}. + @section QEMU Machine Protocol (QMP) commands @subsection block-dirty-bitmap-add "autoload" parameter (since 4.2.0)
Ping?
Thomas
Dr. David Alan Gilbert
Acked-byQuoted 4 lines · * Thomas Huth ([email protected]) wrote:
Quoted 3 lines · Thomas Huth
It's been deprecated since QEMU v3.1.0. Time to finally remove it now.
Signed-off-by Thomas Huth <[email protected]>
For hmp:
would want an ack from Samuel (or maybe Marc-André)
Dave
Quoted 189 lines
Quoted 189 lines
--- hmp-commands.hx | 8 ++++---- net/hub.c | 23 ----------------------- net/hub.h | 2 -- net/slirp.c | 44 ++++++++++++-------------------------------- qemu-deprecated.texi | 13 ++++++++----- 5 files changed, 24 insertions(+), 66 deletions(-)hmp-commands.hx +4
-4@@ -1463,8 +1463,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_add", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport", + .args_type = "arg1:s,arg2:s?", + .params = "[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, },@@ -1478,8 +1478,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_remove", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport", + .args_type = "arg1:s,arg2:s?", + .params = "[netdev_id] [tcp|udp]:[hostaddr]:hostport", .help = "remove host-to-guest TCP or UDP redirection", .cmd = hmp_hostfwd_remove, },net/hub.c +0
-23@@ -193,29 +193,6 @@ NetClientState *net_hub_add_port(int hub_id, const char *name,return &port->nc; } -/** -* Find a specific client on a hub -*/ -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name) -{ -NetHub *hub; -NetHubPort *port; -NetClientState *peer; - - QLIST_FOREACH(hub, &hubs, next) { -if (hub->id == hub_id) { - QLIST_FOREACH(port, &hub->ports, next) { - peer = port->nc.peer; - -if (peer &&strcmp (peer->name, name) ==0 ) { -return peer; - } - } - } - } -return NULL ; -} -/** * Find a available port on a hub; otherwise create one new port */ net/hub.h +0
-2@@ -15,10 +15,8 @@#ifndef NET_HUB_H #define NET_HUB_H -NetClientState *net_hub_add_port (int hub_id,const char *name,NetClientState *hubpeer); -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name);void net_hub_info (Monitor *mon);void net_hub_check_clients (void );bool net_hub_flush (NetClientState *nc);net/slirp.c +12
-32@@ -610,25 +610,13 @@ error:return -1 ; } -static SlirpState *slirp_lookup (Monitor *mon,const char *hub_id, -const char *name) +static SlirpState *slirp_lookup (Monitor *mon,const char *id) { -if (name) { -NetClientState *nc; -if (hub_id) { - nc =net_hub_find_client_by_name (strtol (hub_id,NULL ,0 ), name); -if (!nc) { -monitor_printf (mon,"unrecognized (hub-id, stackname) pair\n" ); -return NULL ; - } -warn_report ("Using 'hub-id' is deprecated, specify the netdev id " -"directly instead" ); - }else { - nc =qemu_find_netdev (name); -if (!nc) { -monitor_printf (mon,"unrecognized netdev id '%s'\n" , name); -return NULL ; - } +if (id) { +NetClientState *nc =qemu_find_netdev (id); +if (!nc) { +monitor_printf (mon,"unrecognized netdev id '%s'\n" , id); +return NULL ; }if (strcmp (nc->model,"user" )) {monitor_printf (mon,"invalid device specified\n" );@@ -655,16 +643,12 @@ void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict)int err;const char *arg1 =qdict_get_str (qdict,"arg1" );const char *arg2 =qdict_get_try_str (qdict,"arg2" ); -const char *arg3 =qdict_get_try_str (qdict,"arg3" ); -if (arg3) { - s =slirp_lookup (mon, arg1, arg2); - src_str = arg3; - }else if (arg2) { - s =slirp_lookup (mon,NULL , arg1); +if (arg2) { + s =slirp_lookup (mon, arg1); src_str = arg2; }else { - s =slirp_lookup (mon,NULL ,NULL ); + s =slirp_lookup (mon,NULL ); src_str = arg1; }if (!s) {@@ -784,16 +768,12 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict)SlirpState *s;const char *arg1 =qdict_get_str (qdict,"arg1" );const char *arg2 =qdict_get_try_str (qdict,"arg2" ); -const char *arg3 =qdict_get_try_str (qdict,"arg3" ); -if (arg3) { - s =slirp_lookup (mon, arg1, arg2); - redir_str = arg3; - }else if (arg2) { - s =slirp_lookup (mon,NULL , arg1); +if (arg2) { + s =slirp_lookup (mon, arg1); redir_str = arg2; }else { - s =slirp_lookup (mon,NULL ,NULL ); + s =slirp_lookup (mon,NULL ); redir_str = arg1; }if (s) {qemu-deprecated.texi +8
-5@@ -206,11 +206,6 @@ the 'wait' field, which is only applicable to sockets in server mode @section Human Monitor Protocol (HMP) commands -@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1) - -The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and -'hostfwd_remove' HMP commands has been replaced by @option{netdev_id}. - @subsection cpu-add (since 4.0) Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See@@ -376,6 +371,14 @@ What follows is a record of recently removed, formerly deprecated features that serves as a record for users who have encountered trouble after a recent upgrade. +@section Human Monitor Protocol (HMP) commands + +@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (removed in 5.0) + +The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and +'hostfwd_remove' HMP commands has been replaced by the single option +@option{netdev_id}. + @section QEMU Machine Protocol (QMP) commands
Quoted 6 lines
qemu-deprecated.texi What follows is a record of recently removed, formerly deprecated · line 384
Quoted 2 lines
qemu-deprecated.texi +0
-0@subsection block-dirty-bitmap-add "autoload" parameter (since 4.2.0)Ping?
Thomas
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Dr. David Alan Gilbert
AppliedQuoted 3 lines · * Thomas Huth ([email protected]) wrote:
It's been deprecated since QEMU v3.1.0. Time to finally remove it now.
Signed-off-by Thomas Huth <[email protected]>
Queued, via HMP, I've reworked the qemu-deprecated into the new rst world.
Quoted 194 lines
--- hmp-commands.hx | 8 ++++---- net/hub.c | 23 ----------------------- net/hub.h | 2 -- net/slirp.c | 44 ++++++++++++-------------------------------- qemu-deprecated.texi | 13 ++++++++----- 5 files changed, 24 insertions(+), 66 deletions(-)hmp-commands.hx +4
-4@@ -1463,8 +1463,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_add", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport", + .args_type = "arg1:s,arg2:s?", + .params = "[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, },@@ -1478,8 +1478,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name = "hostfwd_remove", - .args_type = "arg1:s,arg2:s?,arg3:s?", - .params = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport", + .args_type = "arg1:s,arg2:s?", + .params = "[netdev_id] [tcp|udp]:[hostaddr]:hostport", .help = "remove host-to-guest TCP or UDP redirection", .cmd = hmp_hostfwd_remove, },net/hub.c +0
-23@@ -193,29 +193,6 @@ NetClientState *net_hub_add_port(int hub_id, const char *name,return &port->nc; } -/** -* Find a specific client on a hub -*/ -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name) -{ -NetHub *hub; -NetHubPort *port; -NetClientState *peer; - - QLIST_FOREACH(hub, &hubs, next) { -if (hub->id == hub_id) { - QLIST_FOREACH(port, &hub->ports, next) { - peer = port->nc.peer; - -if (peer &&strcmp (peer->name, name) ==0 ) { -return peer; - } - } - } - } -return NULL ; -} -/** * Find a available port on a hub; otherwise create one new port */ net/hub.h +0
-2@@ -15,10 +15,8 @@#ifndef NET_HUB_H #define NET_HUB_H -NetClientState *net_hub_add_port (int hub_id,const char *name,NetClientState *hubpeer); -NetClientState *net_hub_find_client_by_name (int hub_id,const char *name);void net_hub_info (Monitor *mon);void net_hub_check_clients (void );bool net_hub_flush (NetClientState *nc);net/slirp.c +12
-32@@ -610,25 +610,13 @@ error:return -1 ; } -static SlirpState *slirp_lookup (Monitor *mon,const char *hub_id, -const char *name) +static SlirpState *slirp_lookup (Monitor *mon,const char *id) { -if (name) { -NetClientState *nc; -if (hub_id) { - nc =net_hub_find_client_by_name (strtol (hub_id,NULL ,0 ), name); -if (!nc) { -monitor_printf (mon,"unrecognized (hub-id, stackname) pair\n" ); -return NULL ; - } -warn_report ("Using 'hub-id' is deprecated, specify the netdev id " -"directly instead" ); - }else { - nc =qemu_find_netdev (name); -if (!nc) { -monitor_printf (mon,"unrecognized netdev id '%s'\n" , name); -return NULL ; - } +if (id) { +NetClientState *nc =qemu_find_netdev (id); +if (!nc) { +monitor_printf (mon,"unrecognized netdev id '%s'\n" , id); +return NULL ; }if (strcmp (nc->model,"user" )) {monitor_printf (mon,"invalid device specified\n" );@@ -655,16 +643,12 @@ void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict)int err;const char *arg1 =qdict_get_str (qdict,"arg1" );const char *arg2 =qdict_get_try_str (qdict,"arg2" ); -const char *arg3 =qdict_get_try_str (qdict,"arg3" ); -if (arg3) { - s =slirp_lookup (mon, arg1, arg2); - src_str = arg3; - }else if (arg2) { - s =slirp_lookup (mon,NULL , arg1); +if (arg2) { + s =slirp_lookup (mon, arg1); src_str = arg2; }else { - s =slirp_lookup (mon,NULL ,NULL ); + s =slirp_lookup (mon,NULL ); src_str = arg1; }if (!s) {@@ -784,16 +768,12 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict)SlirpState *s;const char *arg1 =qdict_get_str (qdict,"arg1" );const char *arg2 =qdict_get_try_str (qdict,"arg2" ); -const char *arg3 =qdict_get_try_str (qdict,"arg3" ); -if (arg3) { - s =slirp_lookup (mon, arg1, arg2); - redir_str = arg3; - }else if (arg2) { - s =slirp_lookup (mon,NULL , arg1); +if (arg2) { + s =slirp_lookup (mon, arg1); redir_str = arg2; }else { - s =slirp_lookup (mon,NULL ,NULL ); + s =slirp_lookup (mon,NULL ); redir_str = arg1; }if (s) {qemu-deprecated.texi +8
-5@@ -206,11 +206,6 @@ the 'wait' field, which is only applicable to sockets in server mode @section Human Monitor Protocol (HMP) commands -@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1) - -The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and -'hostfwd_remove' HMP commands has been replaced by @option{netdev_id}. - @subsection cpu-add (since 4.0) Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See@@ -376,6 +371,14 @@ What follows is a record of recently removed, formerly deprecated features that serves as a record for users who have encountered trouble after a recent upgrade. +@section Human Monitor Protocol (HMP) commands + +@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (removed in 5.0) + +The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and +'hostfwd_remove' HMP commands has been replaced by the single option +@option{netdev_id}. + @section QEMU Machine Protocol (QMP) commands @subsection block-dirty-bitmap-add "autoload" parameter (since 4.2.0)Signature · 1 line
2.18.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK