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 stack overflow bug in curses console framebuffer
[palacios.git] / palacios / src / devices / pci_passthrough.c
index 2ace074..b8f921b 100644 (file)
@@ -790,10 +790,11 @@ static int passthrough_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     strncpy(state->name, dev_id, 32);
 
 
-    dev = v3_allocate_device(dev_id, &dev_ops, state);
+    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;
     }
 
@@ -804,6 +805,7 @@ static int passthrough_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
        PrintError("Could not find PCI Device %s:%s\n", 
                   v3_cfg_val(cfg, "vendor_id"), 
                   v3_cfg_val(cfg, "device_id"));
+       v3_remove_device(dev);
        return 0;
     }