kuasar/patch/0008-logfix-print-warn-instead-of-error-when-dir-not-foun.patch
2025-05-18 22:18:02 +00:00

34 lines
1.2 KiB
Diff

From 70b4d5f2fae117b3ced3ce76d25ef61bb453be1d Mon Sep 17 00:00:00 2001
From: liuxu <liuxu156@huawei.com>
Date: Tue, 17 Dec 2024 11:11:12 +0800
Subject: [PATCH] logfix:print warn instead of error when dir not found.
Signed-off-by: liuxu <liuxu156@huawei.com>
---
vmm/sandbox/src/sandbox.rs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/vmm/sandbox/src/sandbox.rs b/vmm/sandbox/src/sandbox.rs
index 42875a8..dd724c9 100644
--- a/vmm/sandbox/src/sandbox.rs
+++ b/vmm/sandbox/src/sandbox.rs
@@ -90,8 +90,13 @@ where
let mut subs = match tokio::fs::read_dir(dir).await {
Ok(subs) => subs,
Err(e) => {
- error!("FATAL! read working dir {} for recovery: {}", dir, e);
- return;
+ if e.kind() == ErrorKind::NotFound {
+ warn!("WARN! read working dir {} for recovery: {}", dir, e);
+ return;
+ } else {
+ error!("FATAL! read working dir {} for recovery: {}", dir, e);
+ return;
+ }
}
};
while let Some(entry) = subs.next_entry().await.unwrap() {
--
2.34.1