mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
char: add qemu_chr_free()
If a chardev is allowed to be created outside of QMP, then it must be also possible to free it. This is useful for ivshmem that creates chardev anonymously and must be able to free them. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
This commit is contained in:
parent
bbfc2efefe
commit
1ad78ea51a
2 changed files with 16 additions and 3 deletions
|
@ -3876,9 +3876,8 @@ void qemu_chr_fe_release(CharDriverState *s)
|
|||
s->avail_connections++;
|
||||
}
|
||||
|
||||
void qemu_chr_delete(CharDriverState *chr)
|
||||
void qemu_chr_free(CharDriverState *chr)
|
||||
{
|
||||
QTAILQ_REMOVE(&chardevs, chr, next);
|
||||
if (chr->chr_close) {
|
||||
chr->chr_close(chr);
|
||||
}
|
||||
|
@ -3888,6 +3887,12 @@ void qemu_chr_delete(CharDriverState *chr)
|
|||
g_free(chr);
|
||||
}
|
||||
|
||||
void qemu_chr_delete(CharDriverState *chr)
|
||||
{
|
||||
QTAILQ_REMOVE(&chardevs, chr, next);
|
||||
qemu_chr_free(chr);
|
||||
}
|
||||
|
||||
ChardevInfoList *qmp_query_chardev(Error **errp)
|
||||
{
|
||||
ChardevInfoList *chr_list = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue