Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
get rid of the vm_params struct
[simgrid.git] / src / plugins / vm / s4u_VirtualMachine.cpp
index 8bda7e7..403a647 100644 (file)
@@ -3,11 +3,13 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "simgrid/s4u/Actor.hpp"
 #include "src/instr/instr_private.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/plugins/vm/VmHostExt.hpp"
 #include "src/simix/smx_host_private.hpp"
 #include "src/surf/cpu_cas01.hpp"
+#include <src/plugins/vm/VmLiveMigration.hpp>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_vm, "S4U virtual machines");
 
@@ -104,6 +106,12 @@ void VirtualMachine::resume()
   pimpl_vm_->resume();
 }
 
+void VirtualMachine::shutdown()
+{
+  smx_actor_t issuer = SIMIX_process_self();
+  simgrid::simix::kernelImmediate([this, issuer]() { pimpl_vm_->shutdown(issuer); });
+}
+
 bool VirtualMachine::isMigrating()
 {
   return pimpl_vm_ && pimpl_vm_->isMigrating;
@@ -114,6 +122,11 @@ simgrid::s4u::Host* VirtualMachine::getPm()
   return pimpl_vm_->getPm();
 }
 
+void VirtualMachine::setPm(simgrid::s4u::Host* pm)
+{
+  simgrid::simix::kernelImmediate([this, pm]() { pimpl_vm_->setPm(pm); });
+}
+
 e_surf_vm_state_t VirtualMachine::getState()
 {
   return pimpl_vm_->getState();
@@ -158,17 +171,6 @@ void VirtualMachine::setBound(double bound)
 {
   simgrid::simix::kernelImmediate([this, bound]() { pimpl_vm_->setBound(bound); });
 }
-/** @brief Retrieve a copy of the parameters of that VM/PM
- *  @details The ramsize and overcommit fields are used on the PM too */
-void VirtualMachine::getParameters(vm_params_t params)
-{
-  pimpl_vm_->getParams(params);
-}
-/** @brief Sets the params of that VM/PM */
-void VirtualMachine::setParameters(vm_params_t params)
-{
-  simgrid::simix::kernelImmediate([this, params] { pimpl_vm_->setParams(params); });
-}
 
 } // namespace simgrid
 } // namespace s4u