Merge pull request #2 from erin-allison/master

Allow VMs to be launched when no profile_override.toml is found.
This commit is contained in:
Matt Bilker 2021-12-21 18:10:21 -05:00 committed by GitHub
commit 6541af70bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -391,13 +391,20 @@ fn handle_profile_override(config: &mut VgpuConfig) -> bool {
Some(path) => PathBuf::from(path), Some(path) => PathBuf::from(path),
None => PathBuf::from(DEFAULT_PROFILE_OVERRIDE_CONFIG_PATH), None => PathBuf::from(DEFAULT_PROFILE_OVERRIDE_CONFIG_PATH),
}; };
let config_overrides = match fs::read_to_string(&config_path) { let config_overrides = match fs::read_to_string(&config_path) {
Ok(data) => data, Ok(data) => data,
Err(e) => { Err(e) => {
if e.kind() != ErrorKind::NotFound {
error!("Config file '{}' not found", config_path.display());
return true;
}
error!("Failed to read '{}': {}", config_path.display(), e); error!("Failed to read '{}': {}", config_path.display(), e);
return false; return false;
} }
}; };
let config_overrides: ProfileOverridesConfig = match toml::from_str(&config_overrides) { let config_overrides: ProfileOverridesConfig = match toml::from_str(&config_overrides) {
Ok(config) => config, Ok(config) => config,
Err(e) => { Err(e) => {