Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge tag 'v3_9_90' into hypervisor
[simgrid.git] / src / simix / smx_new_api.c
index 7c5498d..df2510a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -68,9 +68,9 @@ smx_action_t SIMIX_new_api_fct(smx_process_t process, const char* param1, double
 
   /* check if the host is active */
   if (surf_workstation_model->extension.
-      workstation.get_state(host->host) != SURF_RESOURCE_ON) {
+      workstation.get_state(host) != SURF_RESOURCE_ON) {
     THROWF(host_error, 0, "Host %s failed, you cannot call this function",
-           host->name);
+           sg_host_name(host));
   }
 
   action = xbt_mallocator_get(simix_global->action_mallocator);
@@ -93,7 +93,7 @@ void SIMIX_new_api_destroy(smx_action_t action)
 {
   XBT_DEBUG("Destroy action %p", action);
   if (action->new_api.surf_new_api)
-    action->new_api.surf_new_api->model_type->action_unref(action->new_api.surf_new_api);
+    action->new_api.surf_new_api->model_obj->action_unref(action->new_api.surf_new_api);
   xbt_mallocator_release(simix_global->action_mallocator, action);
 }
 
@@ -124,7 +124,7 @@ void SIMIX_new_api_finish(smx_action_t action)
     }
 
     if (surf_workstation_model->extension.
-        workstation.get_state(simcall->issuer->smx_host->host) != SURF_RESOURCE_ON) {
+        workstation.get_state(simcall->issuer->smx_host) != SURF_RESOURCE_ON) {
       simcall->issuer->context->iwannadie = 1;
     }