diff --git a/crates/runtime/src/lib.rs b/crates/runtime/src/lib.rs index 9e957e5..f9fe270 100644 --- a/crates/runtime/src/lib.rs +++ b/crates/runtime/src/lib.rs @@ -297,4 +297,14 @@ impl Runtime { let context = RuntimeContext::new().await?; Ok(PowerManagementContext { context }) } + + pub async fn read_hypervisor_console(&self, clear: bool) -> Result> { + 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)) + } }