Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
VM: code simplification by ensuring that the piface field is set
[simgrid.git] / src / surf / virtual_machine.cpp
index 43fa47e..ea65bc7 100644 (file)
@@ -4,6 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <xbt/signal.hpp>
+
 #include "cpu_cas01.hpp"
 #include "virtual_machine.hpp"
 
@@ -37,7 +39,8 @@ VirtualMachine::VirtualMachine(HostModel *model, const char *name, simgrid::s4u:
 , hostPM_(hostPM)
 {
   VMModel::ws_vms.push_back(*this);
-  simgrid::s4u::Host::by_name_or_create(name)->extension_set<simgrid::surf::HostImpl>(this);
+  piface = simgrid::s4u::Host::by_name_or_create(name);
+  piface->extension_set<simgrid::surf::HostImpl>(this);
 }
 
 /*