Instead of removing the VM from the host_lib (and potentially create
issues at the routing level), test whether it exists in the VM layer
before whining that we cannot redo it.
{
/* make sure the VM of the same name does not exit */
{
{
/* make sure the VM of the same name does not exit */
{
- void *ind_host_tmp = xbt_lib_get_elm_or_null(host_lib, name);
- if (ind_host_tmp) {
+ xbt_dictelm_t ind_host_tmp = xbt_lib_get_elm_or_null(host_lib, name);
+ if (ind_host_tmp && xbt_lib_get_level(ind_host_tmp, SIMIX_HOST_LEVEL) != NULL) {
XBT_ERROR("host %s already exits", name);
return NULL;
}
XBT_ERROR("host %s already exits", name);
return NULL;
}
#ifdef HAVE_TRACING
TRACE_msg_vm_end(vm);
#endif
#ifdef HAVE_TRACING
TRACE_msg_vm_end(vm);
#endif
- xbt_lib_remove(host_lib, sg_host_name(vm));