Disk* Host::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
{
- auto disk =
- this->get_netpoint()->get_englobing_zone()->get_disk_model()->create_disk(name, read_bandwidth, write_bandwidth);
- return disk->set_host(this)->get_iface();
+ return kernel::actor::simcall([this, &name, read_bandwidth, write_bandwidth] {
+ return this->pimpl_->create_disk(name, read_bandwidth, write_bandwidth);
+ });
}
void Host::add_disk(const Disk* disk)
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
return this;
}
+s4u::Disk* HostImpl::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
+{
+ auto disk = piface_.get_netpoint()->get_englobing_zone()->get_disk_model()->create_disk(name, read_bandwidth,
+ write_bandwidth);
+ return disk->set_host(&piface_)->get_iface();
+}
+
void HostImpl::add_disk(const s4u::Disk* disk)
{
disks_.push_back(disk->get_impl());
std::vector<s4u::Disk*> get_disks() const;
HostImpl* set_disks(const std::vector<kernel::resource::DiskImpl*>& disks);
+ s4u::Disk* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth);
void add_disk(const s4u::Disk* disk);
void remove_disk(const std::string& disk_name);