A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
convert the last vm simcall into s4u code
[simgrid.git]
/
src
/
plugins
/
vm
/
VirtualMachineImpl.hpp
diff --git
a/src/plugins/vm/VirtualMachineImpl.hpp
b/src/plugins/vm/VirtualMachineImpl.hpp
index
353f9a9
..
2c6e95e
100644
(file)
--- a/
src/plugins/vm/VirtualMachineImpl.hpp
+++ b/
src/plugins/vm/VirtualMachineImpl.hpp
@@
-19,7
+19,7
@@
// It corresponds to the cost of a VM running no tasks.
namespace simgrid {
// It corresponds to the cost of a VM running no tasks.
namespace simgrid {
-namespace
surf
{
+namespace
vm
{
/***********
* Classes *
/***********
* Classes *
@@
-35,17
+35,17
@@
class XBT_PRIVATE VirtualMachineImpl;
/** @ingroup SURF_callbacks
* @brief Callbacks fired after VM creation. Signature: `void(VirtualMachine*)`
*/
/** @ingroup SURF_callbacks
* @brief Callbacks fired after VM creation. Signature: `void(VirtualMachine*)`
*/
-extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::
surf
::VirtualMachineImpl*)> onVmCreation;
+extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::
vm
::VirtualMachineImpl*)> onVmCreation;
/** @ingroup SURF_callbacks
* @brief Callbacks fired after VM destruction. Signature: `void(VirtualMachine*)`
*/
/** @ingroup SURF_callbacks
* @brief Callbacks fired after VM destruction. Signature: `void(VirtualMachine*)`
*/
-extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::
surf
::VirtualMachineImpl*)> onVmDestruction;
+extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::
vm
::VirtualMachineImpl*)> onVmDestruction;
/** @ingroup SURF_callbacks
* @brief Callbacks after VM State changes. Signature: `void(VirtualMachine*)`
*/
/** @ingroup SURF_callbacks
* @brief Callbacks after VM State changes. Signature: `void(VirtualMachine*)`
*/
-extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::
surf
::VirtualMachineImpl*)> onVmStateChange;
+extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::
vm
::VirtualMachineImpl*)> onVmStateChange;
/************
* Resource *
/************
* Resource *
@@
-55,25
+55,30
@@
extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachineImpl*)
* @brief SURF VM interface class
* @details A VM represent a virtual machine
*/
* @brief SURF VM interface class
* @details A VM represent a virtual machine
*/
-class VirtualMachineImpl : public HostImpl {
+class VirtualMachineImpl : public surf::HostImpl {
+ friend simgrid::s4u::VirtualMachine;
+
public:
explicit VirtualMachineImpl(s4u::VirtualMachine* piface, s4u::Host* host);
~VirtualMachineImpl();
/** @brief Suspend the VM */
public:
explicit VirtualMachineImpl(s4u::VirtualMachine* piface, s4u::Host* host);
~VirtualMachineImpl();
/** @brief Suspend the VM */
- virtual void suspend();
+ virtual void suspend(
smx_actor_t issuer
);
/** @brief Resume the VM */
virtual void resume();
/** @brief Resume the VM */
virtual void resume();
- /** @brief Save
the VM (Not yet implemented)
*/
- virtual void save();
+ /** @brief Save
(suspend+store on disk) the VM
*/
+ virtual void save(
smx_actor_t issuer
);
- /** @brief Restore
the VM (Not yet implemented)
*/
+ /** @brief Restore
(read from disk+resume) the VM
*/
virtual void restore();
virtual void restore();
- /** @brief Migrate the VM to the destination host */
- virtual void migrate(s4u::Host* dest);
+ /** @brief Shutdown the VM */
+ virtual void shutdown(smx_actor_t issuer);
+
+ /** @brief Change the physical host on which the given VM is running */
+ virtual void setPm(s4u::Host* dest);
/** @brief Get the physical machine hosting the VM */
s4u::Host* getPm();
/** @brief Get the physical machine hosting the VM */
s4u::Host* getPm();
@@
-86,7
+91,7
@@
public:
void setParams(vm_params_t params);
/* The vm object of the lower layer */
void setParams(vm_params_t params);
/* The vm object of the lower layer */
- Action* action_ = nullptr;
+
surf::
Action* action_ = nullptr;
/* Dirty pages stuff */
int dp_enabled = 0;
/* Dirty pages stuff */
int dp_enabled = 0;
@@
-117,7
+122,7
@@
protected:
* @brief SURF VM model interface class
* @details A model is an object which handle the interactions between its Resources and its Actions
*/
* @brief SURF VM model interface class
* @details A model is an object which handle the interactions between its Resources and its Actions
*/
-class VMModel : public HostModel {
+class VMModel : public
surf::
HostModel {
public:
void adjustWeightOfDummyCpuActions() override{};
public:
void adjustWeightOfDummyCpuActions() override{};
@@
-127,4
+132,6
@@
public:
}
}
}
}
+XBT_PUBLIC_DATA(simgrid::vm::VMModel*) surf_vm_model;
+
#endif /* VM_INTERFACE_HPP_ */
#endif /* VM_INTERFACE_HPP_ */