diff options
Diffstat (limited to 'qemu-char.c')
-rw-r--r-- | qemu-char.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qemu-char.c b/qemu-char.c index cad35d7717..c4557c30d0 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -197,6 +197,10 @@ void qemu_chr_add_handlers(CharDriverState *s, IOEventHandler *fd_event, void *opaque) { + if (!opaque) { + /* chr driver being released. */ + s->assigned = 0; + } s->chr_can_read = fd_can_read; s->chr_read = fd_read; s->chr_event = fd_event; |