From: Juergen Gross Date: Mon, 28 Aug 2017 14:49:30 +0000 (+0200) Subject: xen: fix boolean parameter handling X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=94dfb8bf8d0dc3f5cf19c3459dc33a1906aa1bfd;p=people%2Froyger%2Fxen.git xen: fix boolean parameter handling Commit 63e8a1e5ffa7a7fdbde887805f673fea7e8d2e94 ("xen: check parameter validity when parsing command line") introduced a bug for the case when a boolean parameter was specified by its keyword only (no value). It would set just the wrong boolean value for that parameter. Reported-by: Andrew Cooper Signed-off-by: Juergen Gross Acked-by: Jan Beulich Tested-by: Andrew Cooper Reviewed-by: Andrew Cooper --- diff --git a/xen/common/kernel.c b/xen/common/kernel.c index f96e402515..94fdf5c60a 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -136,7 +136,7 @@ static int parse_params(const char *cmdline, const struct kernel_param *start, rctmp = -EINVAL; break; case OPT_BOOL: - rctmp = *optval ? parse_bool(optval, NULL) : 0; + rctmp = *optval ? parse_bool(optval, NULL) : 1; if ( rctmp < 0 ) break; if ( !rctmp )