use std::fmt::{Display, Formatter, Result};
#[cfg(target_os = "linux")]
pub const DEFAULT_KERNEL_CMDLINE: &str = "reboot=k panic=-1 panic_print=0 nomodule console=hvc0 \
rootfstype=virtiofs rw quiet no-kvmapf";
#[cfg(target_os = "macos")]
pub const DEFAULT_KERNEL_CMDLINE: &str = "reboot=k panic=-1 panic_print=0 nomodule console=hvc0 \
rootfstype=virtiofs rw quiet no-kvmapf";
#[derive(Debug, Default, Eq, PartialEq)]
pub struct KernelCmdlineConfig {
pub prolog: Option<String>,
pub krun_env: Option<String>,
pub epilog: Option<String>,
}
#[derive(Debug)]
pub enum KernelCmdlineConfigError {
InvalidKernelCommandLine(String),
}
impl Display for KernelCmdlineConfigError {
fn fmt(&self, f: &mut Formatter) -> Result {
use self::KernelCmdlineConfigError::*;
match *self {
InvalidKernelCommandLine(ref e) => {
write!(f, "The kernel command line is invalid: {}", e.as_str())
}
}
}
}