Skip to content

Commit

Permalink
vga: avoid crash if no default vga card
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
iaGuoZhi authored and vivier committed Jun 28, 2022
1 parent ad4c7f5 commit 6985d8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion softmmu/vl.c
Expand Up @@ -981,7 +981,8 @@ static void select_vgahw(const MachineClass *machine_class, const char *p)

if (vga_interface_available(t) && ti->opt_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);
Expand Down

0 comments on commit 6985d8e

Please sign in to comment.