Skip to content

Commit

Permalink
vl: convert -tb-size to qemu_strtoul
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Jul 4, 2017
1 parent b3f6ea7 commit 8b3ae69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion accel/tcg/tcg-all.c
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion include/sysemu/accel.h
Expand Up @@ -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 */
Expand Down
6 changes: 3 additions & 3 deletions vl.c
Expand Up @@ -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:
Expand Down

0 comments on commit 8b3ae69

Please sign in to comment.