Skip to content

Commit

Permalink
vl: fix breakage of -tb-size
Browse files Browse the repository at this point in the history
Commit e7b161d ("vl: add tcg_enabled() for tcg related code") adds
a check to exit the program when !tcg_enabled() while parsing the -tb-size
flag.

It turns out that when the -tb-size flag is evaluated, tcg_enabled() can
only return 0, since it is set (or not) much later by configure_accelerator().

Fix it by unconditionally exiting if the flag is passed to a QEMU binary
built with !CONFIG_TCG.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
cota authored and bonzini committed Jul 14, 2017
1 parent 081dd1f commit f940488
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vl.c
Expand Up @@ -3933,10 +3933,10 @@ int main(int argc, char **argv, char **envp)
configure_rtc(opts);
break;
case QEMU_OPTION_tb_size:
if (!tcg_enabled()) {
error_report("TCG is disabled");
exit(1);
}
#ifndef CONFIG_TCG
error_report("TCG is disabled");
exit(1);
#endif
if (qemu_strtoul(optarg, NULL, 0, &tcg_tb_size) < 0) {
error_report("Invalid argument to -tb-size");
exit(1);
Expand Down

0 comments on commit f940488

Please sign in to comment.