Skip to content

Commit

Permalink
Delete unused old x11 passthrough code
Browse files Browse the repository at this point in the history
Signed-off-by: Sasha Finkelstein <[email protected]>
  • Loading branch information
WhatAmISupposedToPutHere committed Jan 9, 2025
1 parent d23aff6 commit 9b974f5
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions crates/muvm/src/bin/muvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,27 +330,6 @@ fn main() -> Result<ExitCode> {
}
}

// Forward the native X11 display into the guest as a socket
if let Ok(x11_display) = env::var("DISPLAY") {
if let Some(x11_display) = x11_display.strip_prefix(':') {
let socket_path = Path::new("/tmp/.X11-unix/").join(format!("X{}", x11_display));
if socket_path.exists() {
let socket_path = CString::new(
socket_path
.to_str()
.expect("socket_path should not contain invalid UTF-8"),
)
.context("Failed to process dynamic socket path as it contains NUL character")?;
// SAFETY: `socket_path` is a pointer to a `CString` with long enough lifetime.
let err = unsafe { krun_add_vsock_port(ctx_id, 6000, socket_path.as_ptr()) };
if err < 0 {
let err = Errno::from_raw_os_error(-err);
return Err(err).context("Failed to configure vsock for host X11 socket");
}
}
}
}

let username = env::var("USER").context("Failed to get username from environment")?;
let user = User::from_name(&username)
.map_err(Into::into)
Expand Down

0 comments on commit 9b974f5

Please sign in to comment.