X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1f98ddf1a2f29816149f708b3c21d4b465d5a34e..7cad4f0d54aafeabb7ee95007fc370514c4923a9:/src/simix/smx_vm.c diff --git a/src/simix/smx_vm.c b/src/simix/smx_vm.c index b249b57f53..1de4dc785b 100644 --- a/src/simix/smx_vm.c +++ b/src/simix/smx_vm.c @@ -96,7 +96,8 @@ static int __can_be_started(smx_host_t vm) void SIMIX_vm_start(smx_host_t ind_vm) { if (__can_be_started(ind_vm)) - SIMIX_vm_set_state(ind_vm, SURF_VM_STATE_RUNNING); + surf_resource_set_state(surf_workstation_resource_priv(ind_vm), + (int)SURF_VM_STATE_RUNNING); else THROWF(vm_error, 0, "The VM %s cannot be started", SIMIX_host_get_name(ind_vm)); } @@ -108,18 +109,6 @@ void SIMIX_pre_vm_start(smx_simcall_t simcall, smx_host_t ind_vm) SIMIX_vm_start(ind_vm); } -/* ***** set/get state of a VM ***** */ -void SIMIX_vm_set_state(smx_host_t ind_vm, int state) -{ - /* jump to vm_ws_set_state */ - surf_resource_set_state(surf_workstation_resource_priv(ind_vm), state); -} - -void SIMIX_pre_vm_set_state(smx_simcall_t simcall, smx_host_t ind_vm, int state) -{ - SIMIX_vm_set_state(ind_vm, state); -} - int SIMIX_vm_get_state(smx_host_t ind_vm) { return surf_resource_get_state(surf_workstation_resource_priv(ind_vm)); @@ -132,7 +121,7 @@ int SIMIX_pre_vm_get_state(smx_simcall_t simcall, smx_host_t ind_vm) /** - * \brief Function to migrate a SIMIX VM host. + * \brief Function to migrate a SIMIX VM host. * * \param host the vm host to migrate (a smx_host_t) */ @@ -210,7 +199,7 @@ void SIMIX_pre_vm_set_affinity(smx_simcall_t simcall, smx_host_t ind_vm, smx_hos /** - * \brief Function to suspend a SIMIX VM host. This function stops the exection of the + * \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. * @@ -252,7 +241,7 @@ void SIMIX_pre_vm_suspend(smx_simcall_t simcall, smx_host_t ind_vm) /** * \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. + * VM. All the processes on this VM will run again. * * \param host the vm host to resume (a smx_host_t) */ @@ -316,7 +305,7 @@ void SIMIX_pre_vm_save(smx_simcall_t simcall, smx_host_t ind_vm) /** * \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. + * VM. All the processes on this VM will run again. * * \param host the vm host to restore (a smx_host_t) */ @@ -369,7 +358,8 @@ void SIMIX_vm_shutdown(smx_host_t ind_vm, smx_process_t issuer) } /* FIXME: we may have to do something at the surf layer, e.g., vcpu action */ - SIMIX_vm_set_state(ind_vm, SURF_VM_STATE_CREATED); + surf_resource_set_state(surf_workstation_resource_priv(ind_vm), + (int)SURF_VM_STATE_CREATED); } void SIMIX_pre_vm_shutdown(smx_simcall_t simcall, smx_host_t ind_vm)