From 48f8aa92514a5d0245b115263082b368f072c43e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20B=C3=A9daride?= Date: Thu, 13 Feb 2014 11:29:11 +0100 Subject: [PATCH] Remove vm set state simcall --- src/simix/simcalls.in | 1 - .../simcalls_generated_args_getter_setter.h | 12 ------------ src/simix/simcalls_generated_body.c | 16 ---------------- src/simix/simcalls_generated_case.c | 5 ----- src/simix/simcalls_generated_enum.h | 1 - src/simix/simcalls_generated_res_getter_setter.h | 2 -- src/simix/simcalls_generated_string.c | 1 - src/simix/smx_host_private.h | 2 -- src/simix/smx_vm.c | 16 ++-------------- 9 files changed, 2 insertions(+), 54 deletions(-) diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index 29a13f537d..28d802ded5 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -35,7 +35,6 @@ host_get_params True (void) (ind_vm, void*, smx_host_t) (params, void*, ws_param host_set_params True (void) (ind_vm, void*, smx_host_t) (params, void*, ws_params_t) vm_create True (void*) (name, const char*) (ind_pm, void*, smx_host_t) vm_start True (void) (ind_vm, void*, smx_host_t) -vm_set_state True (void) (ind_vm, void*, smx_host_t) (state, int) vm_get_state True (int) (ind_vm, void*, smx_host_t) vm_migrate True (void) (ind_vm, void*, smx_host_t) (ind_dst_pm, void*, smx_host_t) vm_get_pm True (void*) (ind_vm, void*, smx_host_t) diff --git a/src/simix/simcalls_generated_args_getter_setter.h b/src/simix/simcalls_generated_args_getter_setter.h index 4aa985512e..d87cea3c52 100644 --- a/src/simix/simcalls_generated_args_getter_setter.h +++ b/src/simix/simcalls_generated_args_getter_setter.h @@ -305,18 +305,6 @@ static inline smx_host_t simcall_vm_start__get__ind_vm(smx_simcall_t simcall){ static inline void simcall_vm_start__set__ind_vm(smx_simcall_t simcall, void* arg){ simcall->args[0].dp = arg; } -static inline smx_host_t simcall_vm_set_state__get__ind_vm(smx_simcall_t simcall){ - return (smx_host_t) simcall->args[0].dp; -} -static inline void simcall_vm_set_state__set__ind_vm(smx_simcall_t simcall, void* arg){ - simcall->args[0].dp = arg; -} -static inline int simcall_vm_set_state__get__state(smx_simcall_t simcall){ - return simcall->args[1].i; -} -static inline void simcall_vm_set_state__set__state(smx_simcall_t simcall, int arg){ - simcall->args[1].i = arg; -} static inline smx_host_t simcall_vm_get_state__get__ind_vm(smx_simcall_t simcall){ return (smx_host_t) simcall->args[0].dp; } diff --git a/src/simix/simcalls_generated_body.c b/src/simix/simcalls_generated_body.c index f103ad6e2a..113e5ca24d 100644 --- a/src/simix/simcalls_generated_body.c +++ b/src/simix/simcalls_generated_body.c @@ -474,22 +474,6 @@ SIMIX_simcall_pre(&self->simcall, 0); } - } - inline static void simcall_BODY_vm_set_state(smx_host_t ind_vm, int state) { - smx_process_t self = SIMIX_process_self(); - self->simcall.call = SIMCALL_VM_SET_STATE; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) ind_vm; - self->simcall.args[1].i = (int) state; - if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, - SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); - SIMIX_process_yield(self); - } else { - SIMIX_simcall_pre(&self->simcall, 0); - } - } inline static int simcall_BODY_vm_get_state(smx_host_t ind_vm) { smx_process_t self = SIMIX_process_self(); diff --git a/src/simix/simcalls_generated_case.c b/src/simix/simcalls_generated_case.c index 906cf65c15..59b99ea88d 100644 --- a/src/simix/simcalls_generated_case.c +++ b/src/simix/simcalls_generated_case.c @@ -154,11 +154,6 @@ case SIMCALL_VM_START: SIMIX_simcall_answer(simcall); break; -case SIMCALL_VM_SET_STATE: - SIMIX_pre_vm_set_state(simcall , (smx_host_t) simcall->args[0].dp, simcall->args[1].i); - SIMIX_simcall_answer(simcall); - break; - case SIMCALL_VM_GET_STATE: simcall->result.i = SIMIX_pre_vm_get_state(simcall , (smx_host_t) simcall->args[0].dp); SIMIX_simcall_answer(simcall); diff --git a/src/simix/simcalls_generated_enum.h b/src/simix/simcalls_generated_enum.h index 9156eca4e3..10bfce92a6 100644 --- a/src/simix/simcalls_generated_enum.h +++ b/src/simix/simcalls_generated_enum.h @@ -35,7 +35,6 @@ SIMCALL_HOST_GET_PARAMS, SIMCALL_HOST_SET_PARAMS, SIMCALL_VM_CREATE, SIMCALL_VM_START, -SIMCALL_VM_SET_STATE, SIMCALL_VM_GET_STATE, SIMCALL_VM_MIGRATE, SIMCALL_VM_GET_PM, diff --git a/src/simix/simcalls_generated_res_getter_setter.h b/src/simix/simcalls_generated_res_getter_setter.h index 5c6df780eb..42c9afb61a 100644 --- a/src/simix/simcalls_generated_res_getter_setter.h +++ b/src/simix/simcalls_generated_res_getter_setter.h @@ -141,8 +141,6 @@ static inline void simcall_vm_create__set__result(smx_simcall_t simcall, void* r } - - static inline int simcall_vm_get_state__get__result(smx_simcall_t simcall){ return simcall->result.i; } diff --git a/src/simix/simcalls_generated_string.c b/src/simix/simcalls_generated_string.c index 461d7fea2b..0c97a2036e 100644 --- a/src/simix/simcalls_generated_string.c +++ b/src/simix/simcalls_generated_string.c @@ -35,7 +35,6 @@ [SIMCALL_HOST_SET_PARAMS] = "SIMCALL_HOST_SET_PARAMS", [SIMCALL_VM_CREATE] = "SIMCALL_VM_CREATE", [SIMCALL_VM_START] = "SIMCALL_VM_START", -[SIMCALL_VM_SET_STATE] = "SIMCALL_VM_SET_STATE", [SIMCALL_VM_GET_STATE] = "SIMCALL_VM_GET_STATE", [SIMCALL_VM_MIGRATE] = "SIMCALL_VM_MIGRATE", [SIMCALL_VM_GET_PM] = "SIMCALL_VM_GET_PM", diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 677cdde9cf..3fe2fa7624 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -132,8 +132,6 @@ void SIMIX_pre_vm_start(smx_simcall_t simcall, smx_host_t ind_vm); void SIMIX_vm_shutdown(smx_host_t ind_vm, smx_process_t issuer); void SIMIX_pre_vm_shutdown(smx_simcall_t simcall, smx_host_t ind_vm); // -- -void SIMIX_vm_set_state(smx_host_t ind_vm, int state); -void SIMIX_pre_vm_set_state(smx_simcall_t simcall, smx_host_t ind_vm, int state); int SIMIX_vm_get_state(smx_host_t ind_vm); int SIMIX_pre_vm_get_state(smx_simcall_t simcall, smx_host_t ind_vm); diff --git a/src/simix/smx_vm.c b/src/simix/smx_vm.c index b249b57f53..d6bb3ecf3e 100644 --- a/src/simix/smx_vm.c +++ b/src/simix/smx_vm.c @@ -96,7 +96,7 @@ 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), SURF_VM_STATE_RUNNING); else THROWF(vm_error, 0, "The VM %s cannot be started", SIMIX_host_get_name(ind_vm)); } @@ -108,18 +108,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)); @@ -369,7 +357,7 @@ 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), SURF_VM_STATE_CREATED); } void SIMIX_pre_vm_shutdown(smx_simcall_t simcall, smx_host_t ind_vm) -- 2.20.1