X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f05224ef57c30ee1e71be443a160a236f7fe121a..7dc01ca1e4dcb01739599d8eb8268629804d5051:/examples/msg/cloud-migration/cloud-migration.c diff --git a/examples/msg/cloud-migration/cloud-migration.c b/examples/msg/cloud-migration/cloud-migration.c index 1c92fb5c85..32265f50ca 100644 --- a/examples/msg/cloud-migration/cloud-migration.c +++ b/examples/msg/cloud-migration/cloud-migration.c @@ -52,17 +52,15 @@ static void vm_migrate_async(msg_vm_t vm, msg_host_t dst_pm) static int master_main(int argc, char *argv[]) { - xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar(); - msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t); - msg_host_t pm1 = xbt_dynar_get_as(hosts_dynar, 1, msg_host_t); - msg_host_t pm2 = xbt_dynar_get_as(hosts_dynar, 2, msg_host_t); - msg_vm_t vm0, vm1; + 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"); s_vm_params_t params; memset(¶ms, 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_host_set_params(vm0, ¶ms); + MSG_vm_set_params(vm0, ¶ms); MSG_vm_start(vm0); XBT_INFO("Test: Migrate a VM with %llu Mbytes RAM", params.ramsize / 1000 / 1000); @@ -72,7 +70,7 @@ static int master_main(int argc, char *argv[]) vm0 = MSG_vm_create_core(pm0, "VM0"); params.ramsize = 1L * 1000 * 1000 * 100; // 100Mbytes - MSG_host_set_params(vm0, ¶ms); + MSG_vm_set_params(vm0, ¶ms); MSG_vm_start(vm0); XBT_INFO("Test: Migrate a VM with %llu Mbytes RAM", params.ramsize / 1000 / 1000); @@ -81,11 +79,11 @@ 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_host_set_params(vm0, ¶ms); - MSG_host_set_params(vm1, ¶ms); + MSG_vm_set_params(vm0, ¶ms); + MSG_vm_set_params(vm1, ¶ms); MSG_vm_start(vm0); MSG_vm_start(vm1); @@ -101,8 +99,8 @@ static int master_main(int argc, char *argv[]) vm1 = MSG_vm_create_core(pm0, "VM1"); params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes - MSG_host_set_params(vm0, ¶ms); - MSG_host_set_params(vm1, ¶ms); + MSG_vm_set_params(vm0, ¶ms); + MSG_vm_set_params(vm1, ¶ms); MSG_vm_start(vm0); MSG_vm_start(vm1); @@ -135,8 +133,7 @@ int main(int argc, char *argv[]) /* load the platform file */ MSG_create_environment(argv[1]); - xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar(); - msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t); + msg_host_t pm0 = MSG_host_by_name("Fafard"); launch_master(pm0); int res = MSG_main();