Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more VM functions inlining (plus, getters don't need to be a simcall)
[simgrid.git] / src / msg / msg_vm.cpp
index 0d5304b..35efaa7 100644 (file)
@@ -20,6 +20,8 @@
 #include "xbt/log.h"
 #include "simgrid/host.h"
 
+#include "src/simix/smx_host_private.h" /* don't ask me why the VM functions are in there (FIXME:KILLME) */
+
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg, "Cloud-oriented parts of the MSG API");
 
 
@@ -50,7 +52,7 @@ void MSG_vm_get_params(msg_vm_t vm, vm_params_t params)
 /* **** Check state of a VM **** */
 static inline int __MSG_vm_is_state(msg_vm_t vm, e_surf_vm_state_t state)
 {
-  return simcall_vm_get_state(vm) == state;
+  return static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->getState() == state;
 }
 
 /** @brief Returns whether the given VM has just created, not running.
@@ -342,7 +344,13 @@ static int migration_rx_fun(int argc, char *argv[])
   //  /* Resume the VM */
   //  simcall_vm_resume(vm);
   //
-  simcall_vm_migratefrom_resumeto(vm, src_pm, dst_pm);
+  simgrid::simix::kernelImmediate([vm, src_pm, dst_pm]() {
+    /* Update the vm location */
+    SIMIX_vm_migrate(vm, dst_pm);
+
+    /* Resume the VM */
+    SIMIX_vm_resume(vm);
+  });
 
   {
    // Now the VM is running on the new host (the migration is completed) (even if the SRC crash)