mirror of https://github.com/xemu-project/xemu.git
char-stdio: convert to finalize
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
c930572883
commit
4d833ada52
|
@ -1422,10 +1422,10 @@ static void qemu_chr_set_echo_stdio(Chardev *chr, bool echo)
|
||||||
tcsetattr (0, TCSANOW, &tty);
|
tcsetattr (0, TCSANOW, &tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qemu_chr_free_stdio(struct Chardev *chr)
|
static void char_stdio_finalize(Object *obj)
|
||||||
{
|
{
|
||||||
term_exit();
|
term_exit();
|
||||||
fd_chr_free(chr);
|
fd_chr_free(CHARDEV(chr));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qemu_chr_open_stdio(Chardev *chr,
|
static void qemu_chr_open_stdio(Chardev *chr,
|
||||||
|
@ -3859,7 +3859,6 @@ static void char_stdio_class_init(ObjectClass *oc, void *data)
|
||||||
cc->chr_free = win_stdio_free;
|
cc->chr_free = win_stdio_free;
|
||||||
#else
|
#else
|
||||||
cc->chr_set_echo = qemu_chr_set_echo_stdio;
|
cc->chr_set_echo = qemu_chr_set_echo_stdio;
|
||||||
cc->chr_free = qemu_chr_free_stdio;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3869,6 +3868,7 @@ static const TypeInfo char_stdio_type_info = {
|
||||||
.parent = TYPE_CHARDEV_WIN_STDIO,
|
.parent = TYPE_CHARDEV_WIN_STDIO,
|
||||||
#else
|
#else
|
||||||
.parent = TYPE_CHARDEV_FD,
|
.parent = TYPE_CHARDEV_FD,
|
||||||
|
.instance_finalize = char_stdio_finalize,
|
||||||
#endif
|
#endif
|
||||||
.class_init = char_stdio_class_init,
|
.class_init = char_stdio_class_init,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue