Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanups in NS3: it's on my way
[simgrid.git] / src / msg / msg_vm.cpp
index 1879dd2..46dae39 100644 (file)
 
 #include <simgrid/s4u/host.hpp>
 
+#include "msg_private.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "simgrid/host.h"
-#include "msg_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg, "Cloud-oriented parts of the MSG API");
 
@@ -196,7 +196,7 @@ msg_vm_t MSG_vm_create_core(msg_host_t ind_pm, const char *name)
 {
   /* make sure the VM of the same name does not exit */
   {
-    simgrid::s4u::Host* ind_host_tmp = (simgrid::s4u::Host*) xbt_dict_get_or_null(host_list, name);
+    simgrid::s4u::Host* ind_host_tmp = sg_host_by_name(name);
     if (ind_host_tmp != nullptr && sg_host_simix(ind_host_tmp) != nullptr) {
       XBT_ERROR("host %s already exits", name);
       return nullptr;