Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
allows for mount of remote disks in file system plugin
[simgrid.git] / src / surf / HostImpl.cpp
index a749282..c037bf9 100644 (file)
@@ -92,6 +92,9 @@ HostImpl::~HostImpl()
   for (auto const& arg : actors_at_boot_)
     delete arg;
   actors_at_boot_.clear();
+
+  for (auto const& d : disks_)
+    d->destroy();
 }
 
 /** Re-starts all the actors that are marked as restartable.
@@ -156,6 +159,23 @@ std::vector<s4u::Disk*> HostImpl::get_disks()
   return disks;
 }
 
+void HostImpl::add_disk(s4u::Disk* disk)
+{
+  disks_.push_back(disk->get_impl());
+}
+
+void HostImpl::remove_disk(std::string disk_name)
+{
+  auto position = disks_.begin();
+  for (auto const& d : disks_) {
+    if (d->get_name() == disk_name) {
+      disks_.erase(position);
+      break;
+    }
+    position++;
+  }
+}
+
 std::vector<const char*> HostImpl::get_attached_storages()
 {
   std::vector<const char*> storages;