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 <asias.hejun@gmail.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Michael Ellerman
2015-06-01 16:39:52 +01:00
committed by Will Deacon
parent db05112725
commit 21aa628e28
+2 -1
View 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;
}