Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove or deprecate now useless code
[simgrid.git] / src / plugins / vm / s4u_VirtualMachine.cpp
index 57f2503..d2c56be 100644 (file)
@@ -8,7 +8,6 @@
 #include "src/include/surf/surf.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/plugins/vm/VmHostExt.hpp"
-#include "src/simix/smx_host_private.hpp"
 #include "src/surf/cpu_cas01.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_vm, "S4U virtual machines");
@@ -25,17 +24,17 @@ simgrid::xbt::signal<void(VirtualMachine&)> VirtualMachine::on_migration_start;
 simgrid::xbt::signal<void(VirtualMachine&)> VirtualMachine::on_migration_end;
 
 VirtualMachine::VirtualMachine(std::string name, s4u::Host* physical_host, int core_amount)
-    : VirtualMachine(name, physical_host, core_amount, 1024)
+    : VirtualMachine(std::move(name), physical_host, core_amount, 1024)
 {
 }
 
 VirtualMachine::VirtualMachine(std::string name, s4u::Host* physical_host, int core_amount, size_t ramsize)
-    : Host(name), pimpl_vm_(new vm::VirtualMachineImpl(this, physical_host, core_amount, ramsize))
+    : Host(std::move(name)), pimpl_vm_(new vm::VirtualMachineImpl(this, physical_host, core_amount, ramsize))
 {
   // xbt_assert(s4u::Host::by_name(name) == nullptr,
-  //           "Cannot create a VM named %s: this name is already used by a host or a VM", name.c_str());
+  //           "Cannot create a VM named %s: this name is already used by a host or a VM", get_cname());
 
-  XBT_DEBUG("Create VM %s", name.c_str());
+  XBT_DEBUG("Create VM %s", get_cname());
 
   /* Currently, a VM uses the network resource of its physical host */
   pimpl_netpoint = physical_host->pimpl_netpoint;
@@ -45,7 +44,7 @@ VirtualMachine::VirtualMachine(std::string name, s4u::Host* physical_host, int c
   for (int i = 0; i < physical_host->get_pstate_count(); i++)
     speeds.push_back(physical_host->get_pstate_speed(i));
 
-  surf_cpu_model_vm->create_cpu(this, &speeds, physical_host->get_core_count());
+  surf_cpu_model_vm->create_cpu(this, &speeds, core_amount);
   if (physical_host->get_pstate() != 0)
     set_pstate(physical_host->get_pstate());
 }