Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
inline a bunch of VM functions
[simgrid.git] / src / simix / libsmx.cpp
index 14d8226..13bbba3 100644 (file)
@@ -219,19 +219,27 @@ int simcall_vm_get_state(sg_host_t vm)
 
 /**
  * \ingroup simix_vm_management
- * \brief Get the name of the physical host on which the given VM runs.
+ * \brief Get the physical host on which the given VM runs.
  *
  * \param vm VM
- * \return The name of the physical host
+ * \return The physical host
  */
 void *simcall_vm_get_pm(sg_host_t vm)
 {
-  return simgrid::simix::kernelImmediate(std::bind(SIMIX_vm_get_pm, vm));
+  return simgrid::simix::kernelImmediate(
+      [vm]() { return static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->getPm(); });
 }
 
+/**
+ * @brief Function to set the CPU bound of the given SIMIX VM host.
+ *
+ * @param host the vm host (a sg_host_t)
+ * @param bound bound (a double)
+ */
 void simcall_vm_set_bound(sg_host_t vm, double bound)
 {
-  simgrid::simix::kernelImmediate(std::bind(SIMIX_vm_set_bound, vm, bound));
+  simgrid::simix::kernelImmediate(
+      [vm, bound]() { static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->setBound(bound); });
 }
 
 /**
@@ -312,25 +320,6 @@ void simcall_vm_destroy(sg_host_t 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.
@@ -393,8 +382,6 @@ void simcall_process_join(smx_actor_t process, double timeout)
  */
 void simcall_process_suspend(smx_actor_t process)
 {
-  xbt_assert(process, "Invalid parameters");
-
   simcall_BODY_process_suspend(process);
 }