X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fcurses_cons.c;h=14610368b013da4b0561f098717b122d99601b0b;hb=1df601c90b519a54b64ca101fd6aa4c0a39bf0f0;hp=b43d69b79f9141abfd2419604b1714bfa3000c64;hpb=124131ed42f201896d9b81c039ee3fffd0336e21;p=palacios.git diff --git a/palacios/src/devices/curses_cons.c b/palacios/src/devices/curses_cons.c index b43d69b..1461036 100644 --- a/palacios/src/devices/curses_cons.c +++ b/palacios/src/devices/curses_cons.c @@ -38,8 +38,7 @@ #define SCREEN_SIZE (BYTES_PER_ROW * NUM_ROWS) -struct cons_state -{ +struct cons_state { v3_console_t cons; struct vm_device * frontend_dev; }; @@ -156,6 +155,15 @@ static int scroll(int rows, void * private_data) { return 0; } + +static int console_event_handler(struct v3_vm_info * vm, + struct v3_console_event * evt, + void * priv_data) { + screen_update(0, 0, SCREEN_SIZE, priv_data); + + return 0; +} + static struct v3_console_ops cons_ops = { .update_screen = screen_update, .update_cursor = cursor_update, @@ -190,7 +198,7 @@ static int cons_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) state->frontend_dev = frontend; /* open tty for screen display */ - state->cons = v3_console_open(vm); + state->cons = v3_console_open(vm, NUM_COLS, NUM_ROWS); if (!state->cons) { PrintError("Could not open console\n"); @@ -212,6 +220,8 @@ static int cons_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) /* attach to front-end display adapter */ v3_console_register_cga(frontend, &cons_ops, dev); + v3_hook_host_event(vm, HOST_CONSOLE_EVT, V3_HOST_EVENT_HANDLER(console_event_handler), dev); + return 0; }