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.


This patch fixes several issues with the console/cga code:
Erik van der Kouwe [Tue, 13 Apr 2010 21:49:02 +0000 (16:49 -0500)]
- Fixes some #includes
- Adds a missing prototype
- Adds a missing return
- Checks the length of screen updates to avoid sending updates for non-
visible memory regions

palacios/include/devices/console.h
palacios/src/devices/cga.c
palacios/src/devices/telnet_cons.c

index 8484452..1040b95 100644 (file)
@@ -34,6 +34,7 @@ struct v3_console_ops {
 
 
 int v3_cons_get_fb(struct vm_device * frontend_dev, uint8_t * dst, uint_t offset, uint_t length);
+int v3_console_register_cga(struct vm_device * cga_dev, struct v3_console_ops * ops, void * private_data);
 
 #endif // ! __V3VEE__
 
index ee94f84..6c82c58 100644 (file)
@@ -24,7 +24,7 @@
 #include <palacios/vmm_emulator.h>
 #include <palacios/vm_guest_mem.h>
 
-#include <devices/cga.h>
+#include <devices/console.h>
 
 
 
@@ -120,6 +120,7 @@ static int video_write_mem(addr_t guest_addr, void * dest, uint_t length, void *
     struct video_internal * state = (struct video_internal *)dev->private_data;
     uint_t fb_offset = guest_addr - START_ADDR;
     uint_t screen_byte_offset = state->screen_offset * BYTES_PER_COL;
+    uint_t screen_length;
 
     PrintDebug("Guest address: %p length = %d, fb_offset=%d, screen_offset=%d\n", 
               (void *)guest_addr, length, fb_offset, screen_byte_offset);
@@ -136,7 +137,11 @@ static int video_write_mem(addr_t guest_addr, void * dest, uint_t length, void *
        
        if (state->ops) {
            PrintDebug("\tcalling update_screen()\n");
-           state->ops->update_screen(x, y, length, state->private_data);
+           
+           /* avoid updates past end of screen */
+           screen_length = SCREEN_SIZE - screen_byte_offset;
+           if (screen_length > length) screen_length = length;
+           state->ops->update_screen(x, y, screen_length, state->private_data);
        }
     }
 
index 8f71adf..d0c2b1f 100644 (file)
 #include <palacios/vmm_string.h>
 #include <palacios/vmm_socket.h>
 
-#include <devices/cga.h>
+#include <devices/console.h>
+#if 0
 #include <devices/telnet_cons.h>
+#endif
 
 #define NUM_ROWS 25
 #define NUM_COLS 80
@@ -516,6 +518,8 @@ static int cons_server(void * arg) {
        state->connected = 0;
        V3_Close_Socket(state->client_fd);
     }
+    
+    return -1;
 }