#define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
if ((host_nb == 1)
&& (cost_or_zero(bytes_amount, 0) == 0.0))
- return surf_host_execute(host_list[0], flops_amount[0]);
+ return host_list[0]->pimpl_cpu->execute(flops_amount[0]);
else if ((host_nb == 1)
&& (cost_or_zero(flops_amount, 0) == 0.0))
return surf_network_model_communicate(surf_network_model, host_list[0], host_list[0],bytes_amount[0], rate);
* 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->p_netcard;
+ p_netElm = host_PM->pimpl_netcard;
sg_host_t host_VM = sg_host_by_name_or_create(name);
- host_VM->p_netcard = p_netElm;
+ host_VM->pimpl_netcard = p_netElm;
p_vm_state = SURF_VM_STATE_CREATED;
// //// CPU RELATED STUFF ////
// Roughly, create a vcpu resource by using the values of the sub_cpu one.
- CpuCas01 *sub_cpu = static_cast<CpuCas01*>(host_PM->p_cpu);
+ CpuCas01 *sub_cpu = static_cast<CpuCas01*>(host_PM->pimpl_cpu);
p_cpu = surf_cpu_model_vm->createCpu(host_VM, // the machine hosting the VM
sub_cpu->getSpeedPeakList(), // host->power_peak,
*/
void VMHL13::migrate(sg_host_t host_dest)
{
- Host *surfHost_dst = surf_host_resource_priv(host_dest);
+ Host *surfHost_dst = host_dest->extension<Host>();
const char *vm_name = getName();
const char *pm_name_src = p_hostPM->getName().c_str();
const char *pm_name_dst = surfHost_dst->getName();
/* update net_elm with that of the destination physical host */
- sg_host_by_name(vm_name)->p_netcard = p_netElm = sg_host_by_name(pm_name_dst)->p_netcard;
+ sg_host_by_name(vm_name)->pimpl_netcard = p_netElm = sg_host_by_name(pm_name_dst)->pimpl_netcard;
p_hostPM = host_dest;
/* Update vcpu's action for the new pm */
{
/* create a cpu action bound to the pm model at the destination. */
- CpuAction *new_cpu_action = static_cast<CpuAction*>(host_dest->p_cpu->execute(0));
+ CpuAction *new_cpu_action = static_cast<CpuAction*>(host_dest->pimpl_cpu->execute(0));
e_surf_action_state_t state = p_action->getState();
if (state != SURF_ACTION_DONE)