]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stack
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 16 Jun 2014 15:47:11 +0000 (16:47 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 18 Jul 2014 13:45:36 +0000 (17:45 +0400)
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>
net/slirp.c

index 8fddc0384167dfe2b1392843de034feec95681a6..647039ec3987a1a1a8e768db85b5b1937beb5eda 100644 (file)
@@ -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")) {