- surf::CpuCas01* sub_cpu = dynamic_cast<surf::CpuCas01*>(pm->pimpl_cpu);
-
- pimpl_cpu = surf_cpu_model_vm->createCpu(this, sub_cpu->getSpeedPeakList(), coreAmount);
- if (sub_cpu->getPState() != 0)
- pimpl_cpu->setPState(sub_cpu->getPState());
-
- /* Make a process container */
- extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
-
- if (TRACE_vm_is_enabled()) {
- container_t host_container = instr::Container::byName(pm->get_name());
- new instr::Container(name, "MSG_VM", host_container);
- instr::Container::byName(get_name())->getState("MSG_VM_STATE")->addEntityValue("start", "0 0 1"); // start is blue
- instr::Container::byName(get_name())
- ->getState("MSG_VM_STATE")
- ->addEntityValue("suspend", "1 0 0"); // suspend is red
- }
+ std::vector<double> speeds;
+ for (int i = 0; i < physical_host->get_pstate_count(); i++)
+ speeds.push_back(physical_host->get_pstate_speed(i));
+
+ surf_cpu_model_vm->create_cpu(this, speeds, core_amount);
+ if (physical_host->get_pstate() != 0)
+ set_pstate(physical_host->get_pstate());