Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove vm set state simcall
authorPaul Bédaride <paul.bedaride@gmail.com>
Thu, 13 Feb 2014 10:29:11 +0000 (11:29 +0100)
committerPaul Bédaride <paul.bedaride@gmail.com>
Thu, 13 Feb 2014 13:22:23 +0000 (14:22 +0100)
src/simix/simcalls.in
src/simix/simcalls_generated_args_getter_setter.h
src/simix/simcalls_generated_body.c
src/simix/simcalls_generated_case.c
src/simix/simcalls_generated_enum.h
src/simix/simcalls_generated_res_getter_setter.h
src/simix/simcalls_generated_string.c
src/simix/smx_host_private.h
src/simix/smx_vm.c

index 29a13f5..28d802d 100644 (file)
@@ -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)
index 4aa9855..d87cea3 100644 (file)
@@ -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;
 }
index f103ad6..113e5ca 100644 (file)
       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();
index 906cf65..59b99ea 100644 (file)
@@ -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);
index 9156eca..10bfce9 100644 (file)
@@ -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,
index 5c6df78..42c9afb 100644 (file)
@@ -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;
 }
index 461d7fe..0c97a20 100644 (file)
@@ -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",
index 677cdde..3fe2fa7 100644 (file)
@@ -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);
index b249b57..d6bb3ec 100644 (file)
@@ -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)