const char *name = SIMIX_host_get_name(workstation);
msg_host_priv_t host = xbt_new0(s_msg_host_priv_t, 1);
- host->vms = xbt_dynar_new(sizeof(msg_vm_t),NULL);
-
#ifdef MSG_USE_DEPRECATED
int i;
char alias[MAX_ALIAS_NAME + 1] = { 0 }; /* buffer used to build the key of the mailbox */
}
/*
- * \brief Destroys a host (internal call only)
+ * \brief Frees private data of a host (internal call only)
*/
-void __MSG_host_destroy(msg_host_priv_t host) {
-
+void __MSG_host_priv_free(msg_host_priv_t priv)
+{
#ifdef MSG_USE_DEPRECATED
if (msg_global->max_channel > 0)
- free(host->mailboxes);
+ free(priv->mailboxes);
#endif
- if (xbt_dynar_length(host->vms) > 0 ) {
- XBT_VERB("Host shut down, but it still hosts %d VMs. They will be leaked.", xbt_dynar_length(host->vms));
- }
- xbt_dynar_free(&host->vms);
- free(host);
+
+ free(priv);
+}
+
+/*
+ * \brief Destroys a host (internal call only)
+ */
+void __MSG_host_destroy(msg_host_t host)
+{
+ const char *name = MSG_host_get_name(host);
+ /* TODO:
+ * What happens if VMs still remain on this host?
+ * Revisit here after the surf layer gets stable.
+ **/
+
+ xbt_lib_unset(host_lib, name, MSG_HOST_LEVEL, 1);
}
/** \ingroup m_host_management