]> git.proxmox.com Git - mirror_qemu.git/commit
chardev: fix qemu_chr_open_fd() with fd_in==fd_out
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 23 Jul 2021 09:59:50 +0000 (13:59 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 5 Aug 2021 12:15:33 +0000 (16:15 +0400)
commit733ba020846ccd21d832f2e9b62387a86c5ab8f1
tree3ae53a9587fed486137cee0cd6d13e9fbe3edf02
parent46fe3ff6ea3e7a642b8545c0322ef5df873bd560
chardev: fix qemu_chr_open_fd() with fd_in==fd_out

The "serial" chardev calls qemu_chr_open_fd() with the same fd. This
may lead to double-close as each QIOChannel owns the fd.

Instead, share the reference to the same QIOChannel.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
chardev/char-fd.c