X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/13f164230f8da32094edbe9811a81221454d461b..f87227e5b62e9fb276ba2981fc1611789ece532d:/src/simix/smx_vm.cpp diff --git a/src/simix/smx_vm.cpp b/src/simix/smx_vm.cpp index 49115f1753..f70e0f731b 100644 --- a/src/simix/smx_vm.cpp +++ b/src/simix/smx_vm.cpp @@ -12,65 +12,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_vm, simix, "Logging specific to SIMIX Virtual Machines"); -/** - * @brief Function to suspend a SIMIX VM host. This function stops the execution of the - * VM. All the processes on this VM will pause. The state of the VM is - * preserved on memory. We can later resume it again. - * - * @param vm the vm host to suspend (a sg_host_t) - */ -void SIMIX_vm_suspend(sg_host_t vm, smx_actor_t issuer) -{ - if (static_cast(vm)->pimpl_vm_->getState() != SURF_VM_STATE_RUNNING) - THROWF(vm_error, 0, "VM(%s) is not running", vm->cname()); - - XBT_DEBUG("suspend VM(%s), where %d processes exist", vm->cname(), xbt_swag_size(sg_host_simix(vm)->process_list)); - - /* jump to vm_ws_suspend. The state will be set. */ - static_cast(vm)->pimpl_vm_->suspend(); - - smx_actor_t smx_process, smx_process_safe; - xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list) { - XBT_DEBUG("suspend %s", smx_process->name.c_str()); - SIMIX_process_suspend(smx_process, issuer); - } - - XBT_DEBUG("suspend all processes on the VM done done"); -} - -void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, sg_host_t vm) -{ - xbt_assert(simcall->issuer->host != vm, "cannot suspend the VM where I run"); - - SIMIX_vm_suspend(vm, simcall->issuer); - - XBT_DEBUG("simcall_HANDLER_vm_suspend done"); -} - - -/** - * @brief Function to resume a SIMIX VM host. This function restart the execution of the - * VM. All the processes on this VM will run again. - * - * @param vm the vm host to resume (a sg_host_t) - */ -void SIMIX_vm_resume(sg_host_t vm) -{ - if (static_cast(vm)->pimpl_vm_->getState() != SURF_VM_STATE_SUSPENDED) - THROWF(vm_error, 0, "VM(%s) was not suspended", vm->cname()); - - XBT_DEBUG("resume VM(%s), where %d processes exist", vm->cname(), xbt_swag_size(sg_host_simix(vm)->process_list)); - - /* jump to vm_ws_resume() */ - static_cast(vm)->pimpl_vm_->resume(); - - smx_actor_t smx_process, smx_process_safe; - xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list) { - XBT_DEBUG("resume %s", smx_process->name.c_str()); - SIMIX_process_resume(smx_process); - } -} - /** * @brief Function to shutdown a SIMIX VM host. This function powers off the * VM. All the processes on this VM will be killed. But, the state of the VM is