X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_host_events.c;h=791898c26c58d03dc20a27faa50d0374509c2a87;hp=58ac6eae7eae1ae1c6f39c82ce07e2421e2d9ab8;hb=123a1ba27ea09c8fa77a1b36ce625b43d7c48b14;hpb=266af4b5b19da7bee8e7445288c7c1cb3ee194c7 diff --git a/palacios/src/palacios/vmm_host_events.c b/palacios/src/palacios/vmm_host_events.c index 58ac6ea..791898c 100644 --- a/palacios/src/palacios/vmm_host_events.c +++ b/palacios/src/palacios/vmm_host_events.c @@ -19,7 +19,7 @@ #include #include - +#include int v3_init_host_events(struct guest_info * info) { struct v3_host_events * host_evts = &(info->host_event_hooks); @@ -70,6 +70,10 @@ int v3_deliver_keyboard_event(struct guest_info * info, struct v3_host_events * host_evts = &(info->host_event_hooks); struct v3_host_event_hook * hook = NULL; + if (info->run_state != VM_RUNNING) { + return -1; + } + list_for_each_entry(hook, &(host_evts->keyboard_events), link) { if (hook->cb.keyboard_handler(info, evt, hook->private_data) == -1) { return -1; @@ -85,6 +89,10 @@ int v3_deliver_mouse_event(struct guest_info * info, struct v3_host_events * host_evts = &(info->host_event_hooks); struct v3_host_event_hook * hook = NULL; + if (info->run_state != VM_RUNNING) { + return -1; + } + list_for_each_entry(hook, &(host_evts->mouse_events), link) { if (hook->cb.mouse_handler(info, evt, hook->private_data) == -1) { return -1; @@ -100,6 +108,10 @@ int v3_deliver_timer_event(struct guest_info * info, struct v3_host_events * host_evts = &(info->host_event_hooks); struct v3_host_event_hook * hook = NULL; + if (info->run_state != VM_RUNNING) { + return -1; + } + list_for_each_entry(hook, &(host_evts->timer_events), link) { if (hook->cb.timer_handler(info, evt, hook->private_data) == -1) { return -1;