diff --git a/provider/input_event_proxy.py b/provider/input_event_proxy.py index 74958a58198c203c596793a851d7ec651c5ae02f..21e1e841884ff3d4c4d006514cf4de2eb718fc5a 100644 --- a/provider/input_event_proxy.py +++ b/provider/input_event_proxy.py @@ -95,7 +95,6 @@ class _EventListener(object): self._agent_sh = None self._agent_state = AgentState.STOPPED self._install() - self._listen() def _install(self): '''Install (copy) the agent into VM.''' @@ -286,6 +285,8 @@ class EventListenerLinux(_EventListener): ebuf[EventTypeKey] = EventType.UNKNOWN self._buffers[dev] = ebuf + def listen(self): + self._listen() # XXX: we may need different map tables for different keyboard layouts, # or even the best solution is not using any mapping, but let us pick diff --git a/qemu/tests/vioinput_keyboard.py b/qemu/tests/vioinput_keyboard.py index 0ec1100fe7ec7789b7a507b37a0dd6d0f59aac4f..0f8efb9f54aead01f69311feef8a483a277a4254 100644 --- a/qemu/tests/vioinput_keyboard.py +++ b/qemu/tests/vioinput_keyboard.py @@ -78,6 +78,7 @@ def key_tap_test(test, params, vm): error_context.context("Start event listener in guest", logging.info) listener = input_event_proxy.EventListener(vm) + listener.listen() console = graphical_console.GraphicalConsole(vm) for key in key_check_cfg.keys(): diff --git a/qemu/tests/vioinput_mice.py b/qemu/tests/vioinput_mice.py index eba800c0a9e7ceff59b2f18df0a21b445e6c845f..a9ad669fac63dbdb27f04639e5c97e4faf7e3526 100644 --- a/qemu/tests/vioinput_mice.py +++ b/qemu/tests/vioinput_mice.py @@ -233,6 +233,7 @@ def run(test, params, env): test.fail("%s does not worked currently" % mice_name) listener = input_event_proxy.EventListener(vm) + listener.listen() console = graphical_console.GraphicalConsole(vm) wait_time = float(params.get("wait_time", 0.2)) absolute = True if mice_info["absolute"] else False