scheduler = v3_scheduler_lookup(default_strategy);
}
- PrintDebug(VM_NONE, VCORE_NONE,"Scheduler %s found",scheduler->name);
-
if (!scheduler) {
PrintError(VM_NONE, VCORE_NONE,"Specified Palacios scheduler \"%s\" not found.\n", default_strategy);
return -1;
}
+
+ PrintDebug(VM_NONE, VCORE_NONE,"Scheduler %s found",scheduler->name);
+
if (scheduler->init) {
return scheduler->init();
} else {
V3_Yield();
- uint64_t yield_start_cycle = (uint64_t) core->sched_priv_data;
- yield_start_cycle += (uint64_t)core->vm_info->sched_priv_data;
- core->sched_priv_data = (void *)yield_start_cycle;
+ core->sched_priv_data = (void*)v3_get_host_time(&(core->time_state));
}
}
* usec >=0 => the timed yield is used, which also usually implies interruptible
*/
void host_sched_yield(struct guest_info * core, int usec) {
- uint64_t yield_start_cycle;
+
if (usec < 0) {
V3_Yield();
} else {
V3_Sleep(usec);
}
- if(core){
- yield_start_cycle = (uint64_t) core->sched_priv_data
- + (uint64_t)core->vm_info->sched_priv_data;
- core->sched_priv_data = (void *)yield_start_cycle;
+ if (core){
+ core->sched_priv_data = (void*)v3_get_host_time(&(core->time_state));
}
}