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.


changed device registration interface
[palacios.git] / palacios / src / devices / tmpdisk.c
index 450de53..96bffef 100644 (file)
@@ -117,10 +117,11 @@ static int blk_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     memset(blk->blk_space, 0, capacity);
 
 
-    struct vm_device * dev = v3_allocate_device(dev_id, &dev_ops, blk);
+    struct vm_device * dev = v3_add_device(vm, dev_id, &dev_ops, blk);
 
-    if (v3_attach_device(vm, dev) == -1) {
+    if (dev == NULL) {
        PrintError("Could not attach device %s\n", dev_id);
+       V3_Free(blk);
        return -1;
     }
 
@@ -128,6 +129,7 @@ static int blk_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
                           &blk_ops, frontend_cfg, blk) == -1) {
        PrintError("Could not connect %s to frontend %s\n", 
                   dev_id, v3_cfg_val(frontend_cfg, "tag"));
+       v3_remove_device(dev);
        return -1;
     }