Configure serial console input device
Defaults to hvc0, which is the status quo and also the console device
Microdroid uses.
Allows configure to ttyS0, which is the actual device Ferrochrome uses.
Note: Need to update Ferrochrome vm_config.json
Bug: 335362012
Test: atest MicrodroidTestApp --test-filter com.android.microdroid.test.MicrodroidTests#testConsoleInputSupported'.*'
Test: Start vmlauncher_app and connect to VM console
Change-Id: I2e74abfbec2a9b7fb9b3642cc529eca4be9f0fdc
diff --git a/libs/vmconfig/src/lib.rs b/libs/vmconfig/src/lib.rs
index 7c917b0..1413b51 100644
--- a/libs/vmconfig/src/lib.rs
+++ b/libs/vmconfig/src/lib.rs
@@ -65,6 +65,8 @@
/// SysFS paths of devices assigned to the VM.
#[serde(default)]
pub devices: Vec<PathBuf>,
+ /// The serial device for VM console input.
+ pub console_input_device: Option<String>,
}
impl VmConfig {
@@ -124,6 +126,7 @@
x.to_str().map(String::from).ok_or(anyhow!("Failed to convert {x:?} to String"))
})
.collect::<Result<_>>()?,
+ consoleInputDevice: self.console_input_device.clone(),
..Default::default()
})
}