mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: Make CPU profile part of various configs
We integrate the CPU profile into the various configs that ultimately get set by the user. This quickly ends up involving multiple files, luckily Rust helps us find which ones via compilation errors. Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de> On-behalf-of: SAP oliver.anderson@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
a9440d2919
commit
549f3d6c04
@@ -11,6 +11,7 @@ use std::result;
|
||||
use std::str::FromStr;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use arch::CpuProfile;
|
||||
use block::ImageType;
|
||||
use clap::ArgMatches;
|
||||
use log::{debug, warn};
|
||||
@@ -697,7 +698,8 @@ impl CpusConfig {
|
||||
.add("affinity")
|
||||
.add("features")
|
||||
.add("nested")
|
||||
.add("core_scheduling");
|
||||
.add("core_scheduling")
|
||||
.add("profile");
|
||||
parser.parse(cpus).map_err(Error::ParseCpus)?;
|
||||
|
||||
let boot_vcpus: u32 = parser
|
||||
@@ -729,6 +731,12 @@ impl CpusConfig {
|
||||
})
|
||||
.collect()
|
||||
});
|
||||
|
||||
let profile = parser
|
||||
.convert::<CpuProfile>("profile")
|
||||
.map_err(Error::ParseCpus)?
|
||||
.unwrap_or_default();
|
||||
|
||||
let features_list = parser
|
||||
.convert::<StringList>("features")
|
||||
.map_err(Error::ParseCpus)?
|
||||
@@ -771,6 +779,7 @@ impl CpusConfig {
|
||||
features,
|
||||
nested,
|
||||
core_scheduling,
|
||||
profile,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user