Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix MSG_storage_get_properties()
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Wed, 18 Sep 2013 12:22:46 +0000 (14:22 +0200)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Wed, 18 Sep 2013 12:22:46 +0000 (14:22 +0200)
src/msg/msg_io.c
src/surf/storage.c

index 10a6d67..d69d762 100644 (file)
@@ -214,16 +214,6 @@ const char *MSG_storage_get_name(msg_storage_t storage) {
 }
 
 /** \ingroup msg_storage_management
- * \brief Finds a msg_storage_t using its name.
- * \param name the name of a storage.
- * \return the corresponding storage
- */
-msg_host_t MSG_get_storage_by_name(const char *name)
-{
-  return (msg_storage_t) xbt_lib_get_elm_or_null(storage_lib,name);
-}
-
-/** \ingroup msg_storage_management
  * \brief Returns the free space size of a storage element
  * \param the storage name (#char*)
  * \return the free space size of the storage element (as a size_t)
@@ -296,11 +286,9 @@ msg_error_t MSG_storage_set_data(msg_storage_t storage, void *data)
   return MSG_OK;
 }
 
-
-
 /** \ingroup msg_host_management
  *
- * \brief Return the user data of a #msg_storage_t.
+ * \brief Returns the user data of a #msg_storage_t.
  *
  * This functions checks whether \a storage is a valid pointer or not and return
    the user data associated to \a storage if it is possible.
@@ -310,11 +298,3 @@ void *MSG_storage_get_data(msg_storage_t storage)
   return SIMIX_storage_get_data(storage);
 }
 
-
-
-
-
-
-
-
-
index 8584505..e00a721 100644 (file)
@@ -194,18 +194,18 @@ static surf_action_t storage_action_execute (void *storage, size_t size, e_surf_
 
 static xbt_dict_t storage_get_properties(const void *storage)
 {
-  return surf_resource_properties(storage);
+  return surf_resource_properties(surf_storage_resource_priv(storage));
 }
 
 static void* storage_create_resource(const char* id, const char* model,
-    const char* type_id, const char* content_name, const char* content_type){
+    const char* type_id, const char* content_name, const char* content_type, xbt_dict_t properties){
   storage_t storage = NULL;
 
   xbt_assert(!surf_storage_resource_priv(surf_storage_resource_by_name(id)),
               "Storage '%s' declared several times in the platform file",
               id);
   storage = (storage_t) surf_resource_new(sizeof(s_storage_t),
-          surf_storage_model, id,NULL);
+          surf_storage_model, id, properties);
 
   storage->generic_resource.name = xbt_strdup(id);
   storage->state_current = SURF_RESOURCE_ON;
@@ -213,7 +213,6 @@ static void* storage_create_resource(const char* id, const char* model,
   storage->size = 0;
   storage->write_actions = xbt_dynar_new(sizeof(char *),NULL);
 
-
   storage_type_t storage_type = xbt_lib_get_or_null(storage_type_lib, type_id,ROUTING_STORAGE_TYPE_LEVEL);
   double Bread =
       surf_parse_get_bandwidth(xbt_dict_get(storage_type->properties,"Bread"));
@@ -445,7 +444,8 @@ static void parse_storage_init(sg_platf_storage_cbarg_t storage)
      ((storage_type_t) stype)->model,
      ((storage_type_t) stype)->type_id,
      storage->content,
-     storage->content_type);
+     storage->content_type,
+     storage->properties);
 }
 
 static void parse_mstorage_init(sg_platf_mstorage_cbarg_t mstorage)