Received: from eggs.gnu.org ([2001:4830:134:3::10]:38614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwZ8K-0001Qt-0s for qemu-devel@nongnu.org; Mon, 16 Jun 2014 11:47:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwZ8I-0005p1-OZ for qemu-devel@nongnu.org; Mon, 16 Jun 2014 11:47:43 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwZ8I-0005cR-I0 for qemu-devel@nongnu.org; Mon, 16 Jun 2014 11:47:42 -0400 From: Peter Maydell Date: Mon, 16 Jun 2014 16:47:11 +0100 Message-Id: <1402933631-3276-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stack List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka , patches@linaro.org 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 --- net/slirp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/slirp.c b/net/slirp.c index 8fddc03..647039e 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")) { -- 1.9.2