From 21aa628e28b594202b4bf33d5344dab37412db19 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Fri, 10 Aug 2012 15:38:52 +1000 Subject: [PATCH] kvm tools: Check for unknown parameters in network option handling 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. Acked-by: Asias He Signed-off-by: Michael Ellerman Signed-off-by: Pekka Enberg --- builtin-run.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin-run.c b/builtin-run.c index a36bd00..9e5c1d4 100644 --- a/builtin-run.c +++ b/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; }