vga: avoid crash if no default vga card
QEMU in some arch will crash when executing -vga help command, because there is no default vga model. Add check to this case and avoid crash. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/978 Signed-off-by: Guo Zhi <qtxuning1999@sjtu.edu.cn> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220503091724.970009-1-qtxuning1999@sjtu.edu.cn> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
ad4c7f529a
commit
6985d8ede9
@ -981,7 +981,8 @@ static void select_vgahw(const MachineClass *machine_class, const char *p)
|
|||||||
|
|
||||||
if (vga_interface_available(t) && ti->opt_name) {
|
if (vga_interface_available(t) && ti->opt_name) {
|
||||||
printf("%-20s %s%s\n", ti->opt_name, ti->name ?: "",
|
printf("%-20s %s%s\n", ti->opt_name, ti->name ?: "",
|
||||||
g_str_equal(ti->opt_name, def) ? " (default)" : "");
|
(def && g_str_equal(ti->opt_name, def)) ?
|
||||||
|
" (default)" : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user