mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
feature(hypervisor-dmesg): ctl: add host hypervisor-messages command to get hypervisor messages
This commit is contained in:
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::cpu_topology::HostCpuTopologyCommand;
|
||||||
use crate::cli::host::identify::HostStatusCommand;
|
use crate::cli::host::identify::HostStatusCommand;
|
||||||
use crate::cli::host::idm_snoop::HostIdmSnoopCommand;
|
use crate::cli::host::idm_snoop::HostIdmSnoopCommand;
|
||||||
|
use crate::cli::host::dmesg::HostHypervisorMessagesCommand;
|
||||||
|
|
||||||
pub mod cpu_topology;
|
pub mod cpu_topology;
|
||||||
pub mod identify;
|
pub mod identify;
|
||||||
pub mod idm_snoop;
|
pub mod idm_snoop;
|
||||||
|
pub mod dmesg;
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[command(about = "Manage the host of the isolation engine")]
|
#[command(about = "Manage the host of the isolation engine")]
|
||||||
@ -35,6 +37,7 @@ pub enum HostCommands {
|
|||||||
CpuTopology(HostCpuTopologyCommand),
|
CpuTopology(HostCpuTopologyCommand),
|
||||||
Status(HostStatusCommand),
|
Status(HostStatusCommand),
|
||||||
IdmSnoop(HostIdmSnoopCommand),
|
IdmSnoop(HostIdmSnoopCommand),
|
||||||
|
HypervisorMessages(HostHypervisorMessagesCommand),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HostCommands {
|
impl HostCommands {
|
||||||
@ -49,6 +52,8 @@ impl HostCommands {
|
|||||||
HostCommands::Status(status) => status.run(client).await,
|
HostCommands::Status(status) => status.run(client).await,
|
||||||
|
|
||||||
HostCommands::IdmSnoop(snoop) => snoop.run(client, events).await,
|
HostCommands::IdmSnoop(snoop) => snoop.run(client, events).await,
|
||||||
|
|
||||||
|
HostCommands::HypervisorMessages(hvdmesg) => hvdmesg.run(client).await,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user