Skip to content

Commit

Permalink
Merge pull request #159 from Burning1020/redir-virtifofsd-log
Browse files Browse the repository at this point in the history
vmm: redirect virtiofsd log to syslog
  • Loading branch information
xietuo authored Aug 15, 2024
2 parents f2a28cd + 8aba2bf commit 91e35df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions vmm/sandbox/config_clh.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ path = "/usr/local/bin/virtiofsd"
log_level = "info"
cache = "never"
thread_pool_size = 4
syslog = true
3 changes: 3 additions & 0 deletions vmm/sandbox/src/cloud_hypervisor/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ pub struct VirtiofsdConfig {
pub socket_path: String,
#[serde(default)]
pub shared_dir: String,
#[serde(default)]
pub syslog: bool,
}

impl Default for VirtiofsdConfig {
Expand All @@ -76,6 +78,7 @@ impl Default for VirtiofsdConfig {
thread_pool_size: 4,
socket_path: "".to_string(),
shared_dir: "".to_string(),
syslog: true,
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions vmm/sandbox/src/cloud_hypervisor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ impl CloudHypervisorVM {
let pid = child
.id()
.ok_or(anyhow!("the virtiofsd has been polled to completion"))?;
info!("virtiofsd for {} is running with pid {}", self.id, pid);
spawn_wait(child, format!("virtiofsd {}", self.id), None, None);
Ok(pid)
}
Expand Down Expand Up @@ -185,6 +186,11 @@ impl VM for CloudHypervisorVM {
.map_err(|e| anyhow!("failed to spawn cloud hypervisor command: {}", e))?
};
let pid = child.id();
info!(
"cloud hypervisor for {} is running with pid {}",
self.id,
pid.unwrap_or_default()
);
self.pids.vmm_pid = pid;
let pid_file = format!("{}/pid", self.base_dir);
let (tx, rx) = channel((0u32, 0i128));
Expand Down

0 comments on commit 91e35df

Please sign in to comment.