X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5b3677b425b9cc6949c1573d59ac772540cbf4b2..9a74a4d9c970bf6b49d2c15d284ca190451d5ef6:/src/surf/vm_workstation_interface.cpp diff --git a/src/surf/vm_workstation_interface.cpp b/src/surf/vm_workstation_interface.cpp index 46299a4c70..688ad12418 100644 --- a/src/surf/vm_workstation_interface.cpp +++ b/src/surf/vm_workstation_interface.cpp @@ -28,6 +28,8 @@ WorkstationVMModel::WorkstationVMModel() : WorkstationModel("Virtual Workstation p_cpuModel = surf_cpu_model_vm; } +WorkstationVMModel::vm_list_t WorkstationVMModel::ws_vms; + /************ * Resource * ************/ @@ -36,6 +38,7 @@ WorkstationVM::WorkstationVM(ModelPtr model, const char *name, xbt_dict_t props, RoutingEdgePtr netElm, CpuPtr cpu) : Workstation(model, name, props, NULL, netElm, cpu) { + WorkstationVMModel::ws_vms.push_back(*this); surf_callback_emit(workstationVMCreatedCallbacks, this); } @@ -46,6 +49,8 @@ WorkstationVM::WorkstationVM(ModelPtr model, const char *name, xbt_dict_t props, WorkstationVM::~WorkstationVM() { surf_callback_emit(workstationVMDestructedCallbacks, this); + WorkstationVMModel::ws_vms.erase(WorkstationVMModel:: + vm_list_t::s_iterator_to(*this)); } void WorkstationVM::setState(e_surf_resource_state_t state){