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 host_pci passthrough PCI support
[palacios.git] / palacios / src / devices / telnet_cons.c
index 8c052b9..9562306 100644 (file)
@@ -27,7 +27,7 @@
 #include <palacios/vmm_host_events.h>
 #include <palacios/vmm_lock.h>
 #include <palacios/vmm_string.h>
-#include <palacios/vmm_socket.h>
+#include <interfaces/vmm_socket.h>
 
 #include <devices/console.h>
 
@@ -390,15 +390,20 @@ static struct v3_console_ops cons_ops = {
     .update_screen = screen_update, 
     .update_cursor = cursor_update,
     .scroll = scroll,
+    .set_text_resolution = NULL,
 };
 
-static int cons_free(struct vm_device * dev) {
-    return -1;
+static int cons_free(struct cons_state * state) {
+
+    // kill thread... ?
+
+    V3_Free(state);
+    return 0;
 }
 
 
 static struct v3_device_ops dev_ops = {
-    .free = cons_free,
+    .free = (int (*)(void *))cons_free,
 };
 
 
@@ -523,6 +528,12 @@ static int cons_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     struct vm_device * frontend = v3_find_dev(vm, v3_cfg_val(frontend_cfg, "tag"));
     char * dev_id = v3_cfg_val(cfg, "ID");
 
+    if (!state) {
+       PrintError("Cannot allocate in init\n");
+       return -1;
+    }
+
+
     state->vm = vm;
     state->server_fd = 0;
     state->client_fd = 0;
@@ -531,10 +542,11 @@ static int cons_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     v3_lock_init(&(state->cons_lock));
 
 
-    struct vm_device * dev = v3_allocate_device(dev_id, &dev_ops, state);
+    struct vm_device * dev = v3_add_device(vm, dev_id, &dev_ops, state);
 
-    if (v3_attach_device(vm, dev) == -1) {
+    if (dev == NULL) {
        PrintError("Could not attach device %s\n", dev_id);
+       V3_Free(state);
        return -1;
     }