From a7b6a1c897205d8320482eb506167c5df66647b2 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 9 Mar 2020 13:16:46 -0700 Subject: arch, main: add virtio-console parsing and creation This allows the creation of virtio-console devices using the new hardware=virtio-console parameter to the --serial option. Also add support for the serial earlycon option, which allows using virtio-console as the main console device with a traditional serial device as the early console. This allows logging during early boot before PCI device discovery (when virtio-console devices are set up). BUG=chromium:1059924 TEST=crosvm run -r vm_rootfs.img \ --serial hardware=serial,type=stdout,console=false,earlycon=true \ --serial hardware=virtio-console,type=stdout,console=true,stdin=true \ vm_kernel Change-Id: Iff48800272b154d49b1da00f3914799089268afe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2127322 Reviewed-by: Zach Reizner Tested-by: kokoro Commit-Queue: Daniel Verkamp --- src/crosvm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/crosvm.rs') diff --git a/src/crosvm.rs b/src/crosvm.rs index 75e384f..49a08c0 100644 --- a/src/crosvm.rs +++ b/src/crosvm.rs @@ -16,7 +16,7 @@ use std::os::unix::io::RawFd; use std::path::{Path, PathBuf}; use std::str::FromStr; -use arch::{Pstore, SerialParameters}; +use arch::{Pstore, SerialHardware, SerialParameters}; use devices::virtio::fs::passthrough; #[cfg(feature = "gpu")] use devices::virtio::gpu::GpuParameters; @@ -193,7 +193,7 @@ pub struct Config { pub display_window_keyboard: bool, pub display_window_mouse: bool, pub ac97_parameters: Vec, - pub serial_parameters: BTreeMap, + pub serial_parameters: BTreeMap<(SerialHardware, u8), SerialParameters>, pub syslog_tag: Option, pub virtio_single_touch: Option, pub virtio_trackpad: Option, -- cgit 1.4.1