virtmgr: Log failed sysprop read for custom DP
Instead of silently map the Err(_) from system_properties::read() to a
default value, log the failure first.
Test: m virtmgr
Change-Id: I688b6444dc5f22283e45d3298aaa48dafcea95dd
diff --git a/virtualizationmanager/src/debug_config.rs b/virtualizationmanager/src/debug_config.rs
index 6b495aa..cb7f5d0 100644
--- a/virtualizationmanager/src/debug_config.rs
+++ b/virtualizationmanager/src/debug_config.rs
@@ -162,7 +162,13 @@
_ => DebugLevel::NONE,
};
- match system_properties::read(CUSTOM_DEBUG_POLICY_OVERLAY_SYSPROP).unwrap_or_default() {
+ let dp_sysprop = system_properties::read(CUSTOM_DEBUG_POLICY_OVERLAY_SYSPROP);
+ let custom_dp = dp_sysprop.unwrap_or_else(|e| {
+ warn!("Failed to read sysprop {CUSTOM_DEBUG_POLICY_OVERLAY_SYSPROP}: {e}");
+ Default::default()
+ });
+
+ match custom_dp {
Some(path) if !path.is_empty() => {
match Self::from_custom_debug_overlay_policy(debug_level, Path::new(&path)) {
Ok(debug_config) => {