mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
ui/console: use OBJECT_DEFINE_TYPE for QemuConsole
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>
This commit is contained in:
parent
6505fd8d23
commit
e265917c77
1 changed files with 17 additions and 14 deletions
31
ui/console.c
31
ui/console.c
|
@ -125,6 +125,8 @@ struct QemuConsole {
|
||||||
QTAILQ_ENTRY(QemuConsole) next;
|
QTAILQ_ENTRY(QemuConsole) next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
OBJECT_DEFINE_TYPE(QemuConsole, qemu_console, QEMU_CONSOLE, OBJECT)
|
||||||
|
|
||||||
struct VCChardev {
|
struct VCChardev {
|
||||||
Chardev parent;
|
Chardev parent;
|
||||||
QemuConsole *console;
|
QemuConsole *console;
|
||||||
|
@ -1313,6 +1315,21 @@ static QemuConsole *new_console(console_type_t console_type, uint32_t head)
|
||||||
return s;
|
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
|
#ifdef WIN32
|
||||||
void qemu_displaysurface_win32_set_handle(DisplaySurface *surface,
|
void qemu_displaysurface_win32_set_handle(DisplaySurface *surface,
|
||||||
HANDLE h, uint32_t offset)
|
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)
|
static void char_vc_class_init(ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||||
|
@ -2678,10 +2688,3 @@ void qemu_console_early_init(void)
|
||||||
type_register(&char_vc_type_info);
|
type_register(&char_vc_type_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void register_types(void)
|
|
||||||
{
|
|
||||||
type_register_static(&qemu_console_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(register_types);
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue