- std::vector<simgrid::simix::ProcessArg*> process_list = sg_host_simix(host)->auto_restart_processes;
- if (process_list.empty())
- return;
-
- for (auto arg : process_list) {
-
- XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->cname());
- simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host, arg->kill_time,
- arg->properties, arg->auto_restart, nullptr);
+ std::vector<simgrid::simix::ProcessArg*> process_list =
+ host->extension<simgrid::simix::Host>()->auto_restart_processes;
+
+ for (auto const& arg : process_list) {
+ XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->getCname());
+ smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host,
+ arg->properties.get(), nullptr);
+ if (arg->kill_time >= 0)
+ simcall_process_set_kill_time(actor, arg->kill_time);
+ if (arg->auto_restart)
+ actor->auto_restart = arg->auto_restart;