aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-06-04 11:46:35 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-11-01 13:10:05 +0100
commit87e487a14bd9f3fb4a2b27179377e011bdda7c51 (patch)
tree9cc8a4d4ad326eb7b242fc72e8c2021fffb4b059 /vl.c
parent286d52ebfc0d0d53c2a878e454292fea14bad41b (diff)
console: QLIST-ify display change listeners.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/vl.c b/vl.c
index 5513d1518e..427e8a2d40 100644
--- a/vl.c
+++ b/vl.c
@@ -1359,15 +1359,14 @@ static void gui_update(void *opaque)
{
uint64_t interval = GUI_REFRESH_INTERVAL;
DisplayState *ds = opaque;
- DisplayChangeListener *dcl = ds->listeners;
+ DisplayChangeListener *dcl;
dpy_refresh(ds);
- while (dcl != NULL) {
+ QLIST_FOREACH(dcl, &ds->listeners, next) {
if (dcl->gui_timer_interval &&
dcl->gui_timer_interval < interval)
interval = dcl->gui_timer_interval;
- dcl = dcl->next;
}
qemu_mod_timer(ds->gui_timer, interval + qemu_get_clock_ms(rt_clock));
}
@@ -3846,14 +3845,12 @@ int main(int argc, char **argv, char **envp)
/* display setup */
dpy_resize(ds);
- dcl = ds->listeners;
- while (dcl != NULL) {
+ QLIST_FOREACH(dcl, &ds->listeners, next) {
if (dcl->dpy_refresh != NULL) {
ds->gui_timer = qemu_new_timer_ms(rt_clock, gui_update, ds);
qemu_mod_timer(ds->gui_timer, qemu_get_clock_ms(rt_clock));
break;
}
- dcl = dcl->next;
}
text_consoles_set_display(ds);