[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/52] ui/console: use OBJECT_DEFINE_TYPE for QemuConsole
From: |
marcandre . lureau |
Subject: |
[PULL 17/52] ui/console: use OBJECT_DEFINE_TYPE for QemuConsole |
Date: |
Mon, 4 Sep 2023 15:52:14 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The following patch will move some object initialization to the
corresponding handlers.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-18-marcandre.lureau@redhat.com>
---
ui/console.c | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/ui/console.c b/ui/console.c
index 1336a1be6c..14fb38c661 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -125,6 +125,8 @@ struct QemuConsole {
QTAILQ_ENTRY(QemuConsole) next;
};
+OBJECT_DEFINE_TYPE(QemuConsole, qemu_console, QEMU_CONSOLE, OBJECT)
+
struct VCChardev {
Chardev parent;
QemuConsole *console;
@@ -1313,6 +1315,21 @@ static QemuConsole *new_console(console_type_t
console_type, uint32_t head)
return s;
}
+static void
+qemu_console_finalize(Object *obj)
+{
+}
+
+static void
+qemu_console_class_init(ObjectClass *oc, void *data)
+{
+}
+
+static void
+qemu_console_init(Object *obj)
+{
+}
+
#ifdef WIN32
void qemu_displaysurface_win32_set_handle(DisplaySurface *surface,
HANDLE h, uint32_t offset)
@@ -2646,13 +2663,6 @@ void qemu_chr_parse_vc(QemuOpts *opts, ChardevBackend
*backend, Error **errp)
}
}
-static const TypeInfo qemu_console_info = {
- .name = TYPE_QEMU_CONSOLE,
- .parent = TYPE_OBJECT,
- .instance_size = sizeof(QemuConsole),
- .class_size = sizeof(QemuConsoleClass),
-};
-
static void char_vc_class_init(ObjectClass *oc, void *data)
{
ChardevClass *cc = CHARDEV_CLASS(oc);
@@ -2678,10 +2688,3 @@ void qemu_console_early_init(void)
type_register(&char_vc_type_info);
}
}
-
-static void register_types(void)
-{
- type_register_static(&qemu_console_info);
-}
-
-type_init(register_types);
--
2.41.0
- [PULL 07/52] ui/console: call dpy_gfx_update() regardless of have_gfx, (continued)
- [PULL 07/52] ui/console: call dpy_gfx_update() regardless of have_gfx, marcandre . lureau, 2023/09/04
- [PULL 08/52] ui/console: drop have_gfx, marcandre . lureau, 2023/09/04
- [PULL 09/52] ui/console: get the DisplayState from new_console(), marcandre . lureau, 2023/09/04
- [PULL 10/52] ui/console: new_console() cannot fail, marcandre . lureau, 2023/09/04
- [PULL 11/52] ui/vc: VC always has a DisplayState now, marcandre . lureau, 2023/09/04
- [PULL 12/52] ui/vc: move VCChardev declaration at the top, marcandre . lureau, 2023/09/04
- [PULL 14/52] ui/vc: fold text_update_xy(), marcandre . lureau, 2023/09/04
- [PULL 13/52] ui/vc: replace variable with static text attributes default, marcandre . lureau, 2023/09/04
- [PULL 15/52] ui/vc: pass VCCharDev to VC-specific functions, marcandre . lureau, 2023/09/04
- [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 <=
- [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, 2023/09/04
- [PULL 28/52] ui/vc: move text fields to QemuTextConsole, marcandre . lureau, 2023/09/04