[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/39] hw/i386/pc: replace use of strtol with qemu_strtoui in x86_
From: |
Paolo Bonzini |
Subject: |
[PULL 10/39] hw/i386/pc: replace use of strtol with qemu_strtoui in x86_load_linux() |
Date: |
Thu, 24 Oct 2019 16:03:26 +0200 |
From: Sergio Lopez <address@hidden>
Follow checkpatch.pl recommendation and replace the use of strtol with
qemu_strtoui in x86_load_linux().
Signed-off-by: Sergio Lopez <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
---
hw/i386/pc.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 75a97c2..b5b660f 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -68,6 +68,7 @@
#include "qemu/config-file.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
+#include "qemu/cutils.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/cpu_hotplug.h"
#include "hw/boards.h"
@@ -1202,6 +1203,7 @@ static void x86_load_linux(PCMachineState *pcms,
vmode = strstr(kernel_cmdline, "vga=");
if (vmode) {
unsigned int video_mode;
+ int ret;
/* skip "vga=" */
vmode += 4;
if (!strncmp(vmode, "normal", 6)) {
@@ -1211,7 +1213,12 @@ static void x86_load_linux(PCMachineState *pcms,
} else if (!strncmp(vmode, "ask", 3)) {
video_mode = 0xfffd;
} else {
- video_mode = strtol(vmode, NULL, 0);
+ ret = qemu_strtoui(vmode, NULL, 0, &video_mode);
+ if (ret != 0) {
+ fprintf(stderr, "qemu: can't parse 'vga' parameter: %s\n",
+ strerror(-ret));
+ exit(1);
+ }
}
stw_p(header + 0x1fa, video_mode);
}
--
1.8.3.1
- [PULL 00/39] Misc (mostly x86) patches for 2019-10-24, Paolo Bonzini, 2019/10/24
- [PULL 01/39] target/i386: log MCE guest and host addresses, Paolo Bonzini, 2019/10/24
- [PULL 06/39] memory-device: simplify Makefile.objs conditions, Paolo Bonzini, 2019/10/24
- [PULL 04/39] i386/kvm: add NoNonArchitecturalCoreSharing Hyper-V enlightenment, Paolo Bonzini, 2019/10/24
- [PULL 02/39] mc146818rtc: fix timer interrupt reinjection, Paolo Bonzini, 2019/10/24
- [PULL 05/39] Do not use %m in common code to print error messages, Paolo Bonzini, 2019/10/24
- [PULL 03/39] Updated Bulgarian translation (19) - 4.1.0, Paolo Bonzini, 2019/10/24
- [PULL 08/39] hw/i386/pc: rename functions shared with non-PC machines, Paolo Bonzini, 2019/10/24
- [PULL 07/39] hw/virtio: Factorize virtio-mmio headers, Paolo Bonzini, 2019/10/24
- [PULL 10/39] hw/i386/pc: replace use of strtol with qemu_strtoui in x86_load_linux(),
Paolo Bonzini <=
- [PULL 11/39] hw/i386/pc: avoid an assignment in if condition in x86_load_linux(), Paolo Bonzini, 2019/10/24
- [PULL 09/39] hw/i386/pc: fix code style issues on functions that will be moved out, Paolo Bonzini, 2019/10/24
- [PULL 17/39] hw/intc/apic: reject pic ints if isa_pic == NULL, Paolo Bonzini, 2019/10/24
- [PULL 21/39] MAINTAINERS: add microvm related files, Paolo Bonzini, 2019/10/24
- [PULL 18/39] roms: add microvm-bios (qboot) as binary and git submodule, Paolo Bonzini, 2019/10/24
- [PULL 15/39] hw/i386: make x86.c independent from PCMachineState, Paolo Bonzini, 2019/10/24
- [PULL 12/39] hw/i386/pc: remove commented out code from x86_load_linux(), Paolo Bonzini, 2019/10/24
- [PULL 23/39] runstate: ignore exit request in finish migrate state, Paolo Bonzini, 2019/10/24
- [PULL 20/39] hw/i386: Introduce the microvm machine type, Paolo Bonzini, 2019/10/24
- [PULL 19/39] docs/microvm.rst: document the new microvm machine type, Paolo Bonzini, 2019/10/24