X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7b138f8b1ed3e8816eda5cb26deb71fe81b4087a..cc9460b0958168a1f9adec8208d190bf128ce6cc:/src/surf/vm_hl13.cpp diff --git a/src/surf/vm_hl13.cpp b/src/surf/vm_hl13.cpp index 90855a80c6..9dd72aae81 100644 --- a/src/surf/vm_hl13.cpp +++ b/src/surf/vm_hl13.cpp @@ -11,11 +11,10 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_vm); -void surf_vm_model_init_HL13(void){ +void surf_vm_model_init_HL13(){ if (surf_cpu_model_vm) { surf_vm_model = new simgrid::surf::VMHL13Model(); - simgrid::surf::Model *model = surf_vm_model; - xbt_dynar_push(all_existing_models, &model); + all_existing_models->push_back(surf_vm_model); } } @@ -29,11 +28,11 @@ VMHL13Model::VMHL13Model() : VMModel() {} void VMHL13Model::updateActionsState(double /*now*/, double /*delta*/) {} -VirtualMachine *VMHL13Model::createVM(const char *name, sg_host_t host_PM) +s4u::Host *VMHL13Model::createVM(const char *name, sg_host_t host_PM) { VirtualMachine* vm = new VMHL13(this, name, host_PM); - VMCreatedCallbacks(vm); - return vm; + onVmCreation(vm); + return vm->piface; } /* In the real world, processes on the guest operating system will be somewhat degraded due to virtualization overhead. @@ -68,8 +67,7 @@ double VMHL13Model::next_occuring_event(double now) **/ /* iterate for all virtual machines */ - for (VMModel::vm_list_t::iterator iter = VMModel::ws_vms.begin(); iter != VMModel::ws_vms.end(); ++iter) { - VirtualMachine *ws_vm = &*iter; + for (VirtualMachine *ws_vm : VirtualMachine::allVms_) { Cpu *cpu = ws_vm->p_cpu; xbt_assert(cpu, "cpu-less host"); @@ -203,9 +201,5 @@ void VMHL13::setBound(double bound){ action_->setBound(bound); } -void VMHL13::setAffinity(Cpu *cpu, unsigned long mask){ - action_->setAffinity(cpu, mask); -} - } }