[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/37] char: free MuxDriver when closing
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH 20/37] char: free MuxDriver when closing |
Date: |
Tue, 19 Jul 2016 12:54:15 +0400 |
From: Marc-André Lureau <address@hidden>
Similarly to other chr_close callbacks, free char type specific data.
Signed-off-by: Marc-André Lureau <address@hidden>
---
qemu-char.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/qemu-char.c b/qemu-char.c
index 6ed6dd6..e276485 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -786,6 +786,14 @@ static GSource *mux_chr_add_watch(CharDriverState *s,
GIOCondition cond)
return d->drv->chr_add_watch(d->drv, cond);
}
+static void mux_chr_close(struct CharDriverState *chr)
+{
+ MuxDriver *d = chr->opaque;
+
+ /* is more cleanup needed? */
+ g_free(d);
+}
+
static CharDriverState *qemu_chr_open_mux(const char *id,
ChardevBackend *backend,
ChardevReturn *ret, Error **errp)
@@ -810,6 +818,7 @@ static CharDriverState *qemu_chr_open_mux(const char *id,
chr->opaque = d;
d->drv = drv;
d->focus = -1;
+ chr->chr_close = mux_chr_close;
chr->chr_write = mux_chr_write;
chr->chr_update_read_handler = mux_chr_update_read_handler;
chr->chr_accept_input = mux_chr_accept_input;
--
2.9.0
- Re: [Qemu-devel] [PATCH 14/37] numa: do not leak NumaOptions, (continued)
[Qemu-devel] [PATCH 19/37] char: disconnect peer when qemu_chr_free(), marcandre . lureau, 2016/07/19
[Qemu-devel] [PATCH 20/37] char: free MuxDriver when closing,
marcandre . lureau <=
[Qemu-devel] [PATCH 21/37] tests: fix qom-test leaks, marcandre . lureau, 2016/07/19
[Qemu-devel] [PATCH 22/37] pc: free i8259, marcandre . lureau, 2016/07/19
[Qemu-devel] [PATCH 23/37] pci-bus: do not allocate and leak bsel, marcandre . lureau, 2016/07/19
[Qemu-devel] [PATCH 24/37] pc: keep gsi reference, marcandre . lureau, 2016/07/19