diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-08-30 13:37:56 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-09-04 13:48:19 +0400 |
commit | 34b7751574ebac7e19bfdb3ed0f91550c5ed171b (patch) | |
tree | 1476705ab13be25bd525647218d1ac3d927ac59d /ui | |
parent | ba0ec5c2931cd6efafc92bde3bd8fc3f99594fd3 (diff) | |
download | qemu-34b7751574ebac7e19bfdb3ed0f91550c5ed171b.zip qemu-34b7751574ebac7e19bfdb3ed0f91550c5ed171b.tar.gz qemu-34b7751574ebac7e19bfdb3ed0f91550c5ed171b.tar.bz2 |
ui/console: remove new_console()
The constructor helper isn't of much used now.
"head" is only specified for graphic console (and default to 0), and we
are going to move it to QemuGraphicConsole next.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-23-marcandre.lureau@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/console.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/ui/console.c b/ui/console.c index 02a24ea..e0e4f98 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1414,16 +1414,6 @@ qemu_fixed_text_console_init(Object *obj) { } -static QemuConsole *new_console(const char *typename, - uint32_t head) -{ - QemuConsole *c = QEMU_CONSOLE(object_new(typename)); - - c->head = head; - - return c; -} - #ifdef WIN32 void qemu_displaysurface_win32_set_handle(DisplaySurface *surface, HANDLE h, uint32_t offset) @@ -2163,7 +2153,7 @@ DisplayState *init_displaystate(void) QemuConsole *con; QTAILQ_FOREACH(con, &consoles, next) { - /* Hook up into the qom tree here (not in new_console()), once + /* Hook up into the qom tree here (not in object_new()), once * all QemuConsoles are created and the order / numbering * doesn't change any more */ name = g_strdup_printf("console[%d]", con->index); @@ -2201,7 +2191,8 @@ QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, height = qemu_console_get_height(s, 0); } else { trace_console_gfx_new(); - s = new_console(TYPE_QEMU_GRAPHIC_CONSOLE, head); + s = (QemuConsole *)object_new(TYPE_QEMU_GRAPHIC_CONSOLE); + s->head = head; s->ui_timer = timer_new_ms(QEMU_CLOCK_REALTIME, dpy_set_ui_info_timer, s); } @@ -2578,9 +2569,9 @@ static void vc_chr_open(Chardev *chr, trace_console_txt_new(width, height); if (width == 0 || height == 0) { - s = new_console(TYPE_QEMU_TEXT_CONSOLE, 0); + s = (QemuConsole *)object_new(TYPE_QEMU_TEXT_CONSOLE); } else { - s = new_console(TYPE_QEMU_FIXED_TEXT_CONSOLE, 0); + s = (QemuConsole *)object_new(TYPE_QEMU_FIXED_TEXT_CONSOLE); s->scanout.kind = SCANOUT_SURFACE; s->surface = qemu_create_displaysurface(width, height); } |