Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s4u::Host: moving create_disk impl to HostImpl
[simgrid.git] / src / surf / HostImpl.cpp
index 5be123b..7b34661 100644 (file)
@@ -3,6 +3,7 @@
 /* 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"
@@ -135,6 +136,13 @@ HostImpl* HostImpl::set_disks(const std::vector<kernel::resource::DiskImpl*>& di
   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());