mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-06-14 15:02:27 +03:00
Retrieve provider options before provider is initialized
Change provider_options so that it does not depend on provider. Call into config_service when provider is created, i.e. after library is loaded, before it is initialized, so that we can inject additional options at startup. Change the signature of the call provider options callback to take provider_options object as parameter.
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
|
||||
#include "config_service_v1.hpp"
|
||||
#include "service_helpers.hpp"
|
||||
#include "v26/wsrep_api.h"
|
||||
#include "v26/wsrep_config_service.h"
|
||||
#include "wsrep/logger.hpp"
|
||||
#include "wsrep/provider_options.hpp"
|
||||
@ -147,10 +148,9 @@ static void config_service_v1_deinit(void* dlh)
|
||||
dlh, WSREP_CONFIG_SERVICE_DEINIT_FUNC_V1, "config service v1");
|
||||
}
|
||||
|
||||
int wsrep::config_service_v1_fetch(wsrep::provider& provider,
|
||||
int wsrep::config_service_v1_fetch(struct wsrep_st* wsrep,
|
||||
wsrep::provider_options* options)
|
||||
{
|
||||
struct wsrep_st* wsrep = (struct wsrep_st*)provider.native();
|
||||
if (wsrep == nullptr)
|
||||
{
|
||||
// Not a provider which was loaded via wsrep-API
|
||||
@ -179,3 +179,10 @@ int wsrep::config_service_v1_fetch(wsrep::provider& provider,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wsrep::config_service_v1_fetch(wsrep::provider& provider,
|
||||
wsrep::provider_options* options)
|
||||
{
|
||||
struct wsrep_st* wsrep = (struct wsrep_st*)provider.native();
|
||||
return config_service_v1_fetch(wsrep, options);
|
||||
}
|
||||
|
Reference in New Issue
Block a user