From: Peter Maydell Date: Mon, 16 Jun 2014 15:47:11 +0000 (+0100) Subject: slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stack X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b739ef05dbaffcaade5e756a70f91cdf9c327154;p=qemu.git slirp: Give error message if hostfwd_add/remove for unrecognized vlan/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 Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- diff --git a/net/slirp.c b/net/slirp.c index 8fddc03841..647039ec39 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -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")) {