Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into xbt_random
[simgrid.git] / src / plugins / vm / s4u_VirtualMachine.cpp
index 3cf72b4..e812231 100644 (file)
@@ -32,13 +32,10 @@ VirtualMachine::VirtualMachine(const std::string& name, s4u::Host* physical_host
 VirtualMachine::VirtualMachine(const 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))
 {
-  // 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", get_cname());
-
   XBT_DEBUG("Create VM %s", get_cname());
 
   /* Currently, a VM uses the network resource of its physical host */
-  pimpl_netpoint = physical_host->pimpl_netpoint;
+  set_netpoint(physical_host->get_netpoint());
 
   // Create a VCPU for this VM
   std::vector<double> speeds;
@@ -57,7 +54,7 @@ VirtualMachine::~VirtualMachine()
   XBT_DEBUG("destroy %s", get_cname());
 
   /* Don't free these things twice: they are the ones of my physical host */
-  pimpl_netpoint = nullptr;
+  set_netpoint(nullptr);
 }
 
 void VirtualMachine::start()