X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/680d3333804979cca617afe9bef76ab1b1eb9f0e..4e5def63badcab36ae4c7b58645aa0a65ce4e0d0:/src/simix/smx_vm.c diff --git a/src/simix/smx_vm.c b/src/simix/smx_vm.c index d2eab043aa..213c1651f5 100644 --- a/src/simix/smx_vm.c +++ b/src/simix/smx_vm.c @@ -116,6 +116,32 @@ void SIMIX_vm_migrate(smx_host_t ind_vm, smx_host_t ind_dst_pm) surf_vm_workstation_migrate(ind_vm, ind_dst_pm); } +/** + * \brief Encompassing simcall to prevent the removal of the src or the dst node at the end of a VM migration + * The simcall actually invokes the following calls: + * simcall_vm_set_affinity(vm, src_pm, 0); + * simcall_vm_migrate(vm, dst_pm); + * simcall_vm_resume(vm); + * + * It is called at the end of the migration_rx_fun function from msg/msg_vm.c + * + * \param vm VM to migrate + * \param src_pm Source physical host + * \param dst_pmt Destination physical host + */ +void SIMIX_vm_migratefrom_resumeto(smx_host_t vm, smx_host_t src_pm, smx_host_t dst_pm) +{ + /* deinstall the current affinity setting for the CPU */ + SIMIX_vm_set_affinity(vm, src_pm, 0); + + /* Update the vm location */ + SIMIX_vm_migrate(vm, dst_pm); + + /* Resume the VM */ + smx_process_t self = SIMIX_process_self(); + SIMIX_vm_resume(vm, self->simcall.issuer); +} + /** * \brief Function to get the physical host of the given SIMIX VM host. *