X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/662f44287e3fd62ebdf93b4c8173603dde9693b7..7b02515baed02f4f6b8808eb16b0e0175eb53395:/src/surf/workstation_interface.cpp diff --git a/src/surf/workstation_interface.cpp b/src/surf/workstation_interface.cpp index 1b41b0cf1a..9d93ab5296 100644 --- a/src/surf/workstation_interface.cpp +++ b/src/surf/workstation_interface.cpp @@ -170,7 +170,7 @@ StoragePtr Workstation::findStorageOnMountList(const char* mount) return st; } -xbt_dict_t Workstation::getStorageList() +xbt_dict_t Workstation::getMountedStorageList() { s_mount_t mnt; unsigned int i; @@ -184,6 +184,24 @@ xbt_dict_t Workstation::getStorageList() return storage_list; } +xbt_dict_t Workstation::getAttachedStorageList() +{ + xbt_lib_cursor_t cursor; + char *key; + void **data; + xbt_dict_t res = xbt_dict_new_homogeneous(NULL); + xbt_lib_foreach(storage_lib, cursor, key, data) { + if(routing_get_network_element_type(key) == SURF_STORAGE_LEVEL) { + xbt_dictelm_t elm = xbt_dict_cursor_get_elm(cursor); + if ( (static_cast(surf_storage_resource_priv(surf_storage_resource_by_name((const char*)elm))))->p_attach == this->getName()) + xbt_dict_set(res,(const char*)elm,xbt_lib_get_level(elm,MSG_STORAGE_LEVEL),NULL); + } + } + return res; + +} + + ActionPtr Workstation::open(const char* mount, const char* path) { StoragePtr st = findStorageOnMountList(mount); XBT_DEBUG("OPEN on disk '%s'", st->getName());