From: Jack Lange Date: Mon, 15 Nov 2010 19:49:29 +0000 (-0600) Subject: moved the host_private_data assignment to earlier in the configuration phase to make... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=0acab7cc621777394096377d6412e7f796e41769;p=palacios.git moved the host_private_data assignment to earlier in the configuration phase to make sure its available to initialization function --- diff --git a/palacios/include/palacios/vmm_config.h b/palacios/include/palacios/vmm_config.h index 02b6d03..34ad114 100644 --- a/palacios/include/palacios/vmm_config.h +++ b/palacios/include/palacios/vmm_config.h @@ -34,7 +34,7 @@ struct v3_vm_info; -struct v3_vm_info * v3_config_guest( void * cfg_blob); +struct v3_vm_info * v3_config_guest( void * cfg_blob, void * priv_data); struct v3_cfg_file { void * data; diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index 0dffb4c..e10c9a3 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -124,7 +124,7 @@ v3_cpu_arch_t v3_get_cpu_type(int cpu_id) { struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name) { - struct v3_vm_info * vm = v3_config_guest(cfg); + struct v3_vm_info * vm = v3_config_guest(cfg, priv_data); V3_Print("CORE 0 RIP=%p\n", (void *)(addr_t)(vm->cores[0].rip)); @@ -134,8 +134,6 @@ struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name) { return NULL; } - - if (name == NULL) { name = "[V3_VM]"; } else if (strlen(name) >= 128) { @@ -145,8 +143,6 @@ struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name) { memset(vm->name, 0, 128); strncpy(vm->name, name, 127); - vm->host_priv_data = priv_data; - return vm; } diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index 3f952cf..3dd7915 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -429,7 +429,7 @@ static struct v3_vm_info * allocate_guest(int num_cores) { -struct v3_vm_info * v3_config_guest(void * cfg_blob) { +struct v3_vm_info * v3_config_guest(void * cfg_blob, void * priv_data) { 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; @@ -473,6 +473,8 @@ struct v3_vm_info * v3_config_guest(void * cfg_blob) { return NULL; } + vm->host_priv_data = priv_data; + vm->cfg_data = cfg_data; V3_Print("Preconfiguration\n");