+ // Setting the disk may allow to start the activity, let's try
+ if (state_ == State::STARTING)
+ vetoable_start();
+
+ return this;
+}
+
+IoPtr Io::set_priority(double priority)
+{
+ xbt_assert(state_ == State::INITED || state_ == State::STARTING,
+ "Cannot change the priority of an io after its start");
+ kernel::actor::simcall_answered([this, priority] {
+ boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->set_sharing_penalty(1. / priority);
+ });
+ return this;
+}
+
+IoPtr Io::set_size(sg_size_t size)
+{
+ xbt_assert(state_ == State::INITED || state_ == State::STARTING, "Cannot set size once the Io is started");
+ kernel::actor::simcall_answered(
+ [this, size] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->set_size(size); });
+ set_remaining(size);
+ return this;
+}
+
+IoPtr Io::set_op_type(OpType type)
+{
+ xbt_assert(state_ == State::INITED || state_ == State::STARTING, "Cannot set size once the Io is started");
+ kernel::actor::simcall_answered(
+ [this, type] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->set_type(type); });
+ return this;
+}
+
+IoPtr Io::update_priority(double priority)
+{
+ kernel::actor::simcall_answered([this, priority] {
+ boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->update_sharing_penalty(1. / priority);
+ });
+ return this;