From: Cole Robinson <crobinso@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] ui: sdl2: Fix crash with -nodefaults -sdl
Date: Wed, 1 Jun 2016 07:31:51 -0400 [thread overview]
Message-ID: <2434cfba-cbc2-3b57-f326-b40e89add3e4@redhat.com> (raw)
In-Reply-To: <1464763097.8823.13.camel@redhat.com>
On 06/01/2016 02:38 AM, Gerd Hoffmann wrote:
> 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.
>
Works for me, I figured there was a better approach to handle -sdl + no
display device. If you send a patch I'll test it
Thanks,
Cole
prev parent reply other threads:[~2016-06-01 11:32 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
2016-06-01 11:31 ` Cole Robinson [this message]
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=2434cfba-cbc2-3b57-f326-b40e89add3e4@redhat.com \
--to=crobinso@redhat.com \
--cc=kraxel@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 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).