char: remove chr_free

Now it uses Object instance_finalize instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Marc-André Lureau 2016-12-08 19:35:01 +03:00
parent 7f2fe073f3
commit 8cddc46990
2 changed files with 1 additions and 17 deletions

View File

@ -184,13 +184,6 @@ Chardev *qemu_chr_new_noreplay(const char *label, const char *filename);
*/
void qemu_chr_delete(Chardev *chr);
/**
* @qemu_chr_free:
*
* Destroy a character backend.
*/
void qemu_chr_free(Chardev *chr);
/**
* @qemu_chr_fe_set_echo:
*
@ -496,7 +489,6 @@ typedef struct ChardevClass {
int (*set_msgfds)(Chardev *s, int *fds, int num);
int (*chr_add_client)(Chardev *chr, int fd);
int (*chr_wait_connected)(Chardev *chr, Error **errp);
void (*chr_free)(Chardev *chr);
void (*chr_disconnect)(Chardev *chr);
void (*chr_accept_input)(Chardev *chr);
void (*chr_set_echo)(Chardev *chr, bool echo);

View File

@ -4371,18 +4371,10 @@ void qemu_chr_fe_disconnect(CharBackend *be)
}
}
void qemu_chr_free(Chardev *chr)
{
if (CHARDEV_GET_CLASS(chr)->chr_free) {
CHARDEV_GET_CLASS(chr)->chr_free(chr);
}
object_unref(OBJECT(chr));
}
void qemu_chr_delete(Chardev *chr)
{
QTAILQ_REMOVE(&chardevs, chr, next);
qemu_chr_free(chr);
object_unref(OBJECT(chr));
}
ChardevInfoList *qmp_query_chardev(Error **errp)