summary refs log tree commit diff
path: root/arch
diff options
context:
space:
mode:
authorJorge E. Moreira <jemoreira@google.com>2019-08-01 14:40:03 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-03 20:03:23 +0000
commit1e26230f3a490a7955d2ea9fe7855af5498ced70 (patch)
treede59ab5928eac607c33bd4de6289bb230f2f6c51 /arch
parent54e660ba8b912cf9c1fe7837cd42d21b9cfe9133 (diff)
downloadcrosvm-1e26230f3a490a7955d2ea9fe7855af5498ced70.tar
crosvm-1e26230f3a490a7955d2ea9fe7855af5498ced70.tar.gz
crosvm-1e26230f3a490a7955d2ea9fe7855af5498ced70.tar.bz2
crosvm-1e26230f3a490a7955d2ea9fe7855af5498ced70.tar.lz
crosvm-1e26230f3a490a7955d2ea9fe7855af5498ced70.tar.xz
crosvm-1e26230f3a490a7955d2ea9fe7855af5498ced70.tar.zst
crosvm-1e26230f3a490a7955d2ea9fe7855af5498ced70.zip
Allow to connect standard input to a serial port other than the guest console
Before this change, setting console=true on a serial port caused that
port to be the one connected to the crosvm process' standard input. By
adding an extra 'stdin' argument to the serial parameters it's
possible to make those concepts independent.
Just as with the console argument, stdin defaults to serial port
1 (ttyS0) when not provided and it's possible to set no serial port
connected to stdin (or set as the console) by defining the first
serial port without the stdin (console) argument.

BUG=b/138616941
TEST=boot debian guest in debian host, boot cuttlefish in debian host
Change-Id: I7273e6860218521073df93a4ad71e31c7da522a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1731139
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Auto-Submit: Jorge Moreira Broche <jemoreira@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/src/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/src/lib.rs b/arch/src/lib.rs
index 71e4327..28f1168 100644
--- a/arch/src/lib.rs
+++ b/arch/src/lib.rs
@@ -271,6 +271,9 @@ pub fn add_serial_devices(
 
         if param.console {
             stdio_serial_num = Some(x + 1);
+        }
+
+        if param.stdin {
             stdio_serial = Some(com.clone());
         }
     }