X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/94be8068a4d11801fad48e8c5825ce637fa52e32..224e87cf30cd5397ab3172eca7034f3d9d50c427:/src/simix/smx_vm.cpp?ds=sidebyside diff --git a/src/simix/smx_vm.cpp b/src/simix/smx_vm.cpp index c104cc9b0a..0eb77b56b6 100644 --- a/src/simix/smx_vm.cpp +++ b/src/simix/smx_vm.cpp @@ -110,31 +110,9 @@ void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst SIMIX_vm_migrate(vm, dst_pm); /* Resume the VM */ - smx_actor_t self = SIMIX_process_self(); - SIMIX_vm_resume(vm, self); + SIMIX_vm_resume(vm); } -/** - * @brief Function to get the physical host of the given SIMIX VM host. - * - * @param host the vm host to get_phys_host (a sg_host_t) - */ -void *SIMIX_vm_get_pm(sg_host_t host) -{ - return static_cast(host)->pimpl_vm_->getPm(); -} - -/** - * @brief Function to set the CPU bound of the given SIMIX VM host. - * - * @param host the vm host (a sg_host_t) - * @param bound bound (a double) - */ -void SIMIX_vm_set_bound(sg_host_t vm, double bound) -{ - static_cast(vm)->pimpl_vm_->setBound(bound); -} - /** * @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 @@ -177,7 +155,7 @@ void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, sg_host_t vm) * * @param vm the vm host to resume (a sg_host_t) */ -void SIMIX_vm_resume(sg_host_t vm, smx_actor_t issuer) +void SIMIX_vm_resume(sg_host_t vm) { if (SIMIX_vm_get_state(vm) != SURF_VM_STATE_SUSPENDED) THROWF(vm_error, 0, "VM(%s) was not suspended", vm->name().c_str()); @@ -191,16 +169,10 @@ void SIMIX_vm_resume(sg_host_t vm, smx_actor_t issuer) 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, issuer); + SIMIX_process_resume(smx_process); } } -void simcall_HANDLER_vm_resume(smx_simcall_t simcall, sg_host_t vm) -{ - SIMIX_vm_resume(vm, simcall->issuer); -} - - /** * @brief Function to save a SIMIX VM host. * This function is the same as vm_suspend, but the state of the VM is saved to the disk, and not preserved on memory. @@ -218,7 +190,7 @@ void SIMIX_vm_save(sg_host_t vm, smx_actor_t issuer) XBT_DEBUG("save VM(%s), where %d processes exist", name, xbt_swag_size(sg_host_simix(vm)->process_list)); /* jump to vm_ws_save() */ - static_cast(vm)->pimpl_vm_->resume(); + static_cast(vm)->pimpl_vm_->save(); smx_actor_t smx_process, smx_process_safe; xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list) { @@ -232,14 +204,13 @@ void simcall_HANDLER_vm_save(smx_simcall_t simcall, sg_host_t vm) SIMIX_vm_save(vm, simcall->issuer); } - /** * @brief Function to restore 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 restore (a sg_host_t) */ -void SIMIX_vm_restore(sg_host_t vm, smx_actor_t issuer) +void SIMIX_vm_restore(sg_host_t vm) { if (SIMIX_vm_get_state(vm) != SURF_VM_STATE_SAVED) THROWF(vm_error, 0, "VM(%s) was not saved", vm->name().c_str()); @@ -248,21 +219,15 @@ void SIMIX_vm_restore(sg_host_t vm, smx_actor_t issuer) vm->name().c_str(), xbt_swag_size(sg_host_simix(vm)->process_list)); /* jump to vm_ws_restore() */ - static_cast(vm)->pimpl_vm_->resume(); + static_cast(vm)->pimpl_vm_->restore(); 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, issuer); + SIMIX_process_resume(smx_process); } } -void simcall_HANDLER_vm_restore(smx_simcall_t simcall, sg_host_t vm) -{ - SIMIX_vm_restore(vm, simcall->issuer); -} - - /** * @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