computing-offload/generic_vdpa/qemu/vga-avoid-crash-if-no-default-vga-card.patch
jiangdongxu 79c4324644 add generic_vdpa basecode
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
2024-09-19 17:19:46 +08:00

42 lines
1.5 KiB
Diff

From 70b0d16c684364594443520fba504e665f167cc4 Mon Sep 17 00:00:00 2001
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
Date: Fri, 17 Nov 2023 09:38:56 +0000
Subject: [PATCH] vga: avoid crash if no default vga card mainline inclusion
commit 6985d8ede92494f3b791de01e8ee9306eb6d5e4a category: bugfix
---------------------------------------------------------------
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>
Signed-off-by: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
---
softmmu/vl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index d8996f3d6e..e34c8a0646 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -974,7 +974,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);
--
2.27.0