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.


Cleanup and sanity-checking of integer overflow, null comparisons, dead code (Coverit...
[palacios.git] / palacios / src / palacios / vmm_cpu_mapper.c
index e2e34bc..2c7fe89 100644 (file)
@@ -60,7 +60,10 @@ int V3_init_cpu_mapper() {
 int V3_deinit_cpu_mapper() {
 
     destroy_default_cpu_mapper();
-    v3_free_htable(master_cpu_mapper_table, 1, 1);
+    // we must leave the keys and values unfreed
+    // since we have no idea whether they are heap or otherwise
+    // the user must have done appropriate unregisters before this
+    v3_free_htable(master_cpu_mapper_table, 0, 0);
     return 0;
 }
 
@@ -221,7 +224,7 @@ int default_mapper_admit(struct v3_vm_info *vm, unsigned int cpu_mask){
     vcore_id--;
     }
 
-    if (vcore_id >= 0) {
+    if (vcore_id >= 0) { // dead code...
        v3_stop_vm(vm);
        return -1;
     }
@@ -250,5 +253,6 @@ static int create_default_cpu_mapper()
 static int destroy_default_cpu_mapper()
 {
        v3_unregister_cpu_mapper(default_mapper_impl.name);
+       // note - is not deleted since it's a global... 
        return 0;
 }