Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Initialize data members with class initializers, or initialization lists.
[simgrid.git] / src / plugins / vm / VirtualMachineImpl.cpp
index e499ff0..ee173f3 100644 (file)
@@ -158,7 +158,7 @@ double VMModel::next_occurring_event(double now)
 
 VirtualMachineImpl::VirtualMachineImpl(simgrid::s4u::VirtualMachine* piface, simgrid::s4u::Host* host_PM,
                                        int core_amount, size_t ramsize)
-    : HostImpl(piface), physical_host_(host_PM), core_amount_(core_amount), user_bound_(std::numeric_limits<double>::max()), ramsize_(ramsize)
+    : HostImpl(piface), physical_host_(host_PM), core_amount_(core_amount), ramsize_(ramsize)
 {
   /* Register this VM to the list of all VMs */
   allVms_.push_back(piface);
@@ -204,9 +204,9 @@ void VirtualMachineImpl::suspend(smx_actor_t issuer)
 
   action_->suspend();
 
-  for (auto& actor : get_all_actors()) {
-    XBT_DEBUG("suspend %s", actor->get_cname());
-    actor->suspend();
+  for (auto& actor : actor_list_) {
+    XBT_DEBUG("suspend %s", actor.get_cname());
+    actor.suspend();
   }
 
   XBT_DEBUG("suspend all actors on the VM done done");
@@ -224,9 +224,9 @@ void VirtualMachineImpl::resume()
 
   action_->resume();
 
-  for (auto& actor : get_all_actors()) {
-    XBT_DEBUG("resume %s", actor->get_cname());
-    actor->resume();
+  for (auto& actor : actor_list_) {
+    XBT_DEBUG("resume %s", actor.get_cname());
+    actor.resume();
   }
 
   vm_state_ = s4u::VirtualMachine::state::RUNNING;
@@ -261,10 +261,10 @@ void VirtualMachineImpl::shutdown(smx_actor_t issuer)
 
   XBT_DEBUG("shutdown VM %s, that contains %zu actors", piface_->get_cname(), get_actor_count());
 
-  for (auto& actor : get_all_actors()) {
-    XBT_DEBUG("kill %s@%s on behalf of %s which shutdown that VM.", actor->get_cname(), actor->get_host()->get_cname(),
+  for (auto& actor : actor_list_) {
+    XBT_DEBUG("kill %s@%s on behalf of %s which shutdown that VM.", actor.get_cname(), actor.get_host()->get_cname(),
               issuer->get_cname());
-    issuer->kill(actor->get_impl());
+    issuer->kill(&actor);
   }
 
   set_state(s4u::VirtualMachine::state::DESTROYED);