aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-12-08 19:35:01 +0300
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-01-31 13:01:47 +0400
commit8cddc46990ab0310af9fb148143326f832802fca (patch)
treef2b2f844c51b9aef0c08e389f6ce8f599cab1c7e
parent7f2fe073f3bbe4ecda7afd5a14c24736d19e921a (diff)
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>
-rw-r--r--include/sysemu/char.h8
-rw-r--r--qemu-char.c10
2 files changed, 1 insertions, 17 deletions
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index da0e7dd494..5e5594f305 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -185,13 +185,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:
*
* Ask the backend to override its normal echo setting. This only really
@@ -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);
diff --git a/qemu-char.c b/qemu-char.c
index 3d0d690999..c239418c25 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -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)