MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / url_to_file

Function url_to_file

vmm/src/migration.rs:38–47  ·  view source on GitHub ↗
(url: &str)

Source from the content-addressed store, hash-verified

36
37#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
38pub fn url_to_file(url: &str) -> std::result::Result<PathBuf, GuestDebuggableError> {
39 let file: PathBuf = url
40 .strip_prefix("file://")
41 .ok_or_else(|| {
42 GuestDebuggableError::Coredump(anyhow!("Could not extract file from URL: {url}"))
43 })
44 .map(|s| s.into())?;
45
46 Ok(file)
47}
48
49pub fn recv_vm_config(source_url: &str) -> std::result::Result<VmConfig, MigratableError> {
50 let mut vm_config_path = url_to_path(source_url)?;

Callers 1

get_dump_stateMethod · 0.85

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected