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 <jian.jun.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Jian Jun Chen 2018-04-16 12:26:13 +08:00 committed by lijinxia
parent 1bfcdaec81
commit 1577a258a9

View File

@ -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) {