Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar cleanups: pass large objects by const reference
[simgrid.git] / src / s4u / s4u_Host.cpp
index a4aad5c..b9b273c 100644 (file)
@@ -287,9 +287,10 @@ std::vector<const char*> Host::get_attached_storages() const
 
 std::unordered_map<std::string, Storage*> const& Host::get_mounted_storages()
 {
-  if (mounts_ == nullptr)
-    mounts_ = pimpl_->get_mounted_storages();
-
+  kernel::actor::simcall([this] {
+    if (mounts_ == nullptr)
+      mounts_ = pimpl_->get_mounted_storages();
+  });
   return *mounts_;
 }
 
@@ -389,7 +390,7 @@ void sg_host_user_destroy(sg_host_t host) // deprecated
 }
 
 // ========= storage related functions ============
-void sg_host_disks(sg_host_t host, unsigned int* disk_count, sg_disk_t** disks)
+void sg_host_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks)
 {
   std::vector<sg_disk_t> list = host->get_disks();
   *disk_count                 = list.size();