X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_config.c;h=3f952cf5cdefa752802c138efbf84cdda10ed59e;hb=39b4fae9c539fbd848edd786500e60aae17b84a0;hp=26943c8441f493c824490f1bb98ffe4004077537;hpb=0adb91252edd4b093f12f57eea76687ced1aec0c;p=palacios.git diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index 26943c8..3f952cf 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -31,7 +31,7 @@ #include #include #include - +#include @@ -220,7 +220,8 @@ static int pre_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * vm_cfg) { char * vm_class = v3_cfg_val(vm_cfg, "class"); char * align_str = v3_cfg_val(v3_cfg_subtree(vm_cfg, "memory"), "alignment"); uint32_t sched_hz = 100; // set the schedule frequency to 100 HZ - + + if (!memory_str) { PrintError("Memory is a required configuration parameter\n"); return -1; @@ -234,10 +235,10 @@ static int pre_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * vm_cfg) { } // Amount of ram the Guest will have, always in MB - vm->mem_size = atoi(memory_str) * 1024 * 1024; + vm->mem_size = (addr_t)atoi(memory_str) * 1024 * 1024; vm->mem_align = get_alignment(align_str); - PrintDebug("Alignment computed as 0x%x\n", vm->mem_align); + PrintDebug("Alignment for %lu bytes of memory computed as 0x%x\n", vm->mem_size, vm->mem_align); if (strcasecmp(vm_class, "PC") == 0) { vm->vm_class = V3_PC_VM; @@ -282,10 +283,10 @@ static int determine_paging_mode(struct guest_info *info, v3_cfg_tree_t * core_c { extern v3_cpu_arch_t v3_cpu_types[]; - v3_cfg_tree_t *vm_tree = info->vm_info->cfg_data->cfg; - v3_cfg_tree_t *pg_tree = v3_cfg_subtree(vm_tree, "paging"); - char *pg_mode = v3_cfg_val(pg_tree, "mode"); - char *page_size = v3_cfg_val(pg_tree, "page_size"); + v3_cfg_tree_t * vm_tree = info->vm_info->cfg_data->cfg; + v3_cfg_tree_t * pg_tree = v3_cfg_subtree(vm_tree, "paging"); + char * pg_mode = v3_cfg_val(pg_tree, "mode"); + char * page_size = v3_cfg_val(pg_tree, "page_size"); PrintDebug("Paging mode specified as %s\n", pg_mode); @@ -327,11 +328,12 @@ static int determine_paging_mode(struct guest_info *info, v3_cfg_tree_t * core_c return -1; } - if (strcasecmp(v3_cfg_val(pg_tree, "large_pages"), "true") == 0) { - info->use_large_pages = 1; - PrintDebug("Use of large pages in memory virtualization enabled.\n"); + if (v3_cfg_val(pg_tree, "large_pages") != NULL) { + if (strcasecmp(v3_cfg_val(pg_tree, "large_pages"), "true") == 0) { + info->use_large_pages = 1; + PrintDebug("Use of large pages in memory virtualization enabled.\n"); + } } - return 0; } @@ -389,12 +391,6 @@ static int post_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { return -1; } - if (v3_inject_mptable(vm) == -1) { - PrintError("Failed to inject mptable during configuration\n"); - return -1; - } - - return 0; } @@ -402,7 +398,7 @@ static int post_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { static int post_config_core(struct guest_info * info, v3_cfg_tree_t * cfg) { - + info->core_run_state = CORE_STOPPED; if (info->vm_info->vm_class == V3_PC_VM) { if (post_config_pc_core(info, cfg) == -1) { @@ -434,7 +430,7 @@ static struct v3_vm_info * allocate_guest(int num_cores) { struct v3_vm_info * v3_config_guest(void * cfg_blob) { - v3_cpu_arch_t cpu_type = v3_get_cpu_type(v3_get_cpu_id()); + v3_cpu_arch_t cpu_type = v3_get_cpu_type(V3_Get_CPU()); struct v3_config * cfg_data = NULL; struct v3_vm_info * vm = NULL; int num_cores = 0;