mirror of
https://github.com/mbilker/vgpu_unlock-rs.git
synced 2025-06-08 05:28:21 +02:00
Allow VMs to be launched when no profile_override.toml is found.
Fixes mbilker/vgpu_unlock-rs#1 Signed-off-by: Erin Allison <erin@eallison.us>
This commit is contained in:
parent
3ca0999210
commit
40abb4b7c9
@ -391,13 +391,20 @@ fn handle_profile_override(config: &mut VgpuConfig) -> bool {
|
||||
Some(path) => PathBuf::from(path),
|
||||
None => PathBuf::from(DEFAULT_PROFILE_OVERRIDE_CONFIG_PATH),
|
||||
};
|
||||
|
||||
let config_overrides = match fs::read_to_string(&config_path) {
|
||||
Ok(data) => data,
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
let config_overrides: ProfileOverridesConfig = match toml::from_str(&config_overrides) {
|
||||
Ok(config) => config,
|
||||
Err(e) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user