qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Guo Zhi <qtxuning1999@sjtu.edu.cn>,
	Thomas Huth <thuth@redhat.com>,
	Laurent Vivier <laurent@vivier.eu>
Subject: [PULL 01/11] vga: avoid crash if no default vga card
Date: Wed, 29 Jun 2022 11:08:39 +0200	[thread overview]
Message-ID: <20220629090849.1350227-2-laurent@vivier.eu> (raw)
In-Reply-To: <20220629090849.1350227-1-laurent@vivier.eu>

From: Guo Zhi <qtxuning1999@sjtu.edu.cn>

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>
---
 softmmu/vl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index b24772841db3..3f264d4b0930 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -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);
-- 
2.36.1



  reply	other threads:[~2022-06-29  9:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29  9:08 [PULL 00/11] Trivial branch for 7.1 patches Laurent Vivier
2022-06-29  9:08 ` Laurent Vivier [this message]
2022-06-29  9:08 ` [PULL 02/11] qom/object: Remove circular include dependency Laurent Vivier
2022-06-29  9:08 ` [PULL 03/11] util: Return void on iova_tree_remove Laurent Vivier
2022-06-29  9:08 ` [PULL 04/11] Trivial: 3 char repeat typos Laurent Vivier
2022-06-29  9:08 ` [PULL 05/11] trivial typos: namesapce Laurent Vivier
2022-06-29  9:08 ` [PULL 06/11] MAINTAINERS: Add softmmu/runstate.c to "Main loop" Laurent Vivier
2022-06-29  9:08 ` [PULL 07/11] hw/pci-host/i440fx: Remove unused parameter from i440fx_init() Laurent Vivier
2022-06-29  9:08 ` [PULL 08/11] common-user: Only compile the common user code if have_user is set Laurent Vivier
2022-06-29  9:08 ` [PULL 09/11] hw/ide/atapi.c: Correct typos (CD-CDROM -> CD-ROM) Laurent Vivier
2022-06-29  9:08 ` [PULL 10/11] hw/i386/xen/xen-hvm: Allow for stubbing xen_set_pci_link_route() Laurent Vivier
2022-06-29  9:08 ` [PULL 11/11] hw/i386/xen/xen-hvm: Inline xen_piix_pci_write_config_client() and remove it Laurent Vivier
2022-06-30  0:53 ` [PULL 00/11] Trivial branch for 7.1 patches Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220629090849.1350227-2-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=qtxuning1999@sjtu.edu.cn \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).