[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 22/52] ui/console: remove new_console()
From: |
marcandre . lureau |
Subject: |
[PULL 22/52] ui/console: remove new_console() |
Date: |
Mon, 4 Sep 2023 15:52:19 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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>
---
ui/console.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/ui/console.c b/ui/console.c
index 02a24eaf5d..e0e4f980d7 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);
}
--
2.41.0
- [PULL 16/52] ui/vc: move VCCharDev specific fields out of QemuConsole, (continued)
- [PULL 16/52] ui/vc: move VCCharDev specific fields out of QemuConsole, marcandre . lureau, 2023/09/04
- [PULL 17/52] ui/console: use OBJECT_DEFINE_TYPE for QemuConsole, marcandre . lureau, 2023/09/04
- [PULL 18/52] ui/console: change new_console() to use object initialization, marcandre . lureau, 2023/09/04
- [PULL 20/52] ui/console: instantiate a specific console type, marcandre . lureau, 2023/09/04
- [PULL 19/52] ui/console: introduce different console objects, marcandre . lureau, 2023/09/04
- [PULL 21/52] ui/console: register the console from qemu_console_init(), marcandre . lureau, 2023/09/04
- [PULL 23/52] ui/console: specialize console_lookup_unused(), marcandre . lureau, 2023/09/04
- [PULL 26/52] ui/vc: move cursor_timer initialization to QemuTextConsole class, marcandre . lureau, 2023/09/04
- [PULL 27/52] ui/console: free more QemuConsole resources, marcandre . lureau, 2023/09/04
- [PULL 24/52] ui/console: update the head from unused QemuConsole, marcandre . lureau, 2023/09/04
- [PULL 22/52] ui/console: remove new_console(),
marcandre . lureau <=
- [PULL 28/52] ui/vc: move text fields to QemuTextConsole, marcandre . lureau, 2023/09/04
- [PULL 25/52] ui/console: allocate ui_timer in QemuConsole, marcandre . lureau, 2023/09/04
- [PULL 29/52] ui/console: move graphic fields to QemuGraphicConsole, marcandre . lureau, 2023/09/04
- [PULL 30/52] ui/vc: fold text_console_do_init() in vc_chr_open(), marcandre . lureau, 2023/09/04
- [PULL 31/52] ui/vc: move some text console initialization to qom handlers, marcandre . lureau, 2023/09/04
- [PULL 32/52] ui/console: simplify getting active_console size, marcandre . lureau, 2023/09/04
- [PULL 35/52] ui/console: declare console types in console.h, marcandre . lureau, 2023/09/04
- [PULL 37/52] ui/console: rename vga_ functions with qemu_console_, marcandre . lureau, 2023/09/04
- [PULL 33/52] ui/console: remove need for g_width/g_height, marcandre . lureau, 2023/09/04
- [PULL 34/52] ui/vc: use common text console surface creation, marcandre . lureau, 2023/09/04