mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
char: Detect chardev release by NULL handlers as well as NULL opaque
Juan says he prefers these extra checks to ensure a user of a chardev is releasing it. Requested-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
This commit is contained in:
parent
d5b27167e1
commit
da7d998bbb
1 changed files with 1 additions and 1 deletions
|
@ -197,7 +197,7 @@ void qemu_chr_add_handlers(CharDriverState *s,
|
|||
IOEventHandler *fd_event,
|
||||
void *opaque)
|
||||
{
|
||||
if (!opaque) {
|
||||
if (!opaque && !fd_can_read && !fd_read && !fd_event) {
|
||||
/* chr driver being released. */
|
||||
++s->avail_connections;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue