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

Method versioned_options

dstack-mr/src/machine.rs:56–79  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

54
55impl Machine<'_> {
56 pub fn versioned_options(&self) -> Result<VersionedOptions> {
57 let version = match &self.qemu_version {
58 Some(v) => Some(parse_version_tuple(v).context("Failed to parse QEMU version")?),
59 None => None,
60 };
61 let default_pic;
62 let default_two_pass;
63 let version = version.unwrap_or((9, 1, 0));
64 if version < (8, 0, 0) {
65 bail!("Unsupported QEMU version: {version:?}");
66 }
67 if ((8, 0, 0)..(9, 0, 0)).contains(&version) {
68 default_pic = true;
69 default_two_pass = true;
70 } else {
71 default_pic = false;
72 default_two_pass = false;
73 };
74 Ok(VersionedOptions {
75 version,
76 pic: self.pic.unwrap_or(default_pic),
77 two_pass_add_pages: self.two_pass_add_pages.unwrap_or(default_two_pass),
78 })
79 }
80}
81
82pub struct VersionedOptions {

Callers 2

create_tablesMethod · 0.80
mrtdMethod · 0.80

Calls 2

parse_version_tupleFunction · 0.85
containsMethod · 0.80

Tested by

no test coverage detected