X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9698647b08a3a2771bd8217f9698b014af69a346..5b52e25dc0e3d17cdbe0323f922d7bb4fc238af3:/src/msg/msg_vm.cpp diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index e1f2576f3a..837268e7b0 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -19,6 +19,8 @@ #include "simgrid/host.h" #include "simgrid/simix.hpp" +SG_BEGIN_DECL() + struct dirty_page { double prev_clock; double prev_remaining; @@ -151,7 +153,8 @@ void MSG_vm_destroy(msg_vm_t vm) if (MSG_vm_is_running(vm)) MSG_vm_shutdown(vm); - xbt_assert(MSG_vm_is_created(vm), "shutdown the given VM before destroying it"); + xbt_assert(MSG_vm_is_created(vm) || __MSG_vm_is_state(vm, SURF_VM_STATE_DESTROYED), + "shutdown the given VM before destroying it"); /* Then, destroy the VM object */ simgrid::simix::kernelImmediate([vm]() { @@ -772,9 +775,7 @@ void MSG_vm_migrate(msg_vm_t vm, msg_host_t dst_pm) /* wait until the migration have finished or on error has occurred */ XBT_DEBUG("wait for reception of the final ACK (i.e. migration has been correctly performed"); msg_task_t task = nullptr; - msg_error_t ret = MSG_TIMEOUT; - while (ret == MSG_TIMEOUT && dst_pm->isOn()) // The rx will tell me when he gots the VM - ret = MSG_task_receive_with_timeout(&task, ms->mbox_ctl, 4); + msg_error_t ret = MSG_task_receive(&task, ms->mbox_ctl); pimpl->isMigrating = false; @@ -882,3 +883,5 @@ void MSG_vm_set_bound(msg_vm_t vm, double bound) simgrid::simix::kernelImmediate( [vm, bound]() { static_cast(vm)->pimpl_vm_->setBound(bound); }); } + +SG_END_DECL()