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 divide-by-zero and floating point use bugs (Coverity...
[palacios.git] / palacios / src / palacios / vmm_scheduler.c
index c214d63..506429b 100644 (file)
@@ -59,7 +59,9 @@ int V3_init_scheduling() {
 int V3_deinit_scheduling()
 {
     destroy_host_scheduler();
-    v3_free_htable(master_scheduler_table,1,1);
+    // important not to remove any keys or values since we don't know
+    // if they are malloced or other
+    v3_free_htable(master_scheduler_table,0,0);
     return 0;
 }
 
@@ -202,6 +204,10 @@ int host_sched_vm_init(struct v3_vm_info *vm)
 
     if (schedule_hz_str) {
        sched_hz = atoi(schedule_hz_str);
+       if (sched_hz==0) { 
+           PrintError(vm, VCORE_NONE,"Cannot set Sched Hz to 0\n");
+           return -1;
+       }
     }
 
     PrintDebug(vm, VCORE_NONE,"CPU_KHZ = %d, schedule_freq=%p\n", V3_CPU_KHZ(),
@@ -331,5 +337,6 @@ static int create_host_scheduler()
 static int destroy_host_scheduler()
 {
        v3_unregister_scheduler(host_sched_impl.name);
+       // no deletion of this since it's a pointer to a global var
        return 0;
 }