summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-07-03 17:44:13 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2017-07-04 14:39:28 +0200
commit8b3ae692b83ecffb9315892d67b8ade5e0427e74 (patch)
tree77ecc975e10bc01374bba5d7e784c02b0831abb2
parentb3f6ea7e55e8228d6f84d5cee7cb11cae917ba95 (diff)
vl: convert -tb-size to qemu_strtoul
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--accel/tcg/tcg-all.c2
-rw-r--r--include/sysemu/accel.h2
-rw-r--r--vl.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index dba99315e3..e327d90afd 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -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)
diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h
index ecc5c84621..5a632cee1d 100644
--- a/include/sysemu/accel.h
+++ b/include/sysemu/accel.h
@@ -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 36ff3f4345..ea8ef5fd38 100644
--- 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: