mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-02 21:00:55 +00:00
feature(hypervisor-dmesg): ctl: add host hypervisor-messages command to get hypervisor messages
This commit is contained in:
parent
b33ce7c874
commit
3255136b04
24
crates/ctl/src/cli/host/dmesg.rs
Normal file
24
crates/ctl/src/cli/host/dmesg.rs
Normal file
@ -0,0 +1,24 @@
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use krata::v1::control::{
|
||||
control_service_client::ControlServiceClient, ReadHypervisorConsoleRingRequest,
|
||||
};
|
||||
|
||||
use tonic::{transport::Channel, Request};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(about = "Display hypervisor diagnostic messages")]
|
||||
pub struct HostHypervisorMessagesCommand {
|
||||
}
|
||||
|
||||
impl HostHypervisorMessagesCommand {
|
||||
pub async fn run(self, mut client: ControlServiceClient<Channel>) -> Result<()> {
|
||||
let response = client
|
||||
.read_hypervisor_console_ring(Request::new(ReadHypervisorConsoleRingRequest { clear: false }))
|
||||
.await?
|
||||
.into_inner();
|
||||
|
||||
print!("{}", response.data);
|
||||
Ok(())
|
||||
}
|
||||
}
|
@ -8,10 +8,12 @@ use krata::v1::control::control_service_client::ControlServiceClient;
|
||||
use crate::cli::host::cpu_topology::HostCpuTopologyCommand;
|
||||
use crate::cli::host::identify::HostStatusCommand;
|
||||
use crate::cli::host::idm_snoop::HostIdmSnoopCommand;
|
||||
use crate::cli::host::dmesg::HostHypervisorMessagesCommand;
|
||||
|
||||
pub mod cpu_topology;
|
||||
pub mod identify;
|
||||
pub mod idm_snoop;
|
||||
pub mod dmesg;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(about = "Manage the host of the isolation engine")]
|
||||
@ -35,6 +37,7 @@ pub enum HostCommands {
|
||||
CpuTopology(HostCpuTopologyCommand),
|
||||
Status(HostStatusCommand),
|
||||
IdmSnoop(HostIdmSnoopCommand),
|
||||
HypervisorMessages(HostHypervisorMessagesCommand),
|
||||
}
|
||||
|
||||
impl HostCommands {
|
||||
@ -49,6 +52,8 @@ impl HostCommands {
|
||||
HostCommands::Status(status) => status.run(client).await,
|
||||
|
||||
HostCommands::IdmSnoop(snoop) => snoop.run(client, events).await,
|
||||
|
||||
HostCommands::HypervisorMessages(hvdmesg) => hvdmesg.run(client).await,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user