mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
feature(hypervisor-dmesg): runtime: add read_hypervisor_console wrapper
This commit is contained in:
parent
363ff3010f
commit
41b86cd4fa
@ -297,4 +297,14 @@ impl Runtime {
|
|||||||
let context = RuntimeContext::new().await?;
|
let context = RuntimeContext::new().await?;
|
||||||
Ok(PowerManagementContext { context })
|
Ok(PowerManagementContext { context })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 buf = std::str::from_utf8(&rawbuf[..newindex as usize])?;
|
||||||
|
Ok(Arc::from(buf))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user