X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9e9882ce69af88130c9047bf152c92e19acc805d..b9d2f7277242a82702b73e4ccdf63aec98855b5e:/src/msg/msg_vm.cpp?ds=sidebyside diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index 2d9e4ab526..34ab03d4a7 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -176,11 +176,10 @@ void MSG_vm_destroy(msg_vm_t vm) THROWF(vm_error, 0, "Cannot destroy VM '%s', which is migrating.", vm->getCname()); /* First, terminate all processes on the VM if necessary */ - if (MSG_vm_is_running(vm)) - MSG_vm_shutdown(vm); + vm->shutdown(); /* Then, destroy the VM object */ - simgrid::simix::kernelImmediate([vm]() { vm->destroy(); }); + vm->destroy(); if (TRACE_msg_vm_is_enabled()) { container_t container = simgrid::instr::Container::byName(vm->getName()); @@ -213,11 +212,7 @@ void MSG_vm_start(msg_vm_t vm) */ void MSG_vm_shutdown(msg_vm_t vm) { - smx_actor_t issuer = SIMIX_process_self(); - simgrid::simix::kernelImmediate([vm, issuer]() { vm->pimpl_vm_->shutdown(issuer); }); - - // Make sure that processes in the VM are killed in this scheduling round before processing (eg with the VM destroy) - MSG_process_sleep(0.); + vm->shutdown(); } static std::string get_mig_process_tx_name(msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)