summary refs log tree commit diff
path: root/src/crosvm.rs
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2020-03-09 13:16:46 -0700
committerCommit Bot <commit-bot@chromium.org>2020-04-23 07:17:59 +0000
commita7b6a1c897205d8320482eb506167c5df66647b2 (patch)
tree10b3f4ba971bfbd0a03c258193bbd47b8c672aa4 /src/crosvm.rs
parentb865810340f1b264b407137c4e69ad232194cc5e (diff)
downloadcrosvm-a7b6a1c897205d8320482eb506167c5df66647b2.tar
crosvm-a7b6a1c897205d8320482eb506167c5df66647b2.tar.gz
crosvm-a7b6a1c897205d8320482eb506167c5df66647b2.tar.bz2
crosvm-a7b6a1c897205d8320482eb506167c5df66647b2.tar.lz
crosvm-a7b6a1c897205d8320482eb506167c5df66647b2.tar.xz
crosvm-a7b6a1c897205d8320482eb506167c5df66647b2.tar.zst
crosvm-a7b6a1c897205d8320482eb506167c5df66647b2.zip
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 <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'src/crosvm.rs')
-rw-r--r--src/crosvm.rs4
1 files changed, 2 insertions, 2 deletions
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<Ac97Parameters>,
-    pub serial_parameters: BTreeMap<u8, SerialParameters>,
+    pub serial_parameters: BTreeMap<(SerialHardware, u8), SerialParameters>,
     pub syslog_tag: Option<String>,
     pub virtio_single_touch: Option<TouchDeviceOption>,
     pub virtio_trackpad: Option<TouchDeviceOption>,