mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
* feature(xencall): add hypervisor SYSCTL_readconsole definitions * feature(hypervisor-dmesg): xencall: add read_console_ring_raw hypercall wrapper * feature(hypervisor-dmesg): protobuf: add ReadHypervisorConsoleRing RPC * feature(hypervisor-dmesg): runtime: add read_hypervisor_console wrapper * feature(hypervisor-dmesg): daemon: add ReadHypervisorConsoleRing rpc implementation * feature(hypervisor-dmesg): ctl: add host hypervisor-messages command to get hypervisor messages * feature(hypervisor-dmesg): cli: rename hypervisor-messages command to hv-console * feature(hypervisor-dmesg): proto: change ReadHypervisorConsoleRing to ReadHypervisorConsole * feature(hypervisor-dmesg): fix up kratactl protobuf calls
19 lines
435 B
Rust
19 lines
435 B
Rust
use xencall::error::Result;
|
|
use xencall::XenCall;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
env_logger::init();
|
|
|
|
let call = XenCall::open(0)?;
|
|
let index = 0 as u32;
|
|
let (buf, newindex) = call.read_console_ring_raw(false, index).await?;
|
|
|
|
match std::str::from_utf8(&buf[..newindex as usize]) {
|
|
Ok(v) => print!("{}", v),
|
|
_ => panic!("unable to decode Xen console messages"),
|
|
};
|
|
|
|
Ok(())
|
|
}
|