+ Storage* st = nullptr;
+ size_t longest_prefix_length = 0;
+ std::string path;
+ XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath, host->cname());
+
+ for (auto mnt : host->mountedStorages()) {
+ XBT_DEBUG("See '%s'", mnt.first.c_str());
+ mount_point = std::string(fullpath).substr(0, mnt.first.size());
+
+ if (mount_point == mnt.first && mnt.first.length() > longest_prefix_length) {
+ /* The current mount name is found in the full path and is bigger than the previous*/
+ longest_prefix_length = mnt.first.length();
+ st = mnt.second;
+ }
+ }
+ if (longest_prefix_length > 0) { /* Mount point found, split fullpath into mount_name and path+filename*/
+ mount_point = std::string(fullpath).substr(0, longest_prefix_length);
+ path = std::string(fullpath).substr(longest_prefix_length, strlen(fullpath));
+ } else
+ xbt_die("Can't find mount point for '%s' on '%s'", fullpath, host->cname());
+
+ pimpl_ = simcall_file_open(mount_point.c_str(), path.c_str(), st);
+ storage_type = st->type();
+ storageId = st->name();