]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Check for unknown parameters in network option handling
authorMichael Ellerman <michael@ellerman.id.au>
Fri, 10 Aug 2012 05:38:52 +0000 (15:38 +1000)
committerPekka Enberg <penberg@kernel.org>
Mon, 13 Aug 2012 07:29:09 +0000 (10:29 +0300)
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 <asias.hejun@gmail.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/builtin-run.c

index a36bd004c4239b87d9f94bd2767108f6d1604daa..9e5c1d4aaca7c6160044d45d11480e10806f1b3f 100644 (file)
@@ -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;
 }