diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-12-08 16:52:38 +0300 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-01-31 13:01:46 +0400 |
commit | fa943b5ea07741139d5ec9d94710ad9e382ea356 (patch) | |
tree | 5642c63b930fad63b05c7d31612a0279744675d7 /qemu-char.c | |
parent | 2c3a5dcbf8c9254835c76e867c9a560fec0753b9 (diff) |
char-pty: convert to finalize
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r-- | qemu-char.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/qemu-char.c b/qemu-char.c index a00bbb0a1c..fecebde87a 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1659,9 +1659,10 @@ static void pty_chr_state(Chardev *chr, int connected) } } -static void pty_chr_free(struct Chardev *chr) +static void char_pty_finalize(Object *obj) { - PtyChardev *s = PTY_CHARDEV(chr); + Chardev *chr = CHARDEV(obj); + PtyChardev *s = PTY_CHARDEV(obj); qemu_mutex_lock(&chr->chr_write_lock); pty_chr_state(chr, 0); @@ -1718,13 +1719,13 @@ static void char_pty_class_init(ObjectClass *oc, void *data) cc->chr_write = char_pty_chr_write; cc->chr_update_read_handler = pty_chr_update_read_handler; cc->chr_add_watch = pty_chr_add_watch; - cc->chr_free = pty_chr_free; } static const TypeInfo char_pty_type_info = { .name = TYPE_CHARDEV_PTY, .parent = TYPE_CHARDEV, .instance_size = sizeof(PtyChardev), + .instance_finalize = char_pty_finalize, .class_init = char_pty_class_init, }; |