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.


Update char_stream device for virtual console input event
Lei Xia [Wed, 10 Nov 2010 04:27:06 +0000 (22:27 -0600)]
palacios/include/palacios/vmm_host_events.h
palacios/src/devices/char_stream.c
palacios/src/palacios/vmm_host_events.c

index 7a462b7..4d17a6c 100644 (file)
@@ -48,7 +48,7 @@ struct v3_vm_info;
 typedef enum {HOST_KEYBOARD_EVT, 
              HOST_MOUSE_EVT, 
              HOST_TIMER_EVT,
-             HOST_CONSLE_EVT} v3_host_evt_type_t;
+             HOST_CONSOLE_EVT} v3_host_evt_type_t;
 
 
 union v3_host_event_handler {
index 4590cae..33a0a32 100644 (file)
@@ -35,6 +35,17 @@ struct stream_state {
 };
 
 
+static int console_event_handler(struct v3_vm_info * vm, 
+                            struct v3_console_event * evt, 
+                            void * private_data) {
+    struct stream_state *state = (struct stream_state *)private_data;
+
+    if(state->char_ops.push != NULL){
+       state->char_ops.push(vm, evt->data, evt->len, state->push_fn_arg);
+    }
+
+    return 0;
+}
 
 static int stream_write(uint8_t * buf, uint64_t length, void * private_data) 
 {
@@ -102,6 +113,8 @@ static int stream_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg)
     }
     
 
+    v3_hook_host_event(vm, HOST_CONSOLE_EVT, V3_HOST_EVENT_HANDLER(console_event_handler), state);
+
 
     return 0;
 }
index ec54c65..078fb08 100644 (file)
@@ -28,6 +28,7 @@ int v3_init_host_events(struct v3_vm_info * vm) {
     INIT_LIST_HEAD(&(host_evts->keyboard_events));
     INIT_LIST_HEAD(&(host_evts->mouse_events));
     INIT_LIST_HEAD(&(host_evts->timer_events));
+    INIT_LIST_HEAD(&(host_evts->console_events));
 
     return 0;
 }
@@ -60,7 +61,7 @@ int v3_hook_host_event(struct v3_vm_info * vm,
        case HOST_TIMER_EVT:
            list_add(&(hook->link), &(host_evts->timer_events));
            break;
-       case HOST_CONSLE_EVT:
+       case HOST_CONSOLE_EVT:
            list_add(&(hook->link), &(host_evts->console_events));
            break;
     }