Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add the {set/get}_params operations to a host object
[simgrid.git] / src / msg / msg_host.c
index 5a0de0d..026eb74 100644 (file)
@@ -112,21 +112,30 @@ msg_host_t MSG_host_self(void)
 }
 
 /*
- * \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
 
+  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.
    **/
 
-  free(host);
+  xbt_lib_unset(host_lib, name, MSG_HOST_LEVEL, 1);
 }
 
 /** \ingroup m_host_management
@@ -251,3 +260,25 @@ int MSG_host_is_avail(msg_host_t host)
   xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
   return (simcall_host_get_state(host));
 }
+
+/** \ingroup m_host_management
+ * \brief Set the parameters of a given host
+ *
+ * \param host a host
+ * \param params a prameter object
+ */
+void MSG_host_set_params(msg_host_t ind_pm, ws_params_t params)
+{
+  simcall_host_set_params(ind_pm, params);
+}
+
+/** \ingroup m_host_management
+ * \brief Get the parameters of a given host
+ *
+ * \param host a host
+ * \param params a prameter object
+ */
+void MSG_host_get_params(msg_host_t ind_pm, ws_params_t params)
+{
+  simcall_host_get_params(ind_pm, params);
+}