void Host::turn_off()
{
if (is_on()) {
- kernel::actor::simcall([this] {
+ kernel::actor::ActorImpl* self = SIMIX_process_self();
+ kernel::actor::simcall([this, self] {
for (VirtualMachine* const& vm : vm::VirtualMachineImpl::allVms_)
if (vm->get_pm() == this) {
vm->shutdown();
vm->turn_off();
}
this->pimpl_cpu->turn_off();
- this->pimpl_->turn_off();
+ this->pimpl_->turn_off(self);
on_state_change(*this);
});
}
/** Kill all actors hosted here */
-void HostImpl::turn_off()
+void HostImpl::turn_off(kernel::actor::ActorImpl* issuer)
{
for (auto& actor : actor_list_) {
XBT_DEBUG("Killing Actor %s@%s on behalf of %s which turned off that host.", actor.get_cname(),
- actor.get_host()->get_cname(), SIMIX_process_self()->get_cname());
- SIMIX_process_self()->kill(&actor);
+ actor.get_host()->get_cname(), issuer->get_cname());
+ issuer->kill(&actor);
}
// When a host is turned off, we want to keep only the actors that should restart for when it will boot again.
// Then get rid of the others.
s4u::Host* piface_ = nullptr;
void turn_on();
- void turn_off();
+ void turn_off(kernel::actor::ActorImpl* issuer);
std::vector<s4u::ActorPtr> get_all_actors();
size_t get_actor_count();
void add_actor(kernel::actor::ActorImpl* actor) { actor_list_.push_back(*actor); }