mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-04 05:31:32 +00:00
feature(zone): kernel command line control on launch (#351)
This commit is contained in:
@ -37,7 +37,8 @@ pub struct ZoneLaunchRequest {
|
||||
pub env: HashMap<String, String>,
|
||||
pub run: Option<Vec<String>>,
|
||||
pub pcis: Vec<PciDevice>,
|
||||
pub debug: bool,
|
||||
pub kernel_verbose: bool,
|
||||
pub kernel_cmdline_append: String,
|
||||
pub image: OciPackedImage,
|
||||
pub addons_image: Option<PathBuf>,
|
||||
pub network: ZoneLaunchNetwork,
|
||||
@ -139,9 +140,14 @@ impl ZoneLauncher {
|
||||
None
|
||||
};
|
||||
let mut cmdline_options = ["console=hvc0"].to_vec();
|
||||
if !request.debug {
|
||||
if !request.kernel_verbose {
|
||||
cmdline_options.push("quiet");
|
||||
}
|
||||
|
||||
if !request.kernel_cmdline_append.is_empty() {
|
||||
cmdline_options.push(&request.kernel_cmdline_append);
|
||||
}
|
||||
|
||||
let cmdline = cmdline_options.join(" ");
|
||||
|
||||
let zone_mac_string = request.network.zone_mac.to_string().replace('-', ":");
|
||||
|
@ -307,11 +307,13 @@ impl Runtime {
|
||||
}
|
||||
|
||||
pub async fn read_hypervisor_console(&self, clear: bool) -> Result<Arc<str>> {
|
||||
let index = 0 as u32;
|
||||
let (rawbuf, newindex) = self.context
|
||||
.xen
|
||||
.call
|
||||
.read_console_ring_raw(clear, index).await?;
|
||||
let index = 0_u32;
|
||||
let (rawbuf, newindex) = self
|
||||
.context
|
||||
.xen
|
||||
.call
|
||||
.read_console_ring_raw(clear, index)
|
||||
.await?;
|
||||
let buf = std::str::from_utf8(&rawbuf[..newindex as usize])?;
|
||||
Ok(Arc::from(buf))
|
||||
}
|
||||
|
Reference in New Issue
Block a user