From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: qemu-devel@nongnu.orgqemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/2][RESEND] vl: initialize all displaystates
Date: Fri, 4 Mar 2011 03:48:01 +0300 [thread overview]
Message-ID: <1299199682-22041-1-git-send-email-dbaryshkov@gmail.com> (raw)
Init not only first displaystate, but all. Otherwise machines with
multiple display devices (e.g. tosa, as it exists now) will just
segfault on ds switch.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
vl.c | 104 +++++++++++++++++++++++++++++++++---------------------------------
1 files changed, 52 insertions(+), 52 deletions(-)
Basically this patch is equal to:
@@ -3009,9 +3009,7 @@ int main(int argc, char **argv, char **envp)
net_check_clients();
- /* just use the first displaystate for the moment */
- ds = get_displaystate();
-
+ for (ds = get_displaystate(); ds; ds = ds->next) {
if (using_spice)
display_remote++;
if (display_type == DT_DEFAULT && !display_remote) {
@@ -3077,7 +3075,9 @@ int main(int argc, char **argv, char **envp)
nographic_timer = qemu_new_timer(rt_clock, nographic_update, NULL);
qemu_mod_timer(nographic_timer, qemu_get_clock(rt_clock));
}
- text_consoles_set_display(ds);
+ }
+
+ text_consoles_set_display(get_displaystate());
if (gdbstub_dev && gdbserver_start(gdbstub_dev) < 0) {
fprintf(stderr, "qemu: could not open gdbserver on device '%s'\n",
diff --git a/vl.c b/vl.c
index 14255c4..b8cd455 100644
--- a/vl.c
+++ b/vl.c
@@ -3009,75 +3009,75 @@ int main(int argc, char **argv, char **envp)
net_check_clients();
- /* just use the first displaystate for the moment */
- ds = get_displaystate();
-
- if (using_spice)
- display_remote++;
- if (display_type == DT_DEFAULT && !display_remote) {
+ for (ds = get_displaystate(); ds; ds = ds->next) {
+ if (using_spice)
+ display_remote++;
+ if (display_type == DT_DEFAULT && !display_remote) {
#if defined(CONFIG_SDL) || defined(CONFIG_COCOA)
- display_type = DT_SDL;
+ display_type = DT_SDL;
#else
- vnc_display = "localhost:0,to=99";
- show_vnc_port = 1;
+ vnc_display = "localhost:0,to=99";
+ show_vnc_port = 1;
#endif
- }
-
+ }
+
- /* init local displays */
- switch (display_type) {
- case DT_NOGRAPHIC:
- break;
+ /* init local displays */
+ switch (display_type) {
+ case DT_NOGRAPHIC:
+ break;
#if defined(CONFIG_CURSES)
- case DT_CURSES:
- curses_display_init(ds, full_screen);
- break;
+ case DT_CURSES:
+ curses_display_init(ds, full_screen);
+ break;
#endif
#if defined(CONFIG_SDL)
- case DT_SDL:
- sdl_display_init(ds, full_screen, no_frame);
- break;
+ case DT_SDL:
+ sdl_display_init(ds, full_screen, no_frame);
+ break;
#elif defined(CONFIG_COCOA)
- case DT_SDL:
- cocoa_display_init(ds, full_screen);
- break;
+ case DT_SDL:
+ cocoa_display_init(ds, full_screen);
+ break;
#endif
- default:
- break;
- }
+ default:
+ break;
+ }
- /* init remote displays */
- if (vnc_display) {
- vnc_display_init(ds);
- if (vnc_display_open(ds, vnc_display) < 0)
- exit(1);
+ /* init remote displays */
+ if (vnc_display) {
+ vnc_display_init(ds);
+ if (vnc_display_open(ds, vnc_display) < 0)
+ exit(1);
- if (show_vnc_port) {
- printf("VNC server running on `%s'\n", vnc_display_local_addr(ds));
+ if (show_vnc_port) {
+ printf("VNC server running on `%s'\n", vnc_display_local_addr(ds));
+ }
}
- }
#ifdef CONFIG_SPICE
- if (using_spice && !qxl_enabled) {
- qemu_spice_display_init(ds);
- }
+ if (using_spice && !qxl_enabled) {
+ qemu_spice_display_init(ds);
+ }
#endif
- /* display setup */
- dpy_resize(ds);
- dcl = ds->listeners;
- while (dcl != NULL) {
- if (dcl->dpy_refresh != NULL) {
- ds->gui_timer = qemu_new_timer(rt_clock, gui_update, ds);
- qemu_mod_timer(ds->gui_timer, qemu_get_clock(rt_clock));
- break;
+ /* display setup */
+ dpy_resize(ds);
+ dcl = ds->listeners;
+ while (dcl != NULL) {
+ if (dcl->dpy_refresh != NULL) {
+ ds->gui_timer = qemu_new_timer(rt_clock, gui_update, ds);
+ qemu_mod_timer(ds->gui_timer, qemu_get_clock(rt_clock));
+ break;
+ }
+ dcl = dcl->next;
+ }
+ if (ds->gui_timer == NULL) {
+ nographic_timer = qemu_new_timer(rt_clock, nographic_update, NULL);
+ qemu_mod_timer(nographic_timer, qemu_get_clock(rt_clock));
}
- dcl = dcl->next;
- }
- if (ds->gui_timer == NULL) {
- nographic_timer = qemu_new_timer(rt_clock, nographic_update, NULL);
- qemu_mod_timer(nographic_timer, qemu_get_clock(rt_clock));
}
- text_consoles_set_display(ds);
+
+ text_consoles_set_display(get_displaystate());
if (gdbstub_dev && gdbserver_start(gdbstub_dev) < 0) {
fprintf(stderr, "qemu: could not open gdbserver on device '%s'\n",
--
1.7.2.3
next reply other threads:[~2011-03-04 0:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-04 0:48 Dmitry Eremin-Solenikov [this message]
2011-03-04 0:48 ` [Qemu-devel] [PATCH 2/2][RESEND] tc6393xb: add support for invalidate display callback Dmitry Eremin-Solenikov
2011-03-10 4:43 ` [Qemu-devel] [PATCH 1/2][RESEND] vl: initialize all displaystates andrzej zaborowski
2011-03-10 8:18 ` Dmitry Eremin-Solenikov
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=1299199682-22041-1-git-send-email-dbaryshkov@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=qemu-devel@nongnu.orgqemu-devel \
/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).