X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e81b0628a697bddad304e69a82d898299ff9fe40..36ff0407edc1324b5bd7ec989b36e99f200987f5:/src/simix/libsmx.cpp diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index c50995f4e2..2fa37b7215 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -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 @@ -189,9 +191,14 @@ e_smx_state_t simcall_execution_wait(smx_activity_t execution) * * \return The host object of the VM */ -void* simcall_vm_create(const char *name, sg_host_t phys_host) +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([&name, &phys_host] { + sg_host_t host = surf_vm_model->createVM(name, phys_host); + host->extension_set(new simgrid::simix::Host()); + + return host; + }); } /**