From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Subject: [PATCH 2/2] kvm tools: Check for unknown parameters in network option handling Date: Fri, 10 Aug 2012 15:38:52 +1000 Message-ID: <1344577132-19796-2-git-send-email-michael@ellerman.id.au> References: <1344577132-19796-1-git-send-email-michael@ellerman.id.au> Cc: To: Return-path: Received: from ozlabs.org ([203.10.76.45]:60666 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753926Ab2HJFjT (ORCPT ); Fri, 10 Aug 2012 01:39:19 -0400 In-Reply-To: <1344577132-19796-1-git-send-email-michael@ellerman.id.au> Sender: kvm-owner@vger.kernel.org List-ID: Currently the parsing of network command line parameters doesn't check for unknown parameters. For example "-n mod=none" will cause kvmtool to setup TAP networking. Save users from their typos by checking for unknown parameters and bailing. Signed-off-by: Michael Ellerman --- tools/kvm/builtin-run.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index a36bd00..9e5c1d4 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -257,7 +257,8 @@ static int set_net_param(struct virtio_net_params *p, const char *param, p->vhost = atoi(val); } else if (strcmp(param, "fd") == 0) { p->fd = atoi(val); - } + } else + die("Unknown network parameter %s", param); return 0; } -- 1.7.9.5