Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
inline another VM function, and kill another one, unused
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 20 Nov 2016 19:12:50 +0000 (20:12 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 20 Nov 2016 19:12:50 +0000 (20:12 +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 59cc0fb..4964376 100644 (file)
@@ -261,7 +261,6 @@ XBT_PUBLIC(e_smx_state_t) simcall_execution_wait(smx_activity_t execution);
 // Create the vm_workstation at the SURF level
 XBT_PUBLIC(sg_host_t) simcall_vm_create(const char *name, sg_host_t host);
 XBT_PUBLIC(void) simcall_vm_start(sg_host_t vm);
 // Create the vm_workstation at the SURF level
 XBT_PUBLIC(sg_host_t) simcall_vm_create(const char *name, sg_host_t host);
 XBT_PUBLIC(void) simcall_vm_start(sg_host_t vm);
-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);
index fb1e82d..c70ff31 100644 (file)
@@ -337,19 +337,14 @@ static int migration_rx_fun(int argc, char *argv[])
   msg_host_t src_pm                = ms->src_pm;
   msg_host_t dst_pm                = ms->dst_pm;
 
   msg_host_t src_pm                = ms->src_pm;
   msg_host_t dst_pm                = ms->dst_pm;
 
-  // TODO: we have an issue, if the DST node is turning off during the three next calls, then the VM is in an
-  // inconsistent
-  //       state. I should check with Takahiro in order to make this portion of code atomic
-  //
-  //  /* Update the vm location */
-  //  simcall_vm_migrate(vm, dst_pm);
-  //
-  //  /* Resume the VM */
-  //  simcall_vm_resume(vm);
-  //
+  // Make sure that we cannot get interrupted between the migrate and the resume to not end in an inconsistent state
   simgrid::simix::kernelImmediate([vm, src_pm, dst_pm]() {
     /* Update the vm location */
   simgrid::simix::kernelImmediate([vm, src_pm, dst_pm]() {
     /* Update the vm location */
-    SIMIX_vm_migrate(vm, dst_pm);
+    /* precopy migration makes the VM temporally paused */
+    xbt_assert(static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->getState() == SURF_VM_STATE_SUSPENDED);
+
+    /* jump to vm_ws_xigrate(). this will update the vm location. */
+    static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->migrate(dst_pm);
 
     /* Resume the VM */
     SIMIX_vm_resume(vm);
 
     /* Resume the VM */
     SIMIX_vm_resume(vm);
index 1f15dfe..c506bfe 100644 (file)
@@ -230,18 +230,6 @@ void simcall_vm_set_bound(sg_host_t vm, double bound)
       [vm, bound]() { static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->setBound(bound); });
 }
 
       [vm, bound]() { static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->setBound(bound); });
 }
 
-/**
- * \ingroup simix_vm_management
- * \brief Migrate the given VM to the given physical host
- *
- * \param vm VM
- * \param host Destination physical host
- */
-void simcall_vm_migrate(sg_host_t vm, sg_host_t host)
-{
-  simgrid::simix::kernelImmediate(std::bind(SIMIX_vm_migrate, vm, host));
-}
-
 /**
  * \ingroup simix_vm_management
  * \brief Suspend the given VM
 /**
  * \ingroup simix_vm_management
  * \brief Suspend the given VM
index d87ae8b..794df19 100644 (file)
@@ -78,8 +78,6 @@ XBT_PRIVATE void SIMIX_vm_start(sg_host_t ind_vm);
 XBT_PRIVATE void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_actor_t issuer);
 // --
 
 XBT_PRIVATE void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_actor_t issuer);
 // --
 
-XBT_PRIVATE void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm);
-
 SG_END_DECL()
 
 #endif
 SG_END_DECL()
 
 #endif
index 515fb1f..e11f077 100644 (file)
@@ -54,20 +54,6 @@ void SIMIX_vm_start(sg_host_t vm)
   static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->setState(SURF_VM_STATE_RUNNING);
 }
 
   static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->setState(SURF_VM_STATE_RUNNING);
 }
 
-/**
- * @brief Function to migrate a SIMIX VM host.
- *
- * @param host the vm host to migrate (a sg_host_t)
- */
-void SIMIX_vm_migrate(sg_host_t vm, sg_host_t dst_pm)
-{
-  /* precopy migration makes the VM temporally paused */
-  xbt_assert(static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->getState() == SURF_VM_STATE_SUSPENDED);
-
-  /* jump to vm_ws_xigrate(). this will update the vm location. */
-  static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->migrate(dst_pm);
-}
-
 /**
  * @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