Skip to content

Commit

Permalink
slirp: Give error message if hostfwd_add/remove for unrecognized vlan…
Browse files Browse the repository at this point in the history
…/stack

If the user specified a (vlan ID, slirp stack name) tuple in a monitor
hostfwd_add/remove command and we can't find it, give the user an
error message rather than silently doing nothing.

This brings this error case in slirp_lookup() into line with the
other two.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
pm215 authored and Michael Tokarev committed Jul 18, 2014
1 parent 4d121a5 commit b739ef0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/slirp.c
Expand Up @@ -282,6 +282,7 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *vlan,
NetClientState *nc;
nc = net_hub_find_client_by_name(strtol(vlan, NULL, 0), stack);
if (!nc) {
monitor_printf(mon, "unrecognized (vlan-id, stackname) pair\n");
return NULL;
}
if (strcmp(nc->model, "user")) {
Expand Down

0 comments on commit b739ef0

Please sign in to comment.