- msg_vm_t vm = ms->vm;
- msg_host_t src_pm = ms->src_pm;
- msg_host_t dst_pm = ms-> dst_pm;
-
-// TODO: we have an issue, if the DST node is turning off during the three next calls, then the VM is in an inconsistent
-// state. I should check with Takahiro in order to make this portion of code atomic
-//
-// /* Update the vm location */
-// simcall_vm_migrate(vm, dst_pm);
-//
-// /* Resume the VM */
-// simcall_vm_resume(vm);
-//
- simcall_vm_migratefrom_resumeto(vm, src_pm, dst_pm);
+ simgrid::s4u::VirtualMachine* vm = static_cast<simgrid::s4u::VirtualMachine*>(ms->vm);
+ msg_host_t src_pm = ms->src_pm;
+ msg_host_t dst_pm = ms->dst_pm;
+
+ // TODO: we have an issue, if the DST node is turning off during the three next calls, then the VM is in an
+ // inconsistent
+ // state. I should check with Takahiro in order to make this portion of code atomic
+ //
+ // /* Update the vm location */
+ // simcall_vm_migrate(vm, dst_pm);
+ //
+ // /* Resume the VM */
+ // simcall_vm_resume(vm);
+ //
+ 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);
+ });