Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Added guest multiplexing support
[palacios.git] / palacios / src / palacios / vmm_host_events.c
index 5e6baf2..f872149 100644 (file)
@@ -20,6 +20,7 @@
 #include <palacios/vmm.h>
 #include <palacios/vmm_host_events.h>
 #include <palacios/vm_guest.h>
+#include <palacios/vmm_muxer.h>
 
 int v3_init_host_events(struct v3_vm_info * vm) {
     struct v3_host_events * host_evts = &(vm->host_event_hooks);
@@ -67,9 +68,15 @@ int v3_hook_host_event(struct v3_vm_info * vm,
 
 int v3_deliver_keyboard_event(struct v3_vm_info * vm, 
                              struct v3_keyboard_event * evt) {
-    struct v3_host_events * host_evts = &(vm->host_event_hooks);
+    struct v3_host_events * host_evts = NULL;
     struct v3_host_event_hook * hook = NULL;
 
+    if (vm == NULL) {
+       vm = v3_get_foreground_vm();
+    }
+
+    host_evts = &(vm->host_event_hooks);
+
     if (vm->run_state != VM_RUNNING) {
        return -1;
     }
@@ -86,9 +93,15 @@ int v3_deliver_keyboard_event(struct v3_vm_info * vm,
 
 int v3_deliver_mouse_event(struct v3_vm_info * vm, 
                           struct v3_mouse_event * evt) {
-    struct v3_host_events * host_evts = &(vm->host_event_hooks);
+    struct v3_host_events * host_evts = NULL;
     struct v3_host_event_hook * hook = NULL;
 
+    if (vm == NULL) {
+       vm = v3_get_foreground_vm();
+    }
+
+    host_evts = &(vm->host_event_hooks);
+
     if (vm->run_state != VM_RUNNING) {
        return -1;
     }
@@ -105,9 +118,15 @@ int v3_deliver_mouse_event(struct v3_vm_info * vm,
 
 int v3_deliver_timer_event(struct v3_vm_info * vm, 
                           struct v3_timer_event * evt) {
-    struct v3_host_events * host_evts = &(vm->host_event_hooks);
+    struct v3_host_events * host_evts = NULL;
     struct v3_host_event_hook * hook = NULL;
 
+    if (vm == NULL) {
+       vm = v3_get_foreground_vm();
+    }
+
+    host_evts = &(vm->host_event_hooks);
+
     if (vm->run_state != VM_RUNNING) {
        return -1;
     }