1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-21 18:03:38 +03:00

feature #4217: Fix bug when initializating pool references

This commit is contained in:
Ruben S. Montero 2015-12-18 12:07:21 +01:00
parent 56180ff21d
commit f9910aa103
3 changed files with 25 additions and 31 deletions

View File

@ -30,27 +30,16 @@ class MarketPlaceManager : public MadManager, public ActionListener
{
public:
MarketPlaceManager(
time_t _timer_period,
time_t _monitor_period,
std::vector<const Attribute*>& _mads):
MadManager(_mads),
timer_period(_timer_period),
monitor_period(_monitor_period),
mppool(0),
apppool(0)
{
am.addListener(this);
};
/**
* Inititalizes the Marketplace manager:
* @param t, timer_period to wake up the manger to perform actions
* @param m, monitor_period to monitor marketplaces
* @param mad, list of drivers for the manager
*/
MarketPlaceManager( time_t t, time_t m, std::vector<const Attribute*>& mad);
~MarketPlaceManager(){};
/**
* Initializes internal pointers to other managers. Must be called when
* all the other managers exist in Nebula::instance
*/
void init_managers();
/**
* This functions starts the associated listener thread, and creates a
* new thread for the MarketPlace Manager. This thread will wait in

View File

@ -46,6 +46,24 @@ extern "C" void * marketplace_action_loop(void *arg)
return 0;
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
MarketPlaceManager::MarketPlaceManager(
time_t _timer_period,
time_t _monitor_period,
std::vector<const Attribute*>& _mads):
MadManager(_mads),
timer_period(_timer_period),
monitor_period(_monitor_period)
{
Nebula& nd = Nebula::instance();
mppool = nd.get_marketpool();
apppool = nd.get_apppool();
am.addListener(this);
};
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
@ -144,17 +162,6 @@ void MarketPlaceManager::do_action(const string &action, void * arg)
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
void MarketPlaceManager::init_managers()
{
Nebula& nd = Nebula::instance();
mppool = nd.get_marketpool();
apppool = nd.get_apppool();
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
string * MarketPlaceManager::format_message(
const string& app_data,
const string& market_data,

View File

@ -936,8 +936,6 @@ void Nebula::start(bool bootstrap_only)
lcm->init_managers();
marketm->init_managers();
// ---- Start the Request Manager ----
rc = rm->start();