vbox: stop input processing if vm is powered down

avoids tons of red messages about the fact that vm is already down
This commit is contained in:
Alexander Boettcher 2017-10-06 14:38:57 +02:00 committed by Christian Helmuth
parent 6aba4871a7
commit 676d05b751
2 changed files with 20 additions and 0 deletions

View File

@ -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;

View File

@ -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;