From 819aad230a50e9d5c9814f9390ef8e19f1f24c48 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 8 Dec 2016 16:50:26 +0300 Subject: [PATCH] char-udp: convert to finalize MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake --- qemu-char.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 91ca4cb083..1c4fcf3a6e 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2779,9 +2779,10 @@ static void udp_chr_update_read_handler(Chardev *chr, } } -static void udp_chr_free(Chardev *chr) +static void char_udp_finalize(Object *obj) { - UdpChardev *s = UDP_CHARDEV(chr); + Chardev *chr = CHARDEV(obj); + UdpChardev *s = UDP_CHARDEV(obj); remove_fd_in_watch(chr); if (s->ioc) { @@ -4975,13 +4976,13 @@ static void char_udp_class_init(ObjectClass *oc, void *data) cc->open = qmp_chardev_open_udp; cc->chr_write = udp_chr_write; cc->chr_update_read_handler = udp_chr_update_read_handler; - cc->chr_free = udp_chr_free; } static const TypeInfo char_udp_type_info = { .name = TYPE_CHARDEV_UDP, .parent = TYPE_CHARDEV, .instance_size = sizeof(UdpChardev), + .instance_finalize = char_udp_finalize, .class_init = char_udp_class_init, }; -- 2.11.0