main-- / windows-gaming

This project makes it easy and straightforward to set up PCI/VGA passthrough on your system. - OR AT LEAST IT WOULD, IF IT WASNT DEAD
6 stars 1 forks source link

When starting windows-gaming twice, the second launch might fail and the first becomes oncontrollable. #164

Closed moritzuehling closed 7 years ago

moritzuehling commented 7 years ago

Starting the 2nd VM errored by me:

[moritz@mojaro ~]$ ~/windows 
[sudo] password for moritz: 
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/windows-gaming`
[2017-09-12 15:30:25,658] WARN: Didn't find any devices for ById(UsbId { vendor: 3468, product: 316 })
qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory
[2017-09-12 15:30:25,736] ERROR: We errored: Connection reset by peer (os error 104)
[2017-09-12 15:30:25,736] WARN: QEMU returned with an error code: exit code: 1

From then on, the 2nd instance becaome uncontrollable:

[moritz@mojaro windows-gaming]$ RUST_BACKTRACE=1 cargo run --package windows-gaming control attach
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/windows-gaming control attach`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 111, message: "Connection refused" } }', src/libcore/result.rs:860
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic
   6: std::panicking::begin_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
             at /build/rust/src/rustc-1.19.0-src/src/libcore/macros.rs:29
  10: <core::result::Result<T, E>>::unwrap
             at /build/rust/src/rustc-1.19.0-src/src/libcore/result.rs:738
  11: windows_gaming::control_send
             at windows-gaming/src/main.rs:159
  12: windows_gaming::main
             at windows-gaming/src/main.rs:142
  13: __rust_maybe_catch_panic
  14: std::panicking::try
  15: std::panic::catch_unwind
  16: std::rt::lang_start
  17: main
  18: __libc_start_main
  19: _start
moritzuehling commented 7 years ago

Proposed solution: Prevent start of windows-gaming twice, as we don't support two instances anyway with stuff like input etc, and the first instance being not controllable is a problem either way.