From: Jack Lange Date: Fri, 22 May 2009 17:16:01 +0000 (-0500) Subject: only handle events after machine has been started, this avoids sending an event to... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=44a69f96dcfa4fa6cfe254bc21ee17f9e587d892 only handle events after machine has been started, this avoids sending an event to an unitilized subsystem --- 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;