From 1577a258a95c3d3706a7e49ef8c7fc66b2fe8a93 Mon Sep 17 00:00:00 2001 From: Jian Jun Chen Date: Mon, 16 Apr 2018 12:26:13 +0800 Subject: [PATCH] dm: virtio-console: Fix the bug that ports cannot work If multiple ports are defined in the command line, is_console is not set to a correct value for non-console ports when the definition of this non-console port is following the definition of a console port. For example in below definition, the second port is configured as console port which is not correct: -s 5,virtio-console,@pty:pty_port,file:file_port=/home/root/test1 Signed-off-by: Jian Jun Chen Reviewed-by: Zhao Yakui Acked-by: Anthony Xu --- hw/pci/virtio/virtio_console.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/virtio/virtio_console.c b/hw/pci/virtio/virtio_console.c index e7de20b7c..209cf27a4 100644 --- a/hw/pci/virtio/virtio_console.c +++ b/hw/pci/virtio/virtio_console.c @@ -890,7 +890,8 @@ virtio_console_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) if (backend[0] == '@') { is_console = true; backend++; - } + } else + is_console = false; be_type = virtio_console_get_be_type(backend); if (be_type == VIRTIO_CONSOLE_BE_INVALID) {