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.


IDE / ATA rewrites (1st step)
[palacios.git] / palacios / src / palacios / vmm_dev_mgr.c
index 3709ced..c75e633 100644 (file)
@@ -94,7 +94,10 @@ int V3_init_devices() {
 
 
 int V3_deinit_devices() {    
-    v3_free_htable(master_dev_table, 0, 0);
+    if (master_dev_table) { 
+       v3_free_htable(master_dev_table, 0, 0);
+       master_dev_table=0;
+    }
     return 0;
 }
 
@@ -126,8 +129,10 @@ int v3_free_vm_devices(struct v3_vm_info * vm) {
     struct vm_device * dev;
     struct vm_device * tmp;
 
-    list_for_each_entry_safe(dev, tmp, &(mgr->dev_list), dev_link) {
-       v3_remove_device(dev);
+    if (mgr && mgr->num_devs > 0) { 
+       list_for_each_entry_safe(dev, tmp, &(mgr->dev_list), dev_link) {
+           v3_remove_device(dev);
+       }
     }
 
     return 0;
@@ -329,7 +334,10 @@ int v3_deinit_dev_mgr(struct v3_vm_info * vm) {
 
     free_frontends(vm, mgr);
 
-    v3_free_htable(mgr->dev_table, 0, 0);
+    if (mgr->dev_table) { 
+       v3_free_htable(mgr->dev_table, 0, 0);
+       mgr->dev_table=0;
+    }
 
     return 0;
 }