Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge lmm into base to avoid diamond inheritance
[simgrid.git] / src / surf / vm_workstation_interface.hpp
1 /*
2  * vm_workstation.hpp
3  *
4  *  Created on: Nov 12, 2013
5  *      Author: bedaride
6  */
7 #include "workstation_interface.hpp"
8
9 #ifndef VM_WORKSTATION_INTERFACE_HPP_
10 #define VM_WORKSTATION_INTERFACE_HPP_
11
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.
14
15 void surf_vm_workstation_model_init(void);
16
17 /***********
18  * Classes *
19  ***********/
20
21 class WorkstationVMModel;
22 typedef WorkstationVMModel *WorkstationVMModelPtr;
23
24 class WorkstationVM;
25 typedef WorkstationVM *WorkstationVMPtr;
26
27 class WorkstationVMLmm;
28 typedef WorkstationVMLmm *WorkstationVMLmmPtr;
29
30 /*********
31  * Model *
32  *********/
33
34 class WorkstationVMModel : virtual public WorkstationModel {
35 public:
36   WorkstationVMModel();
37   ~WorkstationVMModel(){};
38   virtual void createResource(const char *name, void *ind_phys_workstation)=0;
39   void adjustWeightOfDummyCpuActions() {};
40 };
41
42 /************
43  * Resource *
44  ************/
45
46 class WorkstationVM : public Workstation {
47 public:
48   WorkstationVM(ModelPtr model, const char *name, xbt_dict_t props,
49                         RoutingEdgePtr netElm, CpuPtr cpu)
50   : Workstation(model, name, props, NULL, netElm, cpu) {}
51   ~WorkstationVM();
52
53   virtual void suspend()=0;
54   virtual void resume()=0;
55
56   virtual void save()=0;
57   virtual void restore()=0;
58
59   virtual void migrate(surf_resource_t ind_vm_ws_dest)=0; // will be vm_ws_migrate()
60
61   virtual surf_resource_t getPm()=0; // will be vm_ws_get_pm()
62
63   virtual void setBound(double bound)=0;
64   virtual void setAffinity(CpuPtr cpu, unsigned long mask)=0;
65
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;
70 };
71
72
73 /**********
74  * Action *
75  **********/
76
77 #endif /* VM_WORKSTATION_INTERFACE_HPP_ */