mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-05 22:21:31 +00:00
krata: restructure packages for cleanliness
This commit is contained in:
20
crates/guest/src/lib.rs
Normal file
20
crates/guest/src/lib.rs
Normal file
@ -0,0 +1,20 @@
|
||||
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 init;
|
||||
|
||||
pub async fn death(code: c_int) -> Result<()> {
|
||||
let store = XsdClient::open().await?;
|
||||
store
|
||||
.write_string("krata/guest/exit-code", &code.to_string())
|
||||
.await?;
|
||||
drop(store);
|
||||
loop {
|
||||
sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user