Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I/O factors: noise for disks.
[simgrid.git] / src / kernel / resource / DiskImpl.cpp
index dc09449..7b1fca1 100644 (file)
@@ -156,6 +156,12 @@ void DiskImpl::apply_sharing_policy_cfg()
                                           sharing_policy_cb_[s4u::Disk::Operation::WRITE]);
 }
 
+void DiskImpl::set_factor_cb(const std::function<s4u::Disk::IoFactorCb>& cb)
+{
+  xbt_assert(not is_sealed(), "Cannot set I/O factor callback in an already sealed disk(%s)", get_cname());
+  factor_cb_ = cb;
+}
+
 /**********
  * Action *
  **********/