X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/347f9a2ca55bffc88bf965952b9be3a15535e908..471fea6efe44cedfedf6af1f62aa4eb9bc9c3abd:/src/surf/virtual_machine.hpp diff --git a/src/surf/virtual_machine.hpp b/src/surf/virtual_machine.hpp index baef9f2e76..c28b44dd34 100644 --- a/src/surf/virtual_machine.hpp +++ b/src/surf/virtual_machine.hpp @@ -62,14 +62,12 @@ public: * @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; @@ -94,7 +92,17 @@ public: /* 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; }; @@ -111,8 +119,6 @@ public: VMModel() :HostModel(){} ~VMModel(){}; - Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu,xbt_dict_t props) override {DIE_IMPOSSIBLE;} - /** * @brief Create a new VM *