mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
devices: add debug-console device
This commit adds the debug-console (or debugcon) device to CHV. It is a very simple device on I/O port 0xe9 supported by QEMU and BOCHS. It is meant for printing information as easy as possible, without any necessary configuration from the guest at all. It is primarily interesting to OS/kernel and firmware developers as they can produce output as soon as the guest starts without any configuration of a serial device or similar. Furthermore, a kernel hacker might use this device for information of type B whereas information of type A are printed to the serial device. This device is not used by default by Linux, Windows, or any other "real" OS, but only by toy kernels and during firmware development. In the CLI, it can be configured similar to --console or --serial with the --debug-console parameter. Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
committed by
Bo Chen
parent
8f90fba250
commit
e50a641126
@@ -396,6 +396,27 @@ pub fn default_consoleconfig_file() -> Option<PathBuf> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub struct DebugConsoleConfig {
|
||||
#[serde(default)]
|
||||
pub file: Option<PathBuf>,
|
||||
pub mode: ConsoleOutputMode,
|
||||
/// Optionally dedicated I/O-port, if the default port should not be used.
|
||||
pub iobase: Option<u16>,
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
impl Default for DebugConsoleConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
file: None,
|
||||
mode: ConsoleOutputMode::Off,
|
||||
iobase: Some(devices::debug_console::DEFAULT_PORT as u16),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub struct DeviceConfig {
|
||||
pub path: PathBuf,
|
||||
@@ -537,6 +558,9 @@ pub struct VmConfig {
|
||||
pub serial: ConsoleConfig,
|
||||
#[serde(default = "default_console")]
|
||||
pub console: ConsoleConfig,
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
#[serde(default)]
|
||||
pub debug_console: DebugConsoleConfig,
|
||||
pub devices: Option<Vec<DeviceConfig>>,
|
||||
pub user_devices: Option<Vec<UserDeviceConfig>>,
|
||||
pub vdpa: Option<Vec<VdpaConfig>>,
|
||||
|
||||
Reference in New Issue
Block a user