[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/38] hw/i386/pc: fix regression in parsing vga cmdline parameter
From: |
Paolo Bonzini |
Subject: |
[PULL 07/38] hw/i386/pc: fix regression in parsing vga cmdline parameter |
Date: |
Wed, 8 Jan 2020 13:32:24 +0100 |
From: Peter Wu <address@hidden>
When the 'vga=' parameter is succeeded by another parameter, QEMU 4.2.0
would refuse to start with a rather cryptic message:
$ qemu-system-x86_64 -kernel /boot/vmlinuz-linux -append 'vga=792 quiet'
qemu: can't parse 'vga' parameter: Invalid argument
It was not clear whether this applied to the '-vga std' parameter or the
'-append' one. Fix the parsing regression and clarify the error.
Fixes: 133ef074bd ("hw/i386/pc: replace use of strtol with qemu_strtoui in
x86_load_linux()")
Cc: Sergio Lopez <address@hidden>
Signed-off-by: Peter Wu <address@hidden>
Message-Id: <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/x86.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index d8bb5c2..9b9a4d5 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -612,6 +612,7 @@ void x86_load_linux(X86MachineState *x86ms,
vmode = strstr(kernel_cmdline, "vga=");
if (vmode) {
unsigned int video_mode;
+ const char *end;
int ret;
/* skip "vga=" */
vmode += 4;
@@ -622,10 +623,9 @@ void x86_load_linux(X86MachineState *x86ms,
} else if (!strncmp(vmode, "ask", 3)) {
video_mode = 0xfffd;
} else {
- ret = qemu_strtoui(vmode, NULL, 0, &video_mode);
- if (ret != 0) {
- fprintf(stderr, "qemu: can't parse 'vga' parameter: %s\n",
- strerror(-ret));
+ ret = qemu_strtoui(vmode, &end, 0, &video_mode);
+ if (ret != 0 || (*end && *end != ' ')) {
+ fprintf(stderr, "qemu: invalid 'vga=' kernel parameter.\n");
exit(1);
}
}
--
1.8.3.1
- [PULL 00/38] Misc patches for 2020-01-08, Paolo Bonzini, 2020/01/08
- [PULL 01/38] x86: Check for machine state object class before typecasting it, Paolo Bonzini, 2020/01/08
- [PULL 03/38] hw: fix using 4.2 compat in 5.0 machine types for i440fx/q35, Paolo Bonzini, 2020/01/08
- [PULL 02/38] accel/kvm: Make "kernel_irqchip" default on, Paolo Bonzini, 2020/01/08
- [PULL 04/38] replay: check other timers for icount limit, Paolo Bonzini, 2020/01/08
- [PULL 05/38] replay: record and replay random number sources, Paolo Bonzini, 2020/01/08
- [PULL 06/38] hw/i386/x86-iommu: Add missing stubs, Paolo Bonzini, 2020/01/08
- [PULL 07/38] hw/i386/pc: fix regression in parsing vga cmdline parameter,
Paolo Bonzini <=
- [PULL 08/38] hw/timer/Kconfig: Intel 8254 PIT depends of ISA bus, Paolo Bonzini, 2020/01/08
- [PULL 09/38] hw/usb/redirect: Do not link 'usb-redir' device when USB not enabled, Paolo Bonzini, 2020/01/08
- [PULL 10/38] hw/intc/i8259: Fix Kconfig dependency on ISA bus, Paolo Bonzini, 2020/01/08
- [PULL 11/38] hw/i386/Kconfig: Let the MicroVM machine select the SERIAL_ISA config, Paolo Bonzini, 2020/01/08
- [PULL 12/38] hw/ppc/Kconfig: Restrict the MPC I2C controller to e500-based platforms, Paolo Bonzini, 2020/01/08
- [PULL 13/38] hw/ppc/Kconfig: Let the Sam460ex board use the PowerPC 405 devices, Paolo Bonzini, 2020/01/08
- [PULL 14/38] hw/ppc/Kconfig: Let the Xilinx Virtex5 ML507 use the PPC-440 devices, Paolo Bonzini, 2020/01/08
- [PULL 15/38] hw/ppc/Makefile: Simplify the sPAPR PCI objects rule, Paolo Bonzini, 2020/01/08
- [PULL 16/38] hw/ppc/Kconfig: Only select fw_cfg with machines using OpenBIOS, Paolo Bonzini, 2020/01/08
- [PULL 17/38] hw/ppc/Kconfig: Only select FDT helper for machines using it, Paolo Bonzini, 2020/01/08