Host *HostModel::createHost(const char *name,NetCard *netElm, Cpu *cpu, xbt_dict_t props){
xbt_dynar_t storageList = (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL);
- Host *host = new simgrid::surf::Host(surf_host_model, name, props,
- storageList, netElm, cpu);
+ Host *host = new simgrid::surf::Host(surf_host_model, name, props, storageList, cpu);
XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->p_storage));
return host;
}
simgrid::surf::signal<void(simgrid::surf::Host*)> Host::onStateChange;
Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
- xbt_dynar_t storage, NetCard *netElm, Cpu *cpu)
+ xbt_dynar_t storage, Cpu *cpu)
: Resource(model, name)
, PropertyHolder(props)
- , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
+ , p_storage(storage), p_cpu(cpu)
{
p_params.ramsize = 0;
}
Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint,
- xbt_dynar_t storage, NetCard *netElm, Cpu *cpu)
+ xbt_dynar_t storage, Cpu *cpu)
: Resource(model, name, constraint)
, PropertyHolder(props)
- , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
+ , p_storage(storage), p_cpu(cpu)
{
p_params.ramsize = 0;
}
* @param name The name of the Host
* @param props Dictionary of properties associated to this Host
* @param storage The Storage associated to this Host
- * @param netElm The RoutingEdge associated to this Host
* @param cpu The Cpu associated to this Host
*/
Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
- xbt_dynar_t storage, NetCard *netElm, Cpu *cpu);
+ xbt_dynar_t storage, Cpu *cpu);
/**
* @brief Host constructor
* @param props Dictionary of properties associated to this Host
* @param constraint The lmm constraint associated to this Host if it is part of a LMM component
* @param storage The Storage associated to this Host
- * @param netElm The RoutingEdge associated to this Host
* @param cpu The Cpu associated to this Host
*/
Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
- lmm_constraint_t constraint, xbt_dynar_t storage, NetCard *netElm,
- Cpu *cpu);
+ lmm_constraint_t constraint, xbt_dynar_t storage, Cpu *cpu);
/* Host destruction logic */
/**************************/
public:
xbt_dynar_t p_storage;
- NetCard *p_netElm;
Cpu *p_cpu;
simgrid::Host* p_host = nullptr;
xbt_dynar_t surf_host_model_get_route(surf_host_model_t /*model*/,
sg_host_t src, sg_host_t dst){
xbt_dynar_t route = NULL;
- routing_platf->getRouteAndLatency(
- get_casted_host(src)->p_netElm,
- get_casted_host(dst)->p_netElm, &route, NULL);
+ routing_platf->getRouteAndLatency(src->pimpl_netcard, dst->pimpl_netcard, &route, NULL);
return route;
}
* from the VM name, we have to make sure that the system does not call the
* free callback for the network resource object. The network resource object
* is still used by the physical machine. */
- p_netElm = host_PM->pimpl_netcard;
sg_host_t host_VM = sg_host_by_name_or_create(name);
- host_VM->pimpl_netcard = p_netElm;
+ host_VM->pimpl_netcard = host_PM->pimpl_netcard;
p_vm_state = SURF_VM_STATE_CREATED;
const char *pm_name_dst = surfHost_dst->getName();
/* update net_elm with that of the destination physical host */
- sg_host_by_name(vm_name)->pimpl_netcard = p_netElm = sg_host_by_name(pm_name_dst)->pimpl_netcard;
+ sg_host_by_name(vm_name)->pimpl_netcard = sg_host_by_name(pm_name_dst)->pimpl_netcard;
p_hostPM = host_dest;