vl: warn for unavailable accelerators, clarify messages
So far, specifying an accelerator that was not compiled in did not result in an error; fix that. While at it, clarify the mysterious "Back to TCG" message. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6f6e1698a6
commit
8b90f1c5ac
7
vl.c
7
vl.c
|
@ -2723,6 +2723,8 @@ static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!ac) {
|
if (!ac) {
|
||||||
|
*p_init_failed = true;
|
||||||
|
error_report("invalid accelerator %s", acc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
ret = accel_init_machine(ac, current_machine);
|
ret = accel_init_machine(ac, current_machine);
|
||||||
|
@ -2777,6 +2779,9 @@ static void configure_accelerators(const char *progname)
|
||||||
*/
|
*/
|
||||||
if (accel_find(*tmp)) {
|
if (accel_find(*tmp)) {
|
||||||
qemu_opts_parse_noisily(qemu_find_opts("accel"), *tmp, true);
|
qemu_opts_parse_noisily(qemu_find_opts("accel"), *tmp, true);
|
||||||
|
} else {
|
||||||
|
init_failed = true;
|
||||||
|
error_report("invalid accelerator %s", *tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2796,7 +2801,7 @@ static void configure_accelerators(const char *progname)
|
||||||
|
|
||||||
if (init_failed) {
|
if (init_failed) {
|
||||||
AccelClass *ac = ACCEL_GET_CLASS(current_machine->accelerator);
|
AccelClass *ac = ACCEL_GET_CLASS(current_machine->accelerator);
|
||||||
error_report("Back to %s accelerator", ac->name);
|
error_report("falling back to %s", ac->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_icount && !(tcg_enabled() || qtest_enabled())) {
|
if (use_icount && !(tcg_enabled() || qtest_enabled())) {
|
||||||
|
|
Loading…
Reference in New Issue