mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-09 16:11:31 +00:00
feature(krata): rename guest to zone (#266)
This commit is contained in:
22
crates/zone/src/lib.rs
Normal file
22
crates/zone/src/lib.rs
Normal file
@ -0,0 +1,22 @@
|
||||
use std::{os::raw::c_int, time::Duration};
|
||||
|
||||
use anyhow::Result;
|
||||
use tokio::time::sleep;
|
||||
use xenstore::{XsdClient, XsdInterface};
|
||||
|
||||
pub mod background;
|
||||
pub mod childwait;
|
||||
pub mod exec;
|
||||
pub mod init;
|
||||
pub mod metrics;
|
||||
|
||||
pub async fn death(code: c_int) -> Result<()> {
|
||||
let store = XsdClient::open().await?;
|
||||
store
|
||||
.write_string("krata/zone/exit-code", &code.to_string())
|
||||
.await?;
|
||||
drop(store);
|
||||
loop {
|
||||
sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user