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.


timer interface updates to allow state cleanup on exit
[palacios.git] / palacios / src / palacios / vmm_dev_mgr.c
index b538506..5561cec 100644 (file)
@@ -118,8 +118,12 @@ int v3_dev_mgr_deinit(struct v3_vm_info * vm) {
        v3_free_device(dev);
     }
 
+    v3_free_htable(mgr->blk_table, 0, 0);
+    v3_free_htable(mgr->net_table, 0, 0);
+    v3_free_htable(mgr->char_table, 0, 0);
+    v3_free_htable(mgr->console_table, 0, 0);
 
-    /* TODO: Clear hash tables */
+    v3_free_htable(mgr->dev_table, 0, 0);
 
     return 0;
 }
@@ -211,7 +215,11 @@ int v3_dev_unhook_io(struct vm_device * dev, uint16_t port) {
 int v3_detach_device(struct vm_device * dev) {
     struct vmm_dev_mgr * mgr = &(dev->vm->dev_mgr);
 
-    dev->ops->free(dev);
+    if (dev->ops->free) {
+       dev->ops->free(dev);
+    } else {
+       PrintError("Error: %s free() not implemented\n",  dev->name);
+    }
 
     list_del(&(dev->dev_link));
     mgr->num_devs--;