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 authored and slp committed Jan 27, 2025
1 parent bf26efb commit 40230ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 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
4 changes: 1 addition & 3 deletions crates/muvm/src/guest/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,7 @@ pub fn mount_filesystems(merged_rootfs: bool) -> Result<()> {

// Do this last so it can pick up all the submounts made above.
if let Err(e) = mount_fex_rootfs(merged_rootfs) {
println!(
"Failed to mount FEX rootfs, carrying on without. Error: {e}"
);
println!("Failed to mount FEX rootfs, carrying on without. Error: {e}");
}

Ok(())
Expand Down

0 comments on commit 40230ef

Please sign in to comment.