/*********
* Model *
*********/
-HostImpl *HostModel::createHost(const char *name, kernel::routing::NetCard *netElm, Cpu *cpu){
- xbt_dynar_t storageList = (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL);
-
+HostImpl* HostModel::createHost(const char* name, Cpu* cpu, kernel::routing::NetCard* netcard, xbt_dynar_t storageList)
+{
HostImpl *host = new simgrid::surf::HostImpl(surf_host_model, name, storageList, cpu);
+ xbt_lib_set(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL, (void*)storageList);
+
XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->storage_));
return host;
}
public:
HostModel() : Model() {}
- HostImpl *createHost(const char *name, kernel::routing::NetCard *net, Cpu *cpu);
+ HostImpl* createHost(const char* name, Cpu* cpu, kernel::routing::NetCard* net, xbt_dynar_t storageList);
virtual void adjustWeightOfDummyCpuActions();
virtual Action *executeParallelTask(int host_nb, sg_host_t *host_list,
surf_parse_lex_destroy();
}
-/** @brief Add an "host" to the current AS */
+/** @brief Add an host to the current AS */
void sg_platf_new_host(sg_platf_host_cbarg_t host)
{
simgrid::kernel::routing::AsImpl* current_routing = routing_get_current();
simgrid::s4u::Host* h = new simgrid::s4u::Host(host->id);
h->pimpl_netcard = netcard;
- if(mount_list) {
- xbt_lib_set(storage_lib, host->id, ROUTING_STORAGE_HOST_LEVEL, (void *) mount_list);
- mount_list = nullptr;
- }
-
if (host->coord && strcmp(host->coord, "")) {
unsigned int cursor;
char*str;
cpu->setStateTrace(host->state_trace);
if (host->speed_trace)
cpu->setSpeedTrace(host->speed_trace);
- surf_host_model->createHost(host->id, netcard, cpu)->attach(h);
+
+ surf_host_model->createHost(host->id, cpu, netcard, mount_list)->attach(h);
+ mount_list = nullptr;
if (host->properties) {
xbt_dict_cursor_t cursor=nullptr;