Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
another useless function dies
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 28 Aug 2016 16:39:38 +0000 (18:39 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 28 Aug 2016 16:39:38 +0000 (18:39 +0200)
src/simix/libsmx.cpp
src/simix/smx_host_private.h
src/simix/smx_vm.cpp

index 261f22c..91447fe 100644 (file)
@@ -26,6 +26,8 @@
 #include "mc/mc.h"
 #include "src/simix/smx_host_private.h"
 #include "src/kernel/activity/SynchroComm.hpp"
+#include "src/surf/virtual_machine.hpp"
+
 
 #include <simgrid/simix.hpp>
 
@@ -191,7 +193,13 @@ e_smx_state_t simcall_execution_wait(smx_activity_t execution)
  */
 sg_host_t simcall_vm_create(const char *name, sg_host_t phys_host)
 {
-  return simgrid::simix::kernelImmediate(std::bind(SIMIX_vm_create, name, phys_host));
+  return simgrid::simix::kernelImmediate([&] {
+    surf_vm_model->createVM(name, phys_host);
+    sg_host_t host = sg_host_by_name(name);
+    SIMIX_host_create(host);
+
+    return host;
+  });
 }
 
 /**
index a3a496f..261fe15 100644 (file)
@@ -66,8 +66,6 @@ XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec);
 XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category);
 
 /* vm related stuff */
-XBT_PRIVATE sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host);
-
 XBT_PRIVATE void SIMIX_vm_destroy(sg_host_t ind_vm);
 // --
 XBT_PRIVATE void SIMIX_vm_resume(sg_host_t ind_vm, smx_actor_t issuer);
index 768531c..0a4f5a5 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_vm, simix, "Logging specific to SIMIX Virtual Machines");
 
-/* **** create a VM **** */
-
-/**
- * @brief Internal function to create a SIMIX host.
- * @param name name of the host to create
- */
-sg_host_t SIMIX_vm_create(const char *name, sg_host_t phys_host)
-{
-  surf_vm_model->createVM(name, phys_host);
-  sg_host_t host = sg_host_by_name(name);
-  SIMIX_host_create(host);
-
-  return host;
-}
-
-
 /* works for VMs and PMs */
 static long host_get_ramsize(sg_host_t vm, int *overcommit)
 {