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

Method ensure_exists

vmm/src/app/image.rs:99–122  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

97 }
98
99 fn ensure_exists(self) -> Result<Self> {
100 if !self.initrd.exists() {
101 bail!("Initrd does not exist: {}", self.initrd.display());
102 }
103 if !self.kernel.exists() {
104 bail!("Kernel does not exist: {}", self.kernel.display());
105 }
106 if let Some(hda) = &self.hda {
107 if !hda.exists() {
108 bail!("Hda does not exist: {}", hda.display());
109 }
110 }
111 if let Some(rootfs) = &self.rootfs {
112 if !rootfs.exists() {
113 bail!("Rootfs does not exist: {}", rootfs.display());
114 }
115 }
116 if let Some(bios) = &self.bios {
117 if !bios.exists() {
118 bail!("Bios does not exist: {}", bios.display());
119 }
120 }
121 Ok(self)
122 }
123}
124
125fn guess_version(base_path: &Path) -> Option<String> {

Callers 1

loadMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected