mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-07 07:01:31 +00:00
feat: initial support for idm send in daemon
This commit is contained in:
@ -1,18 +0,0 @@
|
||||
use anyhow::Result;
|
||||
use tokio::fs::File;
|
||||
|
||||
pub struct XenConsole {
|
||||
pub read_handle: File,
|
||||
pub write_handle: File,
|
||||
}
|
||||
|
||||
impl XenConsole {
|
||||
pub async fn new(tty: &str) -> Result<XenConsole> {
|
||||
let read_handle = File::options().read(true).write(false).open(tty).await?;
|
||||
let write_handle = File::options().read(false).write(true).open(tty).await?;
|
||||
Ok(XenConsole {
|
||||
read_handle,
|
||||
write_handle,
|
||||
})
|
||||
}
|
||||
}
|
@ -15,7 +15,6 @@ use xenstore::{XsdClient, XsdInterface};
|
||||
|
||||
use self::{
|
||||
autoloop::AutoLoop,
|
||||
console::XenConsole,
|
||||
launch::{GuestLaunchRequest, GuestLauncher},
|
||||
};
|
||||
use krataoci::cache::ImageCache;
|
||||
@ -23,7 +22,6 @@ use krataoci::cache::ImageCache;
|
||||
pub mod autoloop;
|
||||
pub mod cfgblk;
|
||||
pub mod channel;
|
||||
pub mod console;
|
||||
pub mod launch;
|
||||
|
||||
pub struct GuestLoopInfo {
|
||||
@ -321,17 +319,6 @@ impl Runtime {
|
||||
Ok(uuid)
|
||||
}
|
||||
|
||||
pub async fn console(&self, uuid: Uuid) -> Result<XenConsole> {
|
||||
let info = self
|
||||
.context
|
||||
.resolve(uuid)
|
||||
.await?
|
||||
.ok_or_else(|| anyhow!("unable to resolve guest: {}", uuid))?;
|
||||
let domid = info.domid;
|
||||
let tty = self.context.xen.get_console_path(domid).await?;
|
||||
XenConsole::new(&tty).await
|
||||
}
|
||||
|
||||
pub async fn list(&self) -> Result<Vec<GuestInfo>> {
|
||||
self.context.list().await
|
||||
}
|
||||
|
Reference in New Issue
Block a user