MXS-1848 monitor_[alloc|free]() -> monitor_[create|destroy]

As these will call the createInstance and destroyInstance functions
of the monitor, they are more appropriately named like this.
This commit is contained in:
Johan Wikman
2018-05-06 19:37:37 +03:00
parent 510eb7ec7c
commit 851cefefc6
5 changed files with 7 additions and 7 deletions

View File

@ -3480,7 +3480,7 @@ int create_new_monitor(CONFIG_CONTEXT *context, CONFIG_CONTEXT *obj, HASHTABLE*
char *module = config_get_value(obj->parameters, CN_MODULE);
if (module)
{
if ((obj->element = monitor_alloc(obj->object, module)) == NULL)
if ((obj->element = monitor_create(obj->object, module)) == NULL)
{
MXS_ERROR("Failed to create monitor '%s'.", obj->object);
error_count++;

View File

@ -937,7 +937,7 @@ bool runtime_create_monitor(const char *name, const char *module)
{
MXS_DEBUG("Repurposed monitor '%s'", name);
}
else if ((monitor = monitor_alloc(name, module)) == NULL)
else if ((monitor = monitor_create(name, module)) == NULL)
{
runtime_error("Could not create monitor '%s' with module '%s'", name, module);
}

View File

@ -47,8 +47,8 @@ typedef enum
MONITOR_CONNECT_ATTEMPTS = 3
} monitor_timeouts_t;
MXS_MONITOR *monitor_alloc(const char *, const char *);
void monitor_free(MXS_MONITOR *);
MXS_MONITOR *monitor_create(const char *, const char *);
void monitor_destroy(MXS_MONITOR *);
void monitor_start(MXS_MONITOR *, const MXS_CONFIG_PARAMETER*);
void monitor_stop(MXS_MONITOR *);

View File

@ -92,14 +92,14 @@ static unsigned int all_server_bits = SERVER_RUNNING | SERVER_MAINT |
SERVER_JOINED | SERVER_NDB;
/**
* Allocate a new monitor, load the associated module for the monitor
* Create a new monitor, load the associated module for the monitor
* and start execution on the monitor.
*
* @param name The name of the monitor module to load
* @param module The module to load
* @return The newly created monitor
*/
MXS_MONITOR* monitor_alloc(const char *name, const char *module)
MXS_MONITOR* monitor_create(const char *name, const char *module)
{
char* my_name = MXS_STRDUP(name);
char *my_module = MXS_STRDUP(module);

View File

@ -406,7 +406,7 @@ int test_domain_matching(const char* actual_module,
/** Create a monitor */
char *libdir = MXS_STRDUP_A("../../modules/monitor/mariadbmon/");
set_libdir(libdir);
monitor_alloc(name, actual_module);
monitor_create(name, actual_module);
const MODULECMD *cmd;