From patchwork Fri Jul 18 14:09:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 33869 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DA11120CA0 for ; Fri, 18 Jul 2014 14:17:18 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id cm18sf9912086qab.7 for ; Fri, 18 Jul 2014 07:17:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=7ls9AWMMlrTq7uNvMkDWdlBzNQV/Y9dPw6Fyzx5T3f4=; b=cp7bTtzRrmSrjlu+DHAi+7nV2eeBhs4FD6jDviSZOJbcJvU7MZ9X9/hI8uPl9czGqc OqnrbBf+8zN3C7LESJycoeIxUCOmUigsKGRxL6EytAqUKr1E5+/bIJUDDCyQfomjqLDn TYfbLoUpD2kSkePYZ+dR4O1Hz1IVvDRuUwvnT5T4ucsHDSvjJs41gCbypLDh8OHQhkxL 7bYrJHOIfooz+MPCISmWwZ7d3k3cta5lxIgWqs/MxwZmkcRbomKeMGkrmTQ8AunNH2xp 5aOqHOLx8bY5zUC1pZ2DYauCm93/CuRWVqPoSrRv/PTmd9J6NwhGVKZWVdl3fioHYJJx wMeA== X-Gm-Message-State: ALoCoQlh4gmOAH21SkdLAsOg8Bw6ws9xLEgSFvv2DVHcVBagzWcm1vKZwEaqN4fCqBVrScWEWHTC X-Received: by 10.236.171.234 with SMTP id r70mr2064358yhl.45.1405693037394; Fri, 18 Jul 2014 07:17:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.50.115.35 with SMTP id jl3ls366280igb.44.gmail; Fri, 18 Jul 2014 07:17:17 -0700 (PDT) X-Received: by 10.66.148.9 with SMTP id to9mr5578369pab.42.1405693037140; Fri, 18 Jul 2014 07:17:17 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id ya3si5820996vec.105.2014.07.18.07.17.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 07:17:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id hu12so7324313vcb.6 for ; Fri, 18 Jul 2014 07:17:17 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr6333413vcb.48.1405693036994; Fri, 18 Jul 2014 07:17:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp14898vcb; Fri, 18 Jul 2014 07:17:16 -0700 (PDT) X-Received: by 10.140.92.13 with SMTP id a13mr8199240qge.88.1405693029154; Fri, 18 Jul 2014 07:17:09 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h11si10727411qgf.82.2014.07.18.07.17.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 18 Jul 2014 07:17:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:50088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X88yB-0004Ay-N4 for patch@linaro.org; Fri, 18 Jul 2014 10:17:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X88vb-0001Fy-VI for qemu-devel@nongnu.org; Fri, 18 Jul 2014 10:14:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X88vS-0004dc-Ua for qemu-devel@nongnu.org; Fri, 18 Jul 2014 10:14:27 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:58345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X88vS-0004dM-NJ; Fri, 18 Jul 2014 10:14:18 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7DB8143837; Fri, 18 Jul 2014 18:14:17 +0400 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 313EF6BB; Fri, 18 Jul 2014 18:09:15 +0400 (MSK) Received: (nullmailer pid 621 invoked by uid 1000); Fri, 18 Jul 2014 14:09:14 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Fri, 18 Jul 2014 18:09:06 +0400 Message-Id: <1405692553-564-2-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1405692553-564-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1405692553-564-1-git-send-email-mjt@msgid.tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Subject: [Qemu-devel] [PULL 1/8] slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stack X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mjt@tls.msk.ru X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Maydell 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 --- 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")) {