// xbt_dynar_free(&new_processes);
//}
//
-///** @brief Destroy a msg_vm_t.
-// * @ingroup msg_VMs
-// */
-//void MSG_vm_destroy(msg_vm_t vm)
-//{
-// simcall_vm_destroy(vm);
-//
-//#if 0
-// unsigned int cpt;
-// msg_process_t process;
-// xbt_dynar_foreach(vm->processes,cpt,process) {
-// //FIXME: Slow ?
-// simdata_process_t simdata = simcall_process_get_data(process);
-// simdata->vm = NULL;
-// }
-//
-// #ifdef HAVE_TRACING
-// TRACE_msg_vm_end(vm);
-// #endif
-//
-//
-// xbt_dynar_free(&vm->processes);
-// xbt_free(vm);
-//#endif
-//}
+
+/** @brief Destroy a VM.
+ * @ingroup msg_VMs
+ */
+void MSG_vm_destroy(msg_vm_t vm)
+{
+ simcall_vm_destroy(vm);
+ /* TOOD: do we have to do something for processes? */
+
+#if 0
+ unsigned int cpt;
+ msg_process_t process;
+ xbt_dynar_foreach(vm->processes,cpt,process) {
+ //FIXME: Slow ?
+ simdata_process_t simdata = simcall_process_get_data(process);
+ simdata->vm = NULL;
+ }
+
+ #ifdef HAVE_TRACING
+ TRACE_msg_vm_end(vm);
+ #endif
+
+
+ xbt_dynar_free(&vm->processes);
+ xbt_free(vm);
+#endif
+}
* \param host A host
* \return The properties of this host
*/
-void* simcall_vm_create(const char *name, smx_host_t phys_host){
+void* simcall_vm_create(const char *name, smx_host_t phys_host)
{
return simcall_BODY_vm_create(name, phys_host);
}
-
-void simcall_vm_start(smx_host_t vm){
-
- simcall_BODY_set_vm_state(vm, msg_vm_state_running);
+void simcall_vm_start(smx_host_t vm)
+{
+ simcall_BODY_set_vm_state(vm, msg_vm_state_running);
}
void simcall_vm_destroy(smx_host_t vm)
{
- return simcall_BODY_vm_destroy(vm);
+ /* will jump to SIMIX_pre_vm_destroy */
+ simcall_BODY_vm_destroy(vm);
}
/**