Skip to contentSkip to conversation

xen: fix boolean parameter handling

PATCH In review Juergen Gross 3 participants 3 messages Aug 28, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 xen/common/kernel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/kernel.c +1 -1
index f96e402515..94fdf5c60a 100644
@@ -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 )
Signature · 7 lines
2.12.3


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 28.08.17 at 16:49, <[email protected]> wrote:

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.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 10 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 28.08.17 at 16:49, <[email protected]> wrote:

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.

Reviewed, tested and queued. Thanks.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel