cmdline: only set ask mode if vga= is present
PATCH 1/1 cmdline: only set ask mode if vga= is present
Commit 9473d9a24182 set the ASK mode without checking if there was a vga option provided in the command line. This breaks existing behavior, so exit early without changes if vga is not present in the command line.
---
Does seem to fix the broken gitlab tests:
https://gitlab.com/xen-project/people/royger/xen/-/pipelines/926397265
--- xen/arch/x86/boot/cmdline.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
xen/arch/x86/boot/cmdline.c +6 -1
@@ -279,9 +279,13 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) {const char *c = cmdline; + c =find_opt (c,"vga=" , true); +if ( !c ) +return ; + ebo->boot_vid_mode =ASK_VGA ; -while ( (c =find_opt (c,"vga=" , true)) !=NULL ) + do { unsigned int tmp, vesa_depth, vesa_height, vesa_width;
@@ -332,6 +336,7 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) else if ( !strmaxcmp(c, "ask", delim_chars_comma) ) ebo->boot_vid_mode = ASK_VGA; } +while ( (c =find_opt (c,"vga=" , true)) !=NULL ); }#endif
Signature · 1 line
2.41.0
Quoted 7 lines · Roger Pau Monne
Commit
9473d9a24182set the ASK mode without checking if there was avgaoption provided in the command line. This breaks existing behavior, so exit early without changes ifvgais not present in the command line.Fixes 9473d9a24182 ('cmdline: parse multiple instances of the vga option')Signed-off-by Roger Pau Monné <[email protected]>
Should have spotted this during review; effectively you're (almost) undoing part of the earlier change, just that ...
xen/arch/x86/boot/cmdline.c static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) · line 282
Quoted 7 lines
xen/arch/x86/boot/cmdline.c +1
-0@@ -279,9 +279,13 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) {const char *c = cmdline; + c =find_opt (c,"vga=" , true);
... you use c instead of cmdline here (and I'm heavily tempted to actually make this the initializer of c).
Jan
Quoted 18 lines
xen/arch/x86/boot/cmdline.c +5
-1+if ( !c ) +return ; + ebo->boot_vid_mode =ASK_VGA ; -while ( (c =find_opt (c,"vga=" , true)) !=NULL ) + do { unsigned int tmp, vesa_depth, vesa_height, vesa_width;@@ -332,6 +336,7 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) else if ( !strmaxcmp(c, "ask", delim_chars_comma) ) ebo->boot_vid_mode = ASK_VGA; } +while ( (c =find_opt (c,"vga=" , true)) !=NULL ); }#endif
Quoted 20 lines · Jan Beulich
Quoted 7 lines · Roger Pau Monne
Commit
9473d9a24182set the ASK mode without checking if there was avgaoption provided in the command line. This breaks existing behavior, so exit early without changes ifvgais not present in the command line.Fixes 9473d9a24182 ('cmdline: parse multiple instances of the vga option')Signed-off-by Roger Pau Monné <[email protected]>Reviewed-by Jan Beulich <[email protected]>Should have spotted this during review; effectively you're (almost) undoing part of the earlier change, just that ...
Quoted 6 lines
xen/arch/x86/boot/cmdline.c +0
-0@@ -279,9 +279,13 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) {const char *c = cmdline;
Quoted 4 lines
xen/arch/x86/boot/cmdline.c static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) · line 282
Quoted 1 line
xen/arch/x86/boot/cmdline.c +1
-0+ c =find_opt (c,"vga=" , true);... you use c instead of cmdline here (and I'm heavily tempted to actually make this the initializer of c).
I see, yes, please do.
Thanks, Roger.
Quoted 21 lines · Roger Pau Monné
Quoted 20 lines · Jan Beulich
Quoted 7 lines · Roger Pau Monne
Commit
9473d9a24182set the ASK mode without checking if there was avgaoption provided in the command line. This breaks existing behavior, so exit early without changes ifvgais not present in the command line.Fixes 9473d9a24182 ('cmdline: parse multiple instances of the vga option')Signed-off-by Roger Pau Monné <[email protected]>Reviewed-by Jan Beulich <[email protected]>Should have spotted this during review; effectively you're (almost) undoing part of the earlier change, just that ...
Quoted 6 lines
xen/arch/x86/boot/cmdline.c +0
-0@@ -279,9 +279,13 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) {const char *c = cmdline;
Quoted 6 lines
Quoted 4 lines
xen/arch/x86/boot/cmdline.c static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) · line 282
Quoted 1 line
xen/arch/x86/boot/cmdline.c +1
-0+ c =find_opt (c,"vga=" , true);... you use c instead of cmdline here (and I'm heavily tempted to actually make this the initializer of c).
I see, yes, please do.
Well, no, I didn't (without your consent), and I wanted to get the patch in yesterday before leaving.
Jan