From patchwork Mon Jun 16 15:47:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 31977 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1AB4B20E7A for ; Mon, 16 Jun 2014 15:47:15 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id va2sf31779179obc.2 for ; Mon, 16 Jun 2014 08:47:15 -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:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=tUBCuwgl3E62Njb4g/Cxwh0WIsT9C33fr5/b/l3bm5U=; b=k4rhyGyEnn+EQB4iGMQmJ8/kfAPFC4pCM0BAhPJl37jB4M3cEYlkAaU6z7zZL6B6BO xAFHfv9XlwVjUsr7PAeUuwtsxZKP+m0KVb60FBb8nJ4vEMSNlFlSPTsAm4E1DkWTpUcr LtVKERdAP3uSfgyaDnPC5d3bR4anOFSue3VCb98rmuRFA//orykMt7Y6ouGcxodVCmsI tw2Jjc0VrTbaRx6LSOnGahdIqlzonfXupRCGD7hk34LNMhUCnR+Gz6vkqwp/Exp5f0Yu jYbR52Q95uRgYhTKeEGvGc8Lvh9myrzelKbpfg6VQH4w2zlBELFmSvc7D3FDvS+KbGCy 14HA== X-Gm-Message-State: ALoCoQmGPrDm6RwJnc28Kl/enUXlWO52Ki43PlrOwo6SoIbToFz6VpR1h2v5H6+PKcVMjI5QyhKt X-Received: by 10.182.27.40 with SMTP id q8mr3056931obg.22.1402933635640; Mon, 16 Jun 2014 08:47:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.38 with SMTP id q35ls1972257qgd.98.gmail; Mon, 16 Jun 2014 08:47:15 -0700 (PDT) X-Received: by 10.220.114.140 with SMTP id e12mr1310836vcq.37.1402933635560; Mon, 16 Jun 2014 08:47:15 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id q9si424827vey.41.2014.06.16.08.47.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 08:47:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so6233504veb.14 for ; Mon, 16 Jun 2014 08:47:15 -0700 (PDT) X-Received: by 10.58.68.129 with SMTP id w1mr729633vet.49.1402933635385; Mon, 16 Jun 2014 08:47:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp143896vcb; Mon, 16 Jun 2014 08:47:15 -0700 (PDT) X-Received: by 10.180.92.161 with SMTP id cn1mr28526032wib.21.1402933634578; Mon, 16 Jun 2014 08:47:14 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id x6si9014651wiw.78.2014.06.16.08.47.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 16 Jun 2014 08:47:14 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WwZ7n-0000rJ-Nq; Mon, 16 Jun 2014 16:47:11 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Jan Kiszka Subject: [PATCH] slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stack Date: Mon, 16 Jun 2014 16:47:11 +0100 Message-Id: <1402933631-3276-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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")) {