Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmm: redirect virtiofsd log to syslog #159

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading