From 41ac54b253f41df924c350ef63564df8e1d8ad88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 21 Oct 2016 23:44:44 +0300 Subject: char: allocate CharDriverState as a single object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- gdbstub.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gdbstub.c') diff --git a/gdbstub.c b/gdbstub.c index f4e36a9cd3..1a30f5ab58 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -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, }; -- cgit v1.2.1