summary refs log tree commit diff
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/boot.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/boot.rs b/tests/boot.rs
index c60ba4b..9c2da3c 100644
--- a/tests/boot.rs
+++ b/tests/boot.rs
@@ -13,7 +13,7 @@ use std::sync::Once;
 
 use libc::{cpu_set_t, sched_getaffinity};
 
-use arch::{SerialParameters, SerialType};
+use arch::{set_default_serial_parameters, SerialHardware, SerialParameters, SerialType};
 use crosvm::{linux, Config, Executable};
 use sys_util::syslog;
 
@@ -228,16 +228,19 @@ fn boot() {
     let mut c = Config::default();
     c.sandbox = false;
     c.serial_parameters.insert(
-        1,
+        (SerialHardware::Serial, 1),
         SerialParameters {
             type_: SerialType::Sink,
+            hardware: SerialHardware::Serial,
             path: None,
             input: None,
             num: 1,
             console: false,
+            earlycon: false,
             stdin: false,
         },
     );
+    set_default_serial_parameters(&mut c.serial_parameters);
     c.executable_path = Some(Executable::Kernel(kernel_path));
 
     let r = linux::run_config(c);