Skip to content

Commit

Permalink
char-udp: convert to finalize
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
  • Loading branch information
elmarco committed Jan 31, 2017
1 parent 980d041 commit 819aad2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions qemu-char.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
};

Expand Down

0 comments on commit 819aad2

Please sign in to comment.