msg_host_t dst_pm = ms-> dst_pm;
msg_host_priv_t priv = msg_host_resource_priv(vm);
-// 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
- /* deinstall the current affinity setting for the CPU */
- simcall_vm_set_affinity(vm, src_pm, 0);
-
- /* Update the vm location */
- simcall_vm_migrate(vm, dst_pm);
-
- /* Resume the VM */
- simcall_vm_resume(vm);
+// // 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
+// /* deinstall the current affinity setting for the CPU */
+// simcall_vm_set_affinity(vm, src_pm, 0);
+//
+// /* Update the vm location */
+// simcall_vm_migrate(vm, dst_pm);
+//
+// /* Resume the VM */
+// simcall_vm_resume(vm);
+//
+ simcall_vm_migratefrom_resumeto(vm, src_pm, dst_pm);
/* install the affinity setting of the VM on the destination pm */
{
simcall_BODY_vm_destroy(vm);
}
-Proc - vm_migratefrom_resumeto (void) (ind_vm, void*, smx_host_t)(ind_src_pm, void*, smx_host_t) (ind_dst_pm, void*, smx_host_t)
/**
* \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
* \param vm VM to migrate
* \param src_pm Source physical host
* \param dst_pmt Destination physical host
-
*/
void simcall_vm_migratefrom_resumeto(smx_host_t vm, smx_host_t src_pm, smx_host_t dst_pm)
{
simcall_BODY_vm_migratefrom_resumeto(vm, src_pm, dst_pm);
}
-
-
/**
* \ingroup simix_process_management
* \brief Creates and runs a new SIMIX process.
simcall->args[0].dp = arg;
}
-static inline smx_host_t simcall_vm_migratefrom_resumeto__get__ind_vm(smx_simcall_t simcall) {
+static inline smx_host_t simcall_vm_migratefrom_resumeto__get__vm(smx_simcall_t simcall) {
return (smx_host_t) simcall->args[0].dp;
}
-static inline void simcall_vm_migratefrom_resumeto__set__ind_vm(smx_simcall_t simcall, void* arg) {
+static inline void simcall_vm_migratefrom_resumeto__set__vm(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
}
-static inline smx_host_t simcall_vm_migratefrom_resumeto__get__ind_src_pm(smx_simcall_t simcall) {
+static inline smx_host_t simcall_vm_migratefrom_resumeto__get__src_pm(smx_simcall_t simcall) {
return (smx_host_t) simcall->args[1].dp;
}
-static inline void simcall_vm_migratefrom_resumeto__set__ind_src_pm(smx_simcall_t simcall, void* arg) {
+static inline void simcall_vm_migratefrom_resumeto__set__src_pm(smx_simcall_t simcall, void* arg) {
simcall->args[1].dp = arg;
}
-static inline smx_host_t simcall_vm_migratefrom_resumeto__get__ind_dst_pm(smx_simcall_t simcall) {
+static inline smx_host_t simcall_vm_migratefrom_resumeto__get__dst_pm(smx_simcall_t simcall) {
return (smx_host_t) simcall->args[2].dp;
}
-static inline void simcall_vm_migratefrom_resumeto__set__ind_dst_pm(smx_simcall_t simcall, void* arg) {
+static inline void simcall_vm_migratefrom_resumeto__set__dst_pm(smx_simcall_t simcall, void* arg) {
simcall->args[2].dp = arg;
}
}
-inline static void simcall_BODY_vm_migratefrom_resumeto(smx_host_t ind_vm, smx_host_t ind_src_pm, smx_host_t ind_dst_pm) {
+inline static void simcall_BODY_vm_migratefrom_resumeto(smx_host_t vm, smx_host_t src_pm, smx_host_t dst_pm) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_vm_migratefrom_resumeto(ind_vm, ind_src_pm, ind_dst_pm);
+ if (0) SIMIX_vm_migratefrom_resumeto(vm, src_pm, dst_pm);
/* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
self->simcall.call = SIMCALL_VM_MIGRATEFROM_RESUMETO;
memset(&self->simcall.result, 0, sizeof(self->simcall.result));
memset(self->simcall.args, 0, sizeof(self->simcall.args));
- self->simcall.args[0].dp = (void*) ind_vm;
- self->simcall.args[1].dp = (void*) ind_src_pm;
- self->simcall.args[2].dp = (void*) ind_dst_pm;
+ self->simcall.args[0].dp = (void*) vm;
+ self->simcall.args[1].dp = (void*) src_pm;
+ self->simcall.args[2].dp = (void*) dst_pm;
if (self != simix_global->maestro_process) {
XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
Proc H vm_shutdown (void) (ind_vm, void*, smx_host_t)
Proc H vm_save (void) (ind_vm, void*, smx_host_t)
Proc H vm_restore (void) (ind_vm, void*, smx_host_t)
-Proc - vm_migratefrom_resumeto (void) (ind_vm, void*, smx_host_t)(ind_src_pm, void*, smx_host_t) (ind_dst_pm, void*, smx_host_t)
+Proc - vm_migratefrom_resumeto (void) (vm, void*, smx_host_t)(src_pm, void*, smx_host_t) (dst_pm, void*, smx_host_t)
Proc H process_create (void) (process, void*, smx_process_t*) (name, const char*) (code, FPtr, xbt_main_func_t) (data, void*) (hostname, const char*) (kill_time, double) (argc, int) (argv, void*, char**) (properties, void*, xbt_dict_t) (auto_restart, int)
Proc H process_kill (void) (process, void*, smx_process_t)
Proc H process_killall (void) (reset_pid, int)
surf_vm_workstation_migrate(ind_vm, ind_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_set_affinity(vm, src_pm, 0);
+ * 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(smx_host_t vm, smx_host_t src_pm, smx_host_t dst_pm)
+{
+ /* deinstall the current affinity setting for the CPU */
+ SIMIX _vm_set_affinity(vm, src_pm, 0);
+
+ /* Update the vm location */
+ SIMIX_vm_migrate(vm, dst_pm);
+
+ /* Resume the VM */
+ SIMIX_vm_resume(vm);
+}
+
/**
* \brief Function to get the physical host of the given SIMIX VM host.
*