From 0c2eb591d9112c7b27e8bc55b500f2164cd96ab4 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Tue, 13 Aug 2024 01:13:37 -0700 Subject: [PATCH] xenruntime: gracefully handle power management errors --- crates/runtime/src/power.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/runtime/src/power.rs b/crates/runtime/src/power.rs index 40f3236..6dafbde 100644 --- a/crates/runtime/src/power.rs +++ b/crates/runtime/src/power.rs @@ -1,5 +1,6 @@ use anyhow::Result; use indexmap::IndexMap; +use log::info; use xencall::sys::{CpuId, SysctlCputopo}; use crate::RuntimeContext; @@ -151,7 +152,10 @@ impl PowerManagementContext { .xen .call .set_turbo_mode(CpuId::All, enable) - .await?; + .await + .unwrap_or_else(|error| { + info!("non-fatal error while setting SMT policy: {:?}", error); + }); Ok(()) } @@ -161,7 +165,10 @@ impl PowerManagementContext { .xen .call .set_cpufreq_gov(CpuId::All, policy) - .await?; + .await + .unwrap_or_else(|error| { + info!("non-fatal error while setting scheduler policy: {:?}", error); + }); Ok(()) } }