MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / read_vm_config

Function read_vm_config

dstack-attest/src/attestation.rs:44–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42/// Read vm_config from sys-config.json
43#[cfg(feature = "quote")]
44fn read_vm_config() -> Result<String> {
45 let content = match fs_err::read_to_string(SYS_CONFIG_PATH) {
46 Ok(content) => content,
47 Err(err) if err.kind() == std::io::ErrorKind::NotFound => return Ok(String::new()),
48 Err(err) => return Err(err).context("Failed to read sys-config"),
49 };
50 let sys_config: SysConfig =
51 serde_json::from_str(&content).context("Failed to parse sys-config")?;
52 Ok(sys_config.vm_config)
53}
54
55fn is_msgpack_map_prefix(byte: u8) -> bool {
56 // fixmap (0x80..=0x8f), map16 (0xde), map32 (0xdf)

Callers 1

quote_with_app_idMethod · 0.85

Calls 1

kindMethod · 0.80

Tested by

no test coverage detected