#include "simgrid/host.h"
#include "simgrid/simix.hpp"
+SG_BEGIN_DECL()
+
struct dirty_page {
double prev_clock;
double prev_remaining;
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]() {
/* 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;
simgrid::simix::kernelImmediate(
[vm, bound]() { static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->setBound(bound); });
}
+
+SG_END_DECL()