aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-12-08 16:50:26 +0300
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-01-31 13:01:46 +0400
commit819aad230a50e9d5c9814f9390ef8e19f1f24c48 (patch)
treeff7cf2aab08e33302e154cef1cfd3dc2202f37c2 /qemu-char.c
parent980d0414ce63ac61288c8b56a52729e64fd011a8 (diff)
char-udp: 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.c7
1 files 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,
};