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);
#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");
// /* 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)
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.
// --
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
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