Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
inline a bunch of VM functions
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 19 Nov 2016 21:54:47 +0000 (22:54 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 19 Nov 2016 21:54:47 +0000 (22:54 +0100)
include/simgrid/simix.h
src/msg/msg_vm.cpp
src/simix/libsmx.cpp
src/simix/smx_host_private.h
src/simix/smx_vm.cpp

index 40f0295..c3ea657 100644 (file)
@@ -266,7 +266,6 @@ XBT_PUBLIC(void) simcall_vm_migrate(sg_host_t vm, sg_host_t dst_pm);
 XBT_PUBLIC(void *) simcall_vm_get_pm(sg_host_t vm);
 XBT_PUBLIC(void) simcall_vm_set_bound(sg_host_t vm, double bound);
 XBT_PUBLIC(void) simcall_vm_resume(sg_host_t vm);
 XBT_PUBLIC(void *) simcall_vm_get_pm(sg_host_t vm);
 XBT_PUBLIC(void) simcall_vm_set_bound(sg_host_t vm, double bound);
 XBT_PUBLIC(void) simcall_vm_resume(sg_host_t vm);
-XBT_PUBLIC(void) simcall_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm);
 XBT_PUBLIC(void) simcall_vm_save(sg_host_t vm);
 XBT_PUBLIC(void) simcall_vm_restore(sg_host_t vm);
 XBT_PUBLIC(void) simcall_vm_suspend(sg_host_t vm);
 XBT_PUBLIC(void) simcall_vm_save(sg_host_t vm);
 XBT_PUBLIC(void) simcall_vm_restore(sg_host_t vm);
 XBT_PUBLIC(void) simcall_vm_suspend(sg_host_t vm);
index 0d5304b..77b9855 100644 (file)
@@ -20,6 +20,8 @@
 #include "xbt/log.h"
 #include "simgrid/host.h"
 
 #include "xbt/log.h"
 #include "simgrid/host.h"
 
+#include "src/simix/smx_host_private.h" /* don't ask me why the VM functions are in there (FIXME:KILLME) */
+
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg, "Cloud-oriented parts of the MSG API");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg, "Cloud-oriented parts of the MSG API");
 
 
@@ -342,7 +344,13 @@ static int migration_rx_fun(int argc, char *argv[])
   //  /* Resume the VM */
   //  simcall_vm_resume(vm);
   //
   //  /* Resume the VM */
   //  simcall_vm_resume(vm);
   //
-  simcall_vm_migratefrom_resumeto(vm, src_pm, dst_pm);
+  simgrid::simix::kernelImmediate([vm, src_pm, dst_pm]() {
+    /* Update the vm location */
+    SIMIX_vm_migrate(vm, dst_pm);
+
+    /* Resume the VM */
+    SIMIX_vm_resume(vm);
+  });
 
   {
    // Now the VM is running on the new host (the migration is completed) (even if the SRC crash)
 
   {
    // Now the VM is running on the new host (the migration is completed) (even if the SRC crash)
index a522ef7..13bbba3 100644 (file)
@@ -320,25 +320,6 @@ void simcall_vm_destroy(sg_host_t vm)
   simgrid::simix::kernelImmediate(std::bind(SIMIX_vm_destroy, vm));
 }
 
   simgrid::simix::kernelImmediate(std::bind(SIMIX_vm_destroy, vm));
 }
 
-/**
- * \ingroup simix_vm_management
- * \brief Encompassing simcall to prevent the removal of the src or the dst node at the end of a VM migration
- *  The simcall actually invokes the following calls: 
- *     simcall_vm_migrate(vm, dst_pm); 
- *     simcall_vm_resume(vm);
- *
- * It is called at the end of the migration_rx_fun function from msg/msg_vm.c
- *
- * \param vm VM to migrate
- * \param src_pm  Source physical host
- * \param dst_pmt Destination physical host
- */
-void simcall_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm)
-{
-  simgrid::simix::kernelImmediate(std::bind(
-    SIMIX_vm_migratefrom_resumeto, vm, src_pm, dst_pm));
-}
-
 /**
  * \ingroup simix_process_management
  * \brief Kills a SIMIX process.
 /**
  * \ingroup simix_process_management
  * \brief Kills a SIMIX process.
index b8d2920..16a099a 100644 (file)
@@ -86,8 +86,6 @@ XBT_PRIVATE e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm);
 // --
 XBT_PRIVATE void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm);
 
 // --
 XBT_PRIVATE void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm);
 
-XBT_PRIVATE void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm);
-
 SG_END_DECL()
 
 #endif
 SG_END_DECL()
 
 #endif
index 0eb77b5..f6d3396 100644 (file)
@@ -92,27 +92,6 @@ void SIMIX_vm_migrate(sg_host_t vm, sg_host_t dst_pm)
   static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->migrate(dst_pm);
 }
 
   static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->migrate(dst_pm);
 }
 
-/**
- * @brief Encompassing simcall to prevent the removal of the src or the dst node at the end of a VM migration
- *  The simcall actually invokes the following calls: 
- *     simcall_vm_migrate(vm, dst_pm); 
- *     simcall_vm_resume(vm);
- *
- * It is called at the end of the migration_rx_fun function from msg/msg_vm.c
- *
- * @param vm VM to migrate
- * @param src_pm  Source physical host
- * @param dst_pmt Destination physical host
- */
-void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm)
-{
-  /* Update the vm location */
-  SIMIX_vm_migrate(vm, dst_pm);
-  /* Resume the VM */
-  SIMIX_vm_resume(vm);
-} 
-
 /**
  * @brief Function to suspend a SIMIX VM host. This function stops the execution of the
  * VM. All the processes on this VM will pause. The state of the VM is
 /**
  * @brief Function to suspend a SIMIX VM host. This function stops the execution of the
  * VM. All the processes on this VM will pause. The state of the VM is