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
[palacios.git] / palacios / src / devices / char_stream.c
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;
 }