Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill a stupid function. Let's do regular C++
[simgrid.git] / src / simix / smx_vm.cpp
index c6c9709a502543afee89ce07ffdecdb4553ce394..6c99ae8dedd4458cb14c896909092fa175e84893 100644 (file)
@@ -114,7 +114,7 @@ void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst
  
   /* Resume the VM */
   smx_actor_t self = SIMIX_process_self(); 
-  SIMIX_vm_resume(vm, self->simcall.issuer);
+  SIMIX_vm_resume(vm, self);
 } 
 
 /**
@@ -298,11 +298,12 @@ void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t vm)
   SIMIX_vm_shutdown(vm, simcall->issuer);
 }
 
-/**
- * @brief Function to destroy a SIMIX VM host.
- *
- * @param vm the vm host to destroy (a sg_host_t)
- */
+extern xbt_dict_t host_list; // FIXME:killme don't dupplicate the content of s4u::Host this way
+                             /**
+                              * @brief Function to destroy a SIMIX VM host.
+                              *
+                              * @param vm the vm host to destroy (a sg_host_t)
+                              */
 void SIMIX_vm_destroy(sg_host_t vm)
 {
   /* this code basically performs a similar thing like SIMIX_host_destroy() */
@@ -319,4 +320,7 @@ void SIMIX_vm_destroy(sg_host_t vm)
   /* Don't free these things twice: they are the ones of my physical host */
   vm->pimpl_cpu = nullptr;
   vm->pimpl_netcard = nullptr;
+
+  if (xbt_dict_get_or_null(host_list, vm->name().c_str()))
+    xbt_dict_remove(host_list, vm->name().c_str());
 }