Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ui/vc: move cursor_timer initialization to QemuTextConsole class
The timer is only relevant when a text console exists.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-27-marcandre.lureau@redhat.com>
  • Loading branch information
elmarco committed Sep 4, 2023
1 parent cfde05d commit b97a76d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/console.c
Expand Up @@ -1399,6 +1399,10 @@ qemu_text_console_finalize(Object *obj)
static void
qemu_text_console_class_init(ObjectClass *oc, void *data)
{
if (!cursor_timer) {
cursor_timer = timer_new_ms(QEMU_CLOCK_REALTIME,
text_console_update_cursor, NULL);
}
}

static void
Expand Down Expand Up @@ -2144,8 +2148,6 @@ static DisplayState *get_alloc_displaystate(void)
{
if (!display_state) {
display_state = g_new0(DisplayState, 1);
cursor_timer = timer_new_ms(QEMU_CLOCK_REALTIME,
text_console_update_cursor, NULL);
}
return display_state;
}
Expand Down

0 comments on commit b97a76d

Please sign in to comment.