- smx_actor_t self = SIMIX_process_self();
- simgrid::simix::simcall([this, self] {
- simgrid::simix::Host* host = this->extension<simgrid::simix::Host>();
-
- xbt_assert((host != nullptr), "Invalid parameters");
-
- this->pimpl_cpu->turn_off();
-
- /* Clean Simulator data */
- if (not host->process_list.empty()) {
- for (auto& process : host->process_list) {
- SIMIX_process_kill(&process, self);
- XBT_DEBUG("Killing %s@%s on behalf of %s which turned off that host.", process.get_cname(),
- process.host->get_cname(), self->get_cname());
+ kernel::actor::simcall([this] {
+ for (VirtualMachine* const& vm : vm::VirtualMachineImpl::allVms_)
+ if (vm->get_pm() == this) {
+ vm->shutdown();
+ vm->turn_off();