cloud-hypervisor/vmm/src
William Douglas 48963e322a Enable pty console
Add the ability for cloud-hypervisor to create, manage and monitor a
pty for serial and/or console I/O from a user. The reasoning for
having cloud-hypervisor create the ptys is so that clients, libvirt
for example, could exit and later re-open the pty without causing I/O
issues. If the clients were responsible for creating the pty, when
they exit the main pty fd would close and cause cloud-hypervisor to
get I/O errors on writes.

Ideally the main and subordinate pty fds would be kept in the main
vmm's Vm structure. However, because the device manager owns parsing
the configuration for the serial and console devices, the information
is instead stored in new fields under the DeviceManager structure
directly.

From there hooking up the main fd is intended to look as close to
handling stdin and stdout on the tty as possible (there is some future
work ahead for perhaps moving support for the pty into the
vmm_sys_utils crate).

The main fd is used for reading user input and writing to output of
the Vm device. The subordinate fd is used to setup raw mode and it is
kept open in order to avoid I/O errors when clients open and close the
pty device.

The ability to handle multiple inputs as part of this change is
intentional. The current code allows serial and console ptys to be
created and both be used as input. There was an implementation gap
though with the queue_input_bytes needing to be modified so the pty
handlers for serial and console could access the methods on the serial
and console structures directly. Without this change only a single
input source could be processed as the console would switch based on
its input type (this is still valid for tty and isn't otherwise
modified).

Signed-off-by: William Douglas <william.r.douglas@gmail.com>
2021-02-09 10:03:28 +00:00
..
api Enable pty console 2021-02-09 10:03:28 +00:00
acpi.rs vmm: acpi: Support compiling ACPI code on aarch64 2021-01-26 15:19:02 +08:00
config.rs Enable pty console 2021-02-09 10:03:28 +00:00
cpu.rs vmm: acpi: Remove incorrect return statement 2021-01-28 14:30:34 +01:00
device_manager.rs Enable pty console 2021-02-09 10:03:28 +00:00
device_tree.rs vmm: Remove mmio and pci differentiation 2020-10-19 14:58:48 +01:00
interrupt.rs hypervisor, vmm: Implement MsiInterruptOps for mshv 2020-12-09 14:55:20 +01:00
lib.rs Enable pty console 2021-02-09 10:03:28 +00:00
memory_manager.rs vmm: Support configurable huge pages in MemoryManager 2021-02-05 09:24:02 +00:00
migration.rs vmm: Get and set clock during pause and resume operations 2020-06-23 14:36:01 +01:00
seccomp_filters.rs Enable pty console 2021-02-09 10:03:28 +00:00
vm.rs Enable pty console 2021-02-09 10:03:28 +00:00