Exemplo n.º 1
0
monitor::EventMonitor::EventMonitor() : NvmMonitorBase("EVENT"), m_nsMgmtCallbackId(-1)
{
	if (!get_lib_store())
	{
		open_default_lib_store();
	}
}
Exemplo n.º 2
0
/*
 * Open the library
 */
int nvm_open_lib()
{
	int rc = NVM_SUCCESS;

	// initialize the connection to the database
	if (!open_default_lib_store())
	{
		rc = NVM_ERR_UNKNOWN;
	}
	else
	{
		rc = wbem::lib_interface::apiMutexInit();
	}

	return rc;
}
Exemplo n.º 3
0
/*
 * Open the library
 */
int nvm_open_lib()
{
	int rc = NVM_SUCCESS;

	// initialize the connection to the database
	if (!open_default_lib_store())
	{
		rc = NVM_ERR_UNKNOWN;
	}
	else
	{
		char sim_path[CONFIG_VALUE_LEN];
		// attempt to open a default simulator
		if (get_config_value(SQL_KEY_DEFAULT_SIMULATOR, sim_path) == COMMON_SUCCESS)
		{
			// don't care about failures. sim_adapter will log any
			// errors to the config database. other adapters will just
			// return not supported
			COMMON_LOG_DEBUG_F("Opening default simulator %s", sim_path);
			nvm_add_simulator(sim_path, s_strnlen(sim_path, CONFIG_VALUE_LEN));
		}

		// initialize the event monitor lock
		// event monitoring is per process so no need to be cross-process safe
		// thus no name on the mutex
		if (!mutex_init((OS_MUTEX*)&g_eventmonitor_lock, NULL))
		{
			rc = NVM_ERR_UNKNOWN;
		}

		// initialize the context lock
		// context is per proces so no need to be cross-process safe
		// thus no name on the mutex
		if (!mutex_init((OS_MUTEX*)&g_context_lock, NULL))
		{
			rc = NVM_ERR_UNKNOWN;
		}
	}
	return rc;
}