X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_time.c;h=a88b978c742219501af2098062e44d9a431498d9;hb=c0ecfba627c1d6c3f46d59bd4e5e6f883a494dc4;hp=b2f31a4bbd023683717b281a3436d8d4918017c6;hpb=acaadd79c597c8d5180fbfbec79c01fef3dff003;p=palacios.git diff --git a/palacios/src/palacios/vmm_time.c b/palacios/src/palacios/vmm_time.c index b2f31a4..a88b978 100644 --- a/palacios/src/palacios/vmm_time.c +++ b/palacios/src/palacios/vmm_time.c @@ -388,7 +388,7 @@ handle_time_configuration(struct v3_vm_info * vm, v3_cfg_tree_t *cfg) { int v3_init_time_vm(struct v3_vm_info * vm) { v3_cfg_tree_t * cfg_tree = vm->cfg_data->cfg; - int ret; + int ret=0; PrintDebug(vm, VCORE_NONE, "Installing TSC MSR hook.\n"); ret = v3_hook_msr(vm, TSC_MSR, @@ -409,10 +409,19 @@ int v3_init_time_vm(struct v3_vm_info * vm) { PrintDebug(vm, VCORE_NONE, "Registering TIME_CPUFREQ hypercall.\n"); ret = v3_register_hypercall(vm, TIME_CPUFREQ_HCALL, handle_cpufreq_hcall, NULL); + + if (ret!=0) { + return ret; + } + PrintDebug(vm, VCORE_NONE, "Registering TIME_RDHTSC hypercall.\n"); ret = v3_register_hypercall(vm, TIME_RDHTSC_HCALL, handle_rdhtsc_hcall, NULL); + if (ret!=0) { + return ret; + } + handle_time_configuration(vm, v3_cfg_subtree(cfg_tree, "time")); return ret; @@ -530,7 +539,9 @@ void v3_deinit_time_core(struct guest_info * core) { struct v3_timer * tmr = NULL; struct v3_timer * tmp = NULL; - list_for_each_entry_safe(tmr, tmp, &(time_state->timers), timer_link) { - v3_remove_timer(core, tmr); + if (*(void**)&time_state->timers) { + list_for_each_entry_safe(tmr, tmp, &(time_state->timers), timer_link) { + v3_remove_timer(core, tmr); + } } }