summary refs log tree commit diff stats
path: root/vl.c
diff options
context:
space:
mode:
authorEmilio G. Cota <cota@braap.org>2017-07-09 03:49:53 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2017-07-14 12:04:42 +0200
commitf940488feaca394ccc68e0595b4c3a9017f16e45 (patch)
tree23e13c4e50777a19e43febd087894c543ea23af1 /vl.c
parent081dd1fe36f0ccc04130d1edd136c787c5f8cc50 (diff)
downloadfocaccia-qemu-f940488feaca394ccc68e0595b4c3a9017f16e45.tar.gz
focaccia-qemu-f940488feaca394ccc68e0595b4c3a9017f16e45.zip
vl: fix breakage of -tb-size
Commit e7b161d573 ("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>
Diffstat (limited to '')
-rw-r--r--vl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vl.c b/vl.c
index f7560de622..85cdbbff15 100644
--- a/vl.c
+++ b/vl.c
@@ -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);