diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-12-08 17:47:17 +0300 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-01-31 13:01:46 +0400 |
commit | 9fa2f7a4ed2bd4db7de64374692385dd0852dbe7 (patch) | |
tree | 04ad19ff79ac3e0e66956c05ebd4e2511e44ab07 /qemu-char.c | |
parent | fa943b5ea07741139d5ec9d94710ad9e382ea356 (diff) |
char-ringbuf: 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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qemu-char.c b/qemu-char.c index fecebde87a..74e78b56d1 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3550,9 +3550,9 @@ static int ringbuf_chr_read(Chardev *chr, uint8_t *buf, int len) return i; } -static void ringbuf_chr_free(struct Chardev *chr) +static void char_ringbuf_finalize(Object *obj) { - RingBufChardev *d = RINGBUF_CHARDEV(chr); + RingBufChardev *d = RINGBUF_CHARDEV(obj); g_free(d->cbuf); } @@ -3982,7 +3982,6 @@ static void char_ringbuf_class_init(ObjectClass *oc, void *data) cc->open = qemu_chr_open_ringbuf; cc->chr_write = ringbuf_chr_write; - cc->chr_free = ringbuf_chr_free; } static const TypeInfo char_ringbuf_type_info = { @@ -3990,6 +3989,7 @@ static const TypeInfo char_ringbuf_type_info = { .parent = TYPE_CHARDEV, .class_init = char_ringbuf_class_init, .instance_size = sizeof(RingBufChardev), + .instance_finalize = char_ringbuf_finalize, }; /* Bug-compatibility: */ |