summaryrefslogtreecommitdiff
path: root/hw/virtio-console.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/virtio-console.c')
-rw-r--r--hw/virtio-console.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index be5955868f..6b5237b3ce 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -82,7 +82,11 @@ static int virtconsole_exitfn(VirtIOSerialPort *port)
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
if (vcon->chr) {
- qemu_chr_close(vcon->chr);
+ /*
+ * Instead of closing the chardev, free it so it can be used
+ * for other purposes.
+ */
+ qemu_chr_add_handlers(vcon->chr, NULL, NULL, NULL, NULL);
}
return 0;