X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1c2027adbae4b33dae8f25289085ec4bdf3e1691..0afad4b7e2215154531cd6b2933af898ec6b781d:/src/plugins/vm/VirtualMachineImpl.hpp diff --git a/src/plugins/vm/VirtualMachineImpl.hpp b/src/plugins/vm/VirtualMachineImpl.hpp index 0dda5ea889..709ff69224 100644 --- a/src/plugins/vm/VirtualMachineImpl.hpp +++ b/src/plugins/vm/VirtualMachineImpl.hpp @@ -16,30 +16,9 @@ #define GUESTOS_NOISE 100 // This value corresponds to the cost of the global action associated to the VM // It corresponds to the cost of a VM running no tasks. -typedef struct s_dirty_page* dirty_page_t; - namespace simgrid { namespace vm { -/************* - * Callbacks * - *************/ - -/** @ingroup SURF_callbacks - * @brief Callbacks fired after VM creation. Signature: `void(VirtualMachine*)` - */ -extern XBT_PRIVATE simgrid::xbt::signal onVmCreation; - -/** @ingroup SURF_callbacks - * @brief Callbacks fired after VM destruction. Signature: `void(VirtualMachine*)` - */ -extern XBT_PRIVATE simgrid::xbt::signal onVmDestruction; - -/** @ingroup SURF_callbacks - * @brief Callbacks after VM State changes. Signature: `void(VirtualMachine*)` - */ -extern XBT_PRIVATE simgrid::xbt::signal onVmStateChange; - /************ * Resource * ************/ @@ -48,7 +27,7 @@ extern XBT_PRIVATE simgrid::xbt::signal * @brief SURF VM interface class * @details A VM represent a virtual machine */ -XBT_PUBLIC_CLASS VirtualMachineImpl : public surf::HostImpl +XBT_PUBLIC_CLASS VirtualMachineImpl : public surf::HostImpl, public simgrid::xbt::Extendable { friend simgrid::s4u::VirtualMachine; @@ -76,27 +55,35 @@ public: virtual void setBound(double bound); - void getParams(vm_params_t params); - void setParams(vm_params_t params); - /* The vm object of the lower layer */ surf::Action* action_ = nullptr; - /* Dirty pages stuff */ - std::unordered_map dp_objs; - bool dp_enabled = false; - double dp_updated_by_deleted_tasks = 0; - e_surf_vm_state_t getState(); void setState(e_surf_vm_state_t state); static std::deque allVms_; int coreAmount() { return coreAmount_; } bool isMigrating = false; + /************* + * Callbacks * + *************/ + /** @ingroup SURF_callbacks + * @brief Callbacks fired after VM creation. Signature: `void(VirtualMachine*)` + */ + static simgrid::xbt::signal onVmCreation; + + /** @ingroup SURF_callbacks + * @brief Callbacks fired after VM destruction. Signature: `void(VirtualMachine*)` + */ + static simgrid::xbt::signal onVmDestruction; + + /** @ingroup SURF_callbacks + * @brief Callbacks after VM State changes. Signature: `void(VirtualMachine*)` + */ + static simgrid::xbt::signal onVmStateChange; private: simgrid::s4u::Host* hostPM_; - s_vm_params_t params_; int coreAmount_; size_t ramsize_ = 0; e_surf_vm_state_t vmState_ = SURF_VM_STATE_CREATED;