Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Better fix for constness of argv in sg_actor_start/create.
[simgrid.git] / examples / c / cloud-migration / cloud-migration.c
index b6ab2d0..4e64e4b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2020. The SimGrid Team.
+/* Copyright (c) 2007-2021. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -45,11 +45,10 @@ static void vm_migrate_async(const_sg_vm_t vm, const_sg_host_t dst_pm)
   const char* dst_pm_name = sg_host_get_name(dst_pm);
 
   const char* argv[] = {"mig_work", vm_name, dst_pm_name, NULL};
-  sg_actor_t actor   = sg_actor_init("mig_wrk", sg_host_self());
-  sg_actor_start(actor, migration_worker_main, 3, argv);
+  sg_actor_create_("mig_wrk", sg_host_self(), migration_worker_main, 3, argv);
 }
 
-static void master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+static void master_main(int argc, char* argv[])
 {
   sg_host_t pm0       = sg_host_by_name("Fafard");
   sg_host_t pm1       = sg_host_by_name("Tremblay");
@@ -115,8 +114,7 @@ int main(int argc, char* argv[])
   /* load the platform file */
   simgrid_load_platform(argv[1]);
 
-  sg_actor_t actor = sg_actor_init("master_", sg_host_by_name("Fafard"));
-  sg_actor_start(actor, master_main, 0, NULL);
+  sg_actor_create("master_", sg_host_by_name("Fafard"), master_main, 0, NULL);
 
   simgrid_run();
   XBT_INFO("Bye (simulation time %g)", simgrid_get_clock());