Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New way to use storage. See storage.xml
[simgrid.git] / src / surf / storage.c
index 7c323c1..cd57539 100644 (file)
@@ -49,18 +49,18 @@ static surf_action_t storage_action_stat(void *storage, int fd, void* buf)
 static void* storage_create_resource(const char* id, const char* type,
                                     const char* content, xbt_dict_t storage_properties)
 {
-    XBT_DEBUG("Storage_create_resource '%s' at level SURF_STORAGE_LEVEL",id);
-    surf_storage_t storage = NULL;
-    xbt_assert(!surf_storage_resource_by_name(id),
-                "Storage '%s' declared several times in the platform file",
-                id);
-    storage = (surf_storage_t) surf_resource_new(sizeof(s_surf_storage_t),
-            surf_storage_model, id, storage_properties);
-    storage->type = type;
-    storage->content = content;
-    xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage);
+  xbt_assert(!surf_storage_resource_by_name(id),
+      "Storage '%s' declared several times in the platform file",
+      id);
+  XBT_DEBUG("Storage_create_resource '%s' at level SURF_STORAGE_LEVEL",id);
+  surf_storage_t storage = NULL;
+  storage = (surf_storage_t) surf_resource_new(sizeof(s_surf_storage_t),
+      surf_storage_model, id, storage_properties);
+  storage->type = type;
+  storage->content = content;
+  xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage);
 
-    return storage;
+  return storage;
 }
 
 static void storage_finalize(void)
@@ -136,15 +136,30 @@ static void storage_action_set_priority(surf_action_t action, double priority)
 
 static void parse_storage_init(sg_platf_storage_cbarg_t storage)
 {
-  storage_create_resource(storage->id,
-      storage->type,
-      storage->content,
-      storage->properties);
+  XBT_INFO("parse_storage_init");
+}
+
+static void parse_mstorage_init(sg_platf_mstorage_cbarg_t mstorage)
+{
+  XBT_INFO("parse_mstorage_init");
+}
+
+static void parse_storage_type_init(sg_platf_storage_type_cbarg_t storagetype_)
+{
+  XBT_INFO("parse_storage_type_init");
+}
+
+static void parse_mount_init(sg_platf_mount_cbarg_t mount)
+{
+  XBT_INFO("parse_mount_init");
 }
 
 static void storage_define_callbacks()
 {
   sg_platf_storage_add_cb(parse_storage_init);
+  sg_platf_mstorage_add_cb(parse_mstorage_init);
+  sg_platf_storage_type_add_cb(parse_storage_type_init);
+  sg_platf_mount_add_cb(parse_mount_init);
 }
 
 static void surf_storage_model_init_internal(void)