acrn-hypervisor/devicemodel/hw
yuhong.tao@intel.com c4161c8784 dm: uart: fix UOS console output to stdin
At devicemodel/hw/uart_core.c, struct ttyfd has only one file
descriptor for uart backend device, that is OK if DM uart open
a tty characteor device under /dev/ for reading, writing and
terminal operating.

When use stdio as backend tty device, there are 2 fds, stdin/stdout.
DM should read from 'stdin' and output to 'stdout'. But ttyfd just
has one fd, and is only for 'stdin', so dm has to output to stdin,
too, not to stdout.

That cause a problem: if use stdio for uart backend, you can't
redirect UOS console to any other files. Because stdout is not used.

We hope to store information from VM console to system journal,
when UOS is launched by Acrnd automatically. The systemd need to
redirect stdout of dm to system journal files, but it can't be done.

So we can split the 'fd' of struct ttyfd to 'fd_in' & 'fd_out'.
they are same when use tty device; And they are different when use
stdio, 'fd_in' is for stdin and 'fd_out' is for stdout.

Tracked-On: #1759
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Like Yan <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-11-08 15:14:15 +08:00
..
pci DM NPK: unmap the MMIO in pci_npk_deinit 2018-11-08 09:06:17 +08:00
platform IOC mediator: fix wakeup reason issue when UOS resuming 2018-11-06 16:18:35 +08:00
block_if.c dm: storage: banned functions replace 2018-10-17 16:22:00 +08:00
uart_core.c dm: uart: fix UOS console output to stdin 2018-11-08 15:14:15 +08:00
usb_core.c DM USB: xHCI: support multiple hubs in single layer 2018-10-19 22:39:50 +08:00