mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
char: allocate CharDriverState as a single object
Use a single allocation for CharDriverState, this avoids extra allocations & pointers, and is a step towards more object-oriented CharDriver. Gtk console is a bit peculiar, gd_vc_chr_set_echo() used to have a temporary VirtualConsole to save the echo bit. Instead now, we consider whether vcd->console is set or not, and restore the echo bit saved in VCDriverState when calling gd_vc_vte_init(). The casts added are temporary, they are replaced with QOM type-safe macros in a later patch in this series. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
5ebd67030c
commit
41ac54b253
10 changed files with 230 additions and 214 deletions
|
|
@ -1733,6 +1733,7 @@ int gdbserver_start(const char *device)
|
|||
CharDriverState *mon_chr;
|
||||
ChardevCommon common = { 0 };
|
||||
static const CharDriver driver = {
|
||||
.instance_size = sizeof(CharDriverState),
|
||||
.kind = -1,
|
||||
.chr_write = gdb_monitor_write,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue