]> git.proxmox.com Git - mirror_qemu.git/commitdiff
vl: convert -tb-size to qemu_strtoul
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 Jul 2017 15:44:13 +0000 (17:44 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 4 Jul 2017 12:39:28 +0000 (14:39 +0200)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/tcg/tcg-all.c
include/sysemu/accel.h
vl.c

index dba99315e37f4fc838d33ff00b0c6f2afee145aa..e327d90afd05970e2a827fa9fa379dc9f8813f29 100644 (file)
@@ -28,7 +28,7 @@
 #include "sysemu/sysemu.h"
 #include "qom/object.h"
 
-int tcg_tb_size;
+unsigned long tcg_tb_size;
 static bool tcg_allowed = true;
 
 static int tcg_init(MachineState *ms)
index ecc5c8462171464ae1d193efd71adf25da548b9f..5a632cee1d970f1f8db6131444f79b96f567f953 100644 (file)
@@ -63,7 +63,7 @@ typedef struct AccelClass {
 #define ACCEL_GET_CLASS(obj) \
     OBJECT_GET_CLASS(AccelClass, (obj), TYPE_ACCEL)
 
-extern int tcg_tb_size;
+extern unsigned long tcg_tb_size;
 
 void configure_accelerator(MachineState *ms);
 /* Register accelerator specific global properties */
diff --git a/vl.c b/vl.c
index 36ff3f4345b5bc5c771808559f8580874455d6b1..ea8ef5fd38c9c301ac5657e0e56c213ff9d5cae1 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3933,9 +3933,9 @@ int main(int argc, char **argv, char **envp)
                 configure_rtc(opts);
                 break;
             case QEMU_OPTION_tb_size:
-                tcg_tb_size = strtol(optarg, NULL, 0);
-                if (tcg_tb_size < 0) {
-                    tcg_tb_size = 0;
+                if (qemu_strtoul(optarg, NULL, 0, &tcg_tb_size) < 0) {
+                    error_report("Invalid argument to -tb-size");
+                    exit(1);
                 }
                 break;
             case QEMU_OPTION_icount: