xenstore: watch support (#4)

This commit is contained in:
Alex Zenla
2024-03-07 04:14:25 -08:00
committed by GitHub
parent 670e140682
commit 182401371b
13 changed files with 526 additions and 199 deletions

View File

@ -77,12 +77,16 @@ impl RuntimeContext {
}
fn detect_guest_file(store: &str, name: &str) -> Result<String> {
let path = PathBuf::from(format!("{}/{}", store, name));
let mut path = PathBuf::from(format!("{}/guest/{}", store, name));
if path.is_file() {
return path_as_string(&path);
}
Ok(format!("/usr/share/krata/guest/{}", name))
path = PathBuf::from(format!("/usr/share/krata/guest/{}", name));
if path.is_file() {
return path_as_string(&path);
}
Err(anyhow!("unable to find required guest file: {}", name))
}
pub async fn list(&mut self) -> Result<Vec<GuestInfo>> {