Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
vm_migrate is now part of the live_migration plugin \o/
[simgrid.git] / src / plugins / vm / s4u_VirtualMachine.cpp
index 8bda7e7..153625c 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;