agent: add some logs for mount operation

Somewhere is lack of log info, add more details about
the storage and log when error will help understand
what happened.

Fixes: #4962

Signed-off-by: Bin Liu <bin@hyper.sh>
This commit is contained in:
Bin Liu 2022-08-26 13:59:18 +08:00
parent 2b5dc2ad39
commit c08a8631e0

View File

@ -169,11 +169,12 @@ pub fn baremount(
info!(
logger,
"mount source={:?}, dest={:?}, fs_type={:?}, options={:?}",
"baremount source={:?}, dest={:?}, fs_type={:?}, options={:?}, flags={:?}",
source,
destination,
fs_type,
options
options,
flags
);
nix::mount::mount(
@ -779,6 +780,14 @@ pub async fn add_storages(
};
// Todo need to rollback the mounted storage if err met.
if res.is_err() {
error!(
logger,
"add_storages failed, storage: {:?}, error: {:?} ", storage, res
);
}
let mount_point = res?;
if !mount_point.is_empty() {