From 40230efff3a2f440afb123b67bf0ab8418423b6d Mon Sep 17 00:00:00 2001 From: Sasha Finkelstein Date: Sun, 29 Dec 2024 14:08:52 +0100 Subject: [PATCH] Delete unused old x11 passthrough code Signed-off-by: Sasha Finkelstein --- crates/muvm/src/bin/muvm.rs | 21 --------------------- crates/muvm/src/guest/mount.rs | 4 +--- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/crates/muvm/src/bin/muvm.rs b/crates/muvm/src/bin/muvm.rs index c0616e9..b7bd6b7 100644 --- a/crates/muvm/src/bin/muvm.rs +++ b/crates/muvm/src/bin/muvm.rs @@ -330,27 +330,6 @@ fn main() -> Result { } } - // 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) diff --git a/crates/muvm/src/guest/mount.rs b/crates/muvm/src/guest/mount.rs index 99dd56b..02c507d 100644 --- a/crates/muvm/src/guest/mount.rs +++ b/crates/muvm/src/guest/mount.rs @@ -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(())