From 676d05b75133efd3041aad6727e5a1a239e57990 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 6 Oct 2017 14:38:57 +0200 Subject: [PATCH] vbox: stop input processing if vm is powered down avoids tons of red messages about the fact that vm is already down --- repos/ports/src/virtualbox/frontend/console.cc | 10 ++++++++++ repos/ports/src/virtualbox5/frontend/console.cc | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/repos/ports/src/virtualbox/frontend/console.cc b/repos/ports/src/virtualbox/frontend/console.cc index ff16637426..818b6f210a 100644 --- a/repos/ports/src/virtualbox/frontend/console.cc +++ b/repos/ports/src/virtualbox/frontend/console.cc @@ -31,6 +31,7 @@ #include "../vmm.h" static const bool debug = false; +static bool vm_down = false; static Genode::Attached_rom_dataspace *clipboard_rom = nullptr; static Genode::Reporter *clipboard_reporter = nullptr; @@ -135,6 +136,8 @@ void fireStateChangedEvent(IEventSource* aSource, if (a_state != MachineState_PoweredOff) return; + vm_down = true; + genode_env().parent().exit(0); } @@ -178,6 +181,13 @@ void GenodeConsole::update_video_mode() void GenodeConsole::handle_input() { + /* disable input processing if vm is powered down */ + if (vm_down && (_vbox_mouse || _vbox_keyboard)) { + _vbox_mouse = nullptr; + _vbox_keyboard = nullptr; + _input.sigh(Genode::Signal_context_capability()); + } + static LONG64 mt_events [64]; unsigned mt_number = 0; diff --git a/repos/ports/src/virtualbox5/frontend/console.cc b/repos/ports/src/virtualbox5/frontend/console.cc index 1c18926edd..d903b0fa78 100644 --- a/repos/ports/src/virtualbox5/frontend/console.cc +++ b/repos/ports/src/virtualbox5/frontend/console.cc @@ -30,6 +30,7 @@ #include "vmm.h" static const bool debug = false; +static bool vm_down = false; static Genode::Attached_rom_dataspace *clipboard_rom = nullptr; static Genode::Reporter *clipboard_reporter = nullptr; @@ -74,6 +75,8 @@ void fireStateChangedEvent(IEventSource* aSource, if (a_state != MachineState_PoweredOff) return; + vm_down = true; + genode_env().parent().exit(0); } @@ -122,6 +125,13 @@ void GenodeConsole::update_video_mode() void GenodeConsole::handle_input() { + /* disable input processing if vm is powered down */ + if (vm_down && (_vbox_mouse || _vbox_keyboard)) { + _vbox_mouse = nullptr; + _vbox_keyboard = nullptr; + _input.sigh(Genode::Signal_context_capability()); + } + static LONG64 mt_events [64]; unsigned mt_number = 0;