Don't complain if ramdump file doesn't exist
It may not exist if ramdump is not enabled (either by the debug policy
or by the debug level).
Bug: 270965270
Test: run a VM, kill it. Search for the error message "Error handling
ramdump".
Change-Id: I23f9bbbed79ac817255b3268d5a17ccba9aef41c
diff --git a/virtualizationmanager/src/crosvm.rs b/virtualizationmanager/src/crosvm.rs
index 6ac1658..942e69a 100644
--- a/virtualizationmanager/src/crosvm.rs
+++ b/virtualizationmanager/src/crosvm.rs
@@ -532,6 +532,9 @@
/// Checks if ramdump has been created. If so, send it to tombstoned.
fn handle_ramdump(&self) -> Result<(), Error> {
let ramdump_path = self.temporary_directory.join("ramdump");
+ if !ramdump_path.as_path().try_exists()? {
+ return Ok(());
+ }
if std::fs::metadata(&ramdump_path)?.len() > 0 {
Self::send_ramdump_to_tombstoned(&ramdump_path)?;
}