X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Ftelnet_cons.c;h=7bda58b4555a3666a60404b8fcfccfc66ff7af85;hb=926fe574cd42bb860c19fd04610451c24b6d42b6;hp=8c052b9edb9fe97df5b796d34687579e795602fb;hpb=e2964f7234daa3429275c039769a313f0870c212;p=palacios.git diff --git a/palacios/src/devices/telnet_cons.c b/palacios/src/devices/telnet_cons.c index 8c052b9..7bda58b 100644 --- a/palacios/src/devices/telnet_cons.c +++ b/palacios/src/devices/telnet_cons.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include @@ -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, }; @@ -531,10 +536,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; }