qemu-char: introduce qemu_chr_alloc

The next patch will modify this function to initialize state that is
common to all backends.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Paolo Bonzini 2014-06-18 08:43:55 +02:00 committed by Luiz Capitulino
parent 751751732c
commit db39fcf1f6
6 changed files with 32 additions and 17 deletions

View file

@ -574,7 +574,7 @@ CharDriverState *chr_baum_init(void)
int tty;
baum = g_malloc0(sizeof(BaumDriverState));
baum->chr = chr = g_malloc0(sizeof(CharDriverState));
baum->chr = chr = qemu_chr_alloc();
chr->opaque = baum;
chr->chr_write = baum_write;