mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-04 19:11:11 +00:00
vmm: api: Make ConsoleConfig default match between CLI and HTTP API
A simple patch making sure the field "file" is provisioned with the same default value through CLI and OpenAPI. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
cc08c44cb9
commit
793327cff8
@ -591,19 +591,24 @@ impl ConsoleOutputMode {
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
pub struct ConsoleConfig {
|
||||
#[serde(default = "default_consoleconfig_file")]
|
||||
pub file: Option<PathBuf>,
|
||||
pub mode: ConsoleOutputMode,
|
||||
#[serde(default)]
|
||||
pub iommu: bool,
|
||||
}
|
||||
|
||||
fn default_consoleconfig_file() -> Option<PathBuf> {
|
||||
None
|
||||
}
|
||||
|
||||
impl ConsoleConfig {
|
||||
pub fn parse(console: &str) -> Result<Self> {
|
||||
// Split the parameters based on the comma delimiter
|
||||
let params_list: Vec<&str> = console.split(',').collect();
|
||||
|
||||
let mut valid = false;
|
||||
let mut file: Option<PathBuf> = None;
|
||||
let mut file: Option<PathBuf> = default_consoleconfig_file();
|
||||
let mut mode: ConsoleOutputMode = ConsoleOutputMode::Off;
|
||||
let mut iommu_str: &str = "";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user