diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-10-21 23:44:44 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-01-27 18:07:59 +0100 |
commit | 41ac54b253f41df924c350ef63564df8e1d8ad88 (patch) | |
tree | a6d8fdcb913b558c4f5ecc698bd82ae1a195705c /include | |
parent | 5ebd67030c4e4bc702d07a3e10c909be4520f170 (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/sysemu/char.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sysemu/char.h b/include/sysemu/char.h index b0b4231d4c..8bb94e5d6e 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -93,7 +93,6 @@ struct CharDriverState { const CharDriver *driver; QemuMutex chr_write_lock; CharBackend *be; - void *opaque; char *label; char *filename; int logfd; @@ -484,6 +483,7 @@ struct CharDriver { ChardevBackend *backend, ChardevReturn *ret, bool *be_opened, Error **errp); + size_t instance_size; int (*chr_write)(struct CharDriverState *s, const uint8_t *buf, int len); int (*chr_sync_read)(struct CharDriverState *s, |