From: Gerd Hoffmann <kraxel@redhat.com>
To: Cole Robinson <crobinso@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] ui: sdl2: Fix crash with -nodefaults -sdl
Date: Wed, 01 Jun 2016 08:38:17 +0200 [thread overview]
Message-ID: <1464763097.8823.13.camel@redhat.com> (raw)
In-Reply-To: <2e555d67b7e53a86bef98f774a2706f2b0ec4ea0.1464728215.git.crobinso@redhat.com>
On Di, 2016-05-31 at 16:56 -0400, Cole Robinson wrote:
> $ ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -sdl
> Segmentation fault (core dumped)
>
> 0 0x00005555559631af in sdl_display_init (ds=<optimized out>, full_screen=0, no_frame=<optimized out>) at ui/sdl2.c:822
> 1 0x00005555556c8a9a in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4527
>
> Setting the window icon assumes there's always an SDL output window
> available, which isn't the case with when there's no video device,
> like via -nodefaults. So don't try to set a window icon when we don't
> have any outputs.
Hmm, I guess we can skip pretty much all of the init in case there are
no outputs:
@@ -794,6 +794,9 @@ void sdl_display_init(DisplayState *ds, int
full_screen, int no_frame)
}
}
sdl2_num_outputs = i;
+ if (sdl2_num_outputs == 0) {
+ return;
+ }
sdl2_console = g_new0(struct sdl2_console, sdl2_num_outputs);
for (i = 0; i < sdl2_num_outputs; i++) {
QemuConsole *con = qemu_console_lookup_by_index(i);
Maybe even move up the loop counting the outputs, so we can skip the
SDL_Init() call too. We don't get a empty window then.
cheers,
Gerd
next prev parent reply other threads:[~2016-06-01 6:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 20:56 [Qemu-devel] [PATCH] ui: sdl2: Fix crash with -nodefaults -sdl Cole Robinson
2016-05-31 21:49 ` Peter Maydell
2016-06-01 6:39 ` Gerd Hoffmann
2016-06-01 6:38 ` Gerd Hoffmann [this message]
2016-06-01 11:31 ` Cole Robinson
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=1464763097.8823.13.camel@redhat.com \
--to=kraxel@redhat.com \
--cc=crobinso@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.