Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
crappy fix of cloud examples that mix host and VMs
[simgrid.git] / examples / msg / cloud-migration / cloud-migration.c
index 32015e7..29b10c9 100644 (file)
@@ -26,7 +26,7 @@ static int migration_worker_main(int argc, char *argv[])
   char *vm_name = argv[1];
   char *dst_pm_name = argv[2];
 
-  msg_vm_t vm MSG_host_by_name(vm_name);
+  msg_vm_t vm       = (msg_vm_t)MSG_host_by_name(vm_name);
   msg_host_t dst_pm = MSG_host_by_name(dst_pm_name);
 
   vm_migrate(vm, dst_pm);
@@ -55,11 +55,10 @@ static int master_main(int argc, char *argv[])
   msg_host_t pm0 = MSG_host_by_name("Fafard");
   msg_host_t pm1 = MSG_host_by_name("Tremblay");
   msg_host_t pm2 = MSG_host_by_name("Bourassa");
-  msg_vm_t vm0, vm1;
   s_vm_params_t params;
   memset(&params, 0, sizeof(params));
 
-  vm0 = MSG_vm_create_core(pm0, "VM0");
+  msg_vm_t vm0 = MSG_vm_create_core(pm0, "VM0");
   params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
   MSG_vm_set_params(vm0, &params);
   MSG_vm_start(vm0);
@@ -80,7 +79,7 @@ static int master_main(int argc, char *argv[])
   MSG_vm_destroy(vm0);
 
   vm0 = MSG_vm_create_core(pm0, "VM0");
-  vm1 = MSG_vm_create_core(pm0, "VM1");
+  msg_vm_t vm1 = MSG_vm_create_core(pm0, "VM1");
 
   params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
   MSG_vm_set_params(vm0, &params);