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.


Fixed binding error in graphics console for new extension interface
Peter Dinda [Fri, 10 Jun 2011 20:45:55 +0000 (15:45 -0500)]
linux_module/palacios-graphics-console.c
linux_module/palacios-host-dev.c

index 3408fe7..e1d9216 100644 (file)
@@ -78,7 +78,7 @@ static v3_graphics_console_t g_open(void * priv_data,
     gc = get_vm_ext_data(guest, "GRAPHICS_CONSOLE_INTERFACE");
     
     if (gc == NULL) {
-       printk("ERROR: Could not locate gfx console data for extension GRAPHICS_CONSOLE_INTERFACE\n");
+       printk("palacios: Could not locate graphics console data for extension GRAPHICS_CONSOLE_INTERFACE\n");
        return 0;
     }
 
@@ -246,7 +246,7 @@ static struct v3_graphics_console_hooks palacios_graphics_console_hooks =
 };
 
 
-static int gfx_console_init( void ) {
+static int graphics_console_init( void ) {
 
     V3_Init_Graphics_Console(&palacios_graphics_console_hooks);
     
@@ -351,27 +351,33 @@ static int fb_input(struct v3_guest * guest,
 }
 
 
-static int gfx_console_guest_init(struct v3_guest * guest, void ** vm_data) {
-    struct palacios_graphics_console * gfx_cons = kmalloc(sizeof(struct palacios_graphics_console), GFP_KERNEL);
+static int graphics_console_guest_init(struct v3_guest * guest, void ** vm_data) {
+    struct palacios_graphics_console * graphics_cons = kmalloc(sizeof(struct palacios_graphics_console), GFP_KERNEL);
 
-    memset(gfx_cons, 0, sizeof(struct palacios_graphics_console));
+    if (!graphics_cons) { 
+       printk("palacios: filed to do guest_init for graphics console\n");
+       return -1;
+    }
+
+    memset(graphics_cons, 0, sizeof(struct palacios_graphics_console));
 
+    *vm_data = graphics_cons;
 
-    add_guest_ctrl(guest, V3_VM_FB_INPUT, fb_input, gfx_cons);
-    add_guest_ctrl(guest, V3_VM_FB_QUERY, fb_query, gfx_cons);
+    add_guest_ctrl(guest, V3_VM_FB_INPUT, fb_input, graphics_cons);
+    add_guest_ctrl(guest, V3_VM_FB_QUERY, fb_query, graphics_cons);
 
     return 0;
 }
 
 
 
-static struct linux_ext gfx_cons_ext = {
+static struct linux_ext graphics_cons_ext = {
     .name = "GRAPHICS_CONSOLE_INTERFACE",
-    .init = gfx_console_init,
+    .init = graphics_console_init,
     .deinit = NULL,
-    .guest_init = gfx_console_guest_init,
+    .guest_init = graphics_console_guest_init,
     .guest_deinit = NULL
 };
 
 
-register_extension(&gfx_cons_ext);
+register_extension(&graphics_cons_ext);
index e560889..927b5ad 100644 (file)
@@ -1328,6 +1328,11 @@ static int host_dev_init( void ) {
 
 static int host_dev_guest_init(struct v3_guest * guest, void ** vm_data ) {
     struct palacios_host_dev * host_dev = kmalloc(sizeof(struct palacios_host_dev), GFP_KERNEL);
+
+    if (!host_dev) { 
+       ERROR("palacios: failed to do guest_init for host device\n");
+       return -1;
+    }
     
     
     INIT_LIST_HEAD(&(host_dev->devs));