* @param netElm The RoutingEdge associated to this VM
* @param cpu The Cpu associated to this VM
*/
- VirtualMachine(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
+ VirtualMachine(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props,
simgrid::Host *host);
/** @brief Destructor */
~VirtualMachine();
- void setState(e_surf_resource_state_t state);
-
/** @brief Suspend the VM */
virtual void suspend()=0;
/* The vm object of the lower layer */
CpuAction *p_action;
simgrid::Host *p_hostPM;
- e_surf_vm_state_t p_currentState;
+
+ void turnOn() override;
+ void turnOff() override;
+
+public:
+ e_surf_vm_state_t getState();
+ void setState(e_surf_vm_state_t state);
+protected:
+ e_surf_vm_state_t p_vm_state = SURF_VM_STATE_CREATED;
+
+
public:
boost::intrusive::list_member_hook<> vm_hook;
};
VMModel() :HostModel(){}
~VMModel(){};
- Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu,xbt_dict_t props) override {DIE_IMPOSSIBLE;}
-
/**
* @brief Create a new VM
*