feat(xenstore): multi-watch and maybe-commit support (#429)

This commit is contained in:
alex authored and GitHub committed 2024-12-14 17:57:15 -05:00
1 parent a04a812f28
commit d7affe6c8c
5 files changed
+62 -7

No files matched your search

+6 -5
View File
@@ -10,11 +10,12 @@ async fn list_recursive(client: &XsdClient, path: &str) -> Result<()> {
let children = client.list(path).await?;
for child in children {
let full = format!("{}/{}", if path == "/" { "" } else { path }, child);
let value = client
.read_string(full.as_str())
.await?
.expect("expected value");
println!("{} = {:?}", full, value,);
let value = client.read(full.as_str()).await?.expect("expected value");
let stringified = match String::from_utf8(value) {
Ok(string) => format!("\"{}\"", string),
Err(error) => format!("{:?}", error.into_bytes()),
};
println!("{} = {}", full, stringified);
pending.push(full);
}
}