Skip to content

Commit 80d5e7b

Browse files
committed
Use vsock.sock_3 filename for Firecracker
1 parent eb073cd commit 80d5e7b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

crates/sandchest-node/src/jailer.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,11 @@ impl JailerConfig {
107107
}
108108

109109
/// Host-visible vsock socket path for a jailed VM.
110+
///
111+
/// Firecracker creates the host-side UDS at `{uds_path}_{guest_cid}`.
112+
/// Guest CID is always 3, so the actual file is `vsock.sock_3`.
110113
pub fn host_vsock_path(&self, sandbox_id: &str) -> PathBuf {
111-
self.chroot_root(sandbox_id).join("vsock.sock")
114+
self.chroot_root(sandbox_id).join("vsock.sock_3")
112115
}
113116

114117
/// Convert a host-absolute path to a chroot-relative path.
@@ -401,7 +404,7 @@ mod tests {
401404
let path = config.host_vsock_path("sb_test123");
402405
assert_eq!(
403406
path,
404-
PathBuf::from("/var/sandchest/jailer/firecracker/sb_test123/root/vsock.sock")
407+
PathBuf::from("/var/sandchest/jailer/firecracker/sb_test123/root/vsock.sock_3")
405408
);
406409
}
407410

crates/sandchest-node/src/sandbox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl SandboxManager {
124124
let dir = format!("{}/sandboxes/{}", self.node_config.data_dir, sandbox_id);
125125
SandboxPaths {
126126
api_socket: format!("{}/api.sock", dir),
127-
vsock: format!("{}/vsock.sock", dir),
127+
vsock: format!("{}/vsock.sock_3", dir),
128128
chroot_root: None,
129129
data_dir: dir.clone(),
130130
dir,

0 commit comments

Comments
 (0)