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

Function ovmf_variant_for_image

dstack-mr/src/lib.rs:84–89  ·  view source on GitHub ↗

Pick the OVMF variant from an image name like `dstack-0.5.10`. Falls back to `OvmfVariant::default()` (= `Pre202505`) when the image name is missing or doesn't carry a parseable version suffix. Use this only as a fallback for images that pre-date `VmConfig::ovmf_variant`.

(image: Option<&str>)

Source from the content-addressed store, hash-verified

82/// missing or doesn't carry a parseable version suffix. Use this only as a
83/// fallback for images that pre-date `VmConfig::ovmf_variant`.
84pub fn ovmf_variant_for_image(image: Option<&str>) -> OvmfVariant {
85 image
86 .and_then(extract_version_from_image_name)
87 .and_then(|v| ovmf_variant_for_version(v).ok())
88 .unwrap_or_default()
89}
90
91#[cfg(test)]
92mod ovmf_variant_tests {

Callers 1

Calls 1

ovmf_variant_for_versionFunction · 0.85

Tested by

no test coverage detected