Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

Commit

Permalink
Merge pull request #14 from matttbe/vsock-connect
Browse files Browse the repository at this point in the history
vsock: mount virtme_vsockmount if needed
  • Loading branch information
arighi authored Dec 2, 2024
2 parents c43ba1c + c12db88 commit fe8484d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,19 @@ fn setup_socat_console() {
if let Ok(cmdline) = std::fs::read_to_string("/proc/cmdline") {
if let Some(exec) = extract_vsock_exec(&cmdline) {
thread::spawn(move || {
log!("setting up vsock proxy executing {}", exec);
let key = "virtme_vsockmount";
if let Ok(path) = env::var(&key) {
utils::do_mkdir(&path);
utils::do_mount(
&key.replace('_', "."),
&path,
"9p",
0,
"version=9p2000.L,trans=virtio,access=any",
);
}

let from = "VSOCK-LISTEN:1024,reuseaddr,fork";
let to = format!("EXEC:\"{}\",pty,stderr,setsid,sigint,sane,echo=0", exec);
let args = vec![from, &to];
Expand Down

0 comments on commit fe8484d

Please sign in to comment.