feat(vm): add openshell-vm crate with libkrun microVM gateway (#611)

This commit is contained in:
Drew Newberry
2026-04-08 22:00:01 -07:00
committed by GitHub
parent c2e5256725
commit ddb85b1704
56 changed files with 10972 additions and 61 deletions
+13
View File
@@ -29,6 +29,19 @@ pub fn openshell_config_dir() -> Result<PathBuf> {
Ok(xdg_config_dir()?.join("openshell"))
}
/// Resolve the XDG data base directory.
///
/// Returns `$XDG_DATA_HOME` if set, otherwise `$HOME/.local/share`.
pub fn xdg_data_dir() -> Result<PathBuf> {
if let Ok(path) = std::env::var("XDG_DATA_HOME") {
return Ok(PathBuf::from(path));
}
let home = std::env::var("HOME")
.into_diagnostic()
.wrap_err("HOME is not set")?;
Ok(PathBuf::from(home).join(".local").join("share"))
}
/// Create a directory (and parents) with owner-only permissions (`0o700`) on
/// Unix. On non-Unix platforms, falls back to default permissions.
///