X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_host_events.c;fp=palacios%2Fsrc%2Fpalacios%2Fvmm_host_events.c;h=90eb032771d912d9312fa0847a2adfd26627f08a;hb=44a69f96dcfa4fa6cfe254bc21ee17f9e587d892;hp=58ac6eae7eae1ae1c6f39c82ce07e2421e2d9ab8;hpb=95101a1aef4d5776a9adb7f54fa5ea0c72662a12;p=palacios.git diff --git a/palacios/src/palacios/vmm_host_events.c b/palacios/src/palacios/vmm_host_events.c index 58ac6ea..90eb032 100644 --- a/palacios/src/palacios/vmm_host_events.c +++ b/palacios/src/palacios/vmm_host_events.c @@ -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;