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.


v3_cpu_mapper_admit_vm function call moved from start_thread to create_thread
Oscar Mondragon [Mon, 25 Aug 2014 01:34:36 +0000 (19:34 -0600)]
linux_module/vm.c
palacios/include/palacios/vmm.h
palacios/src/palacios/vmm.c

index 2ff482b..d352c36 100644 (file)
@@ -408,7 +408,7 @@ int create_palacios_vm(struct v3_guest * guest)  {
         return -1;
     }
 
-    guest->v3_ctx = v3_create_vm(guest->img, (void *)guest, guest->name);
+    guest->v3_ctx = v3_create_vm(guest->img, (void *)guest, guest->name, (0x1 << num_online_cpus()) - 1);
 
     if (guest->v3_ctx == NULL) { 
        WARNING("palacios: failed to create vm\n");
index 9071fb7..1f6228e 100644 (file)
@@ -433,7 +433,7 @@ void Init_V3(struct v3_os_hooks * hooks, char * cpus, int num_cpus, char *option
 void Shutdown_V3( void );
 
 
-struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name);
+struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name, unsigned int cpu_mask);
 int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask);
 int v3_stop_vm(struct v3_vm_info * vm);
 int v3_pause_vm(struct v3_vm_info * vm);
index b5740a6..b291ada 100644 (file)
@@ -298,7 +298,7 @@ static int start_core(void * p)
     return 0;
 }
 
-struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name) {
+struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name, unsigned int cpu_mask) {
     struct v3_vm_info * vm = v3_config_guest(cfg, priv_data);
     int vcore_id = 0;
 
@@ -332,7 +332,11 @@ struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name) {
         PrintError(vm, VCORE_NONE,"Error registering VM with scheduler\n");
     }
 
-     for (vcore_id = 0; vcore_id < vm->num_cores; vcore_id++) {
+    if (v3_cpu_mapper_admit_vm(vm,cpu_mask) != 0){
+        PrintError(vm, VCORE_NONE,"Error admitting VM %s for mapping", vm->name);
+    }
+
+    for (vcore_id = 0; vcore_id < vm->num_cores; vcore_id++) {
 
         struct guest_info * core = &(vm->cores[vcore_id]);
 
@@ -395,10 +399,6 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) {
     }
 
     vm->avail_cores = avail_cores;
-    if (v3_cpu_mapper_admit_vm(vm,cpu_mask) != 0){
-        PrintError(vm, VCORE_NONE,"Error admitting VM %s for mapping", vm->name);
-    }
 
     if (v3_scheduler_admit_vm(vm) != 0){
        PrintError(vm, VCORE_NONE,"Error admitting VM %s for scheduling", vm->name);