4 * Created on: Nov 12, 2013
7 #include "workstation_interface.hpp"
9 #ifndef VM_WORKSTATION_INTERFACE_HPP_
10 #define VM_WORKSTATION_INTERFACE_HPP_
12 #define GUESTOS_NOISE 100 // This value corresponds to the cost of the global action associated to the VM
13 // It corresponds to the cost of a VM running no tasks.
15 void surf_vm_workstation_model_init(void);
21 class WorkstationVMModel;
22 typedef WorkstationVMModel *WorkstationVMModelPtr;
25 typedef WorkstationVM *WorkstationVMPtr;
27 class WorkstationVMLmm;
28 typedef WorkstationVMLmm *WorkstationVMLmmPtr;
34 class WorkstationVMModel : public WorkstationModel {
37 ~WorkstationVMModel(){};
38 virtual void createResource(const char *name, void *ind_phys_workstation)=0;
39 void adjustWeightOfDummyCpuActions() {};
46 class WorkstationVM : public Workstation {
48 WorkstationVM(ModelPtr model, const char *name, xbt_dict_t props,
49 RoutingEdgePtr netElm, CpuPtr cpu)
50 : Workstation(model, name, props, NULL, netElm, cpu) {}
53 virtual void suspend()=0;
54 virtual void resume()=0;
56 virtual void save()=0;
57 virtual void restore()=0;
59 virtual void migrate(surf_resource_t ind_vm_ws_dest)=0; // will be vm_ws_migrate()
61 virtual surf_resource_t getPm()=0; // will be vm_ws_get_pm()
63 virtual void setBound(double bound)=0;
64 virtual void setAffinity(CpuPtr cpu, unsigned long mask)=0;
66 /* The workstation object of the lower layer */
67 CpuActionPtr p_action;
68 WorkstationPtr p_subWs; // Pointer to the ''host'' OS
69 e_surf_vm_state_t p_currentState;
77 #endif /* VM_WORKSTATION_INTERFACE_HPP_ */