From: Chris B. <buc...@us...> - 2012-04-03 16:04:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via 9485c3a9baaf59453dec79496073d45da8b1cc52 (commit) from fc989a07063e91acdc1e7fef35bf466778ffe503 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9485c3a9baaf59453dec79496073d45da8b1cc52 Author: buccella <buc...@li...> Date: Tue Apr 3 12:03:50 2012 -0400 [ 3483294 ] InternalProvider Should Handle SFCB_RegisteredProfile ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 7a789d4..5922c5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-04-03 Chris Buccella <buc...@li...> + + * Makefile.am, configure.ac, default.reg.in, profileProvider.c, + providerMgr.c, test/xmltest/modifyInstance_regprofile.lines: + [ 3483294 ] InternalProvider Should Handle SFCB_RegisteredProfile + 2012-04-02 Narasimha Sharoff <nsh...@us...> * indCIMXMLHandler.c: diff --git a/Makefile.am b/Makefile.am index c50bf30..43ecd4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -120,6 +120,12 @@ else ACCOUNT_PASSTHRU_LIBS = endif +if SLP + PROFILE_PROVIDER_LIBS = libsfcProfileProvider.la +else + PROFILE_PROVDIER_LIBS = +endif + sfcb_sharedobjects = \ $(sfcblibdir)/*.so @@ -129,7 +135,7 @@ sfcblib_LTLIBRARIES = \ libsfcInternalProvider.la \ libsfcInteropProvider.la \ libsfcInteropServerProvider.la \ - libsfcProfileProvider.la \ + $(PROFILE_PROVIDER_LIBS) \ libsfcElementCapabilitiesProvider.la \ libsfcClassProvider.la \ libsfcClassProviderGz.la \ @@ -157,13 +163,11 @@ sfcblib_LTLIBRARIES += \ libTestIndicationProvider.la endif -SLP_PROGRAMFILES = - sbin_PROGRAMS = \ sfcbd bin_PROGRAMS = \ - sfcbmofpp sfcbdump sfcbinst2mof $(SLP_PROGRAMFILES) + sfcbmofpp sfcbdump sfcbinst2mof noinst_PROGRAMS = \ sfcbdumpP32onI32 classSchema2c sfcbsem @@ -284,9 +288,7 @@ libsfcIndCIMXMLHandler_la_LIBADD=-lsfcBrokerCore -lsfcInternalProvider $(CIMXMLC libsfcIndCIMXMLHandler_la_DEPENDENCIES=libsfcBrokerCore.la libsfcInternalProvider.la \ $(CIMXMLCODEC_LIBS) $(HTTP_ADAPTER_LIBS) -libsfcProfileProvider_la_SOURCES = \ - profileProvider.c \ - $(SLP_SRC) +libsfcProfileProvider_la_SOURCES = $(SLP_SRC) libsfcProfileProvider_la_LIBADD=-lsfcBrokerCore libsfcProfileProvider_la_DEPENDENCIES=libsfcBrokerCore.la @@ -377,7 +379,8 @@ libsfcCimXmlCodec_la_DEPENDENCIES=libsfcBrokerCore.la endif if SLP -SLP_SRC = cimslpCMPI.c \ +SLP_SRC = profileProvider.c \ + cimslpCMPI.c \ cimslpSLP.c \ cimslpUtil.c SLP_INC = cimslpCMPI.h \ @@ -385,6 +388,7 @@ SLP_INC = cimslpCMPI.h \ cimslpUtil.h else +SLP_SRC = SLP_INC = endif diff --git a/NEWS b/NEWS index 3ed725d..4396020 100644 --- a/NEWS +++ b/NEWS @@ -131,6 +131,7 @@ Bugs Fixed: - 3416054 Provider continues despite SIGSEGV - 3505407 Client openlog changes settings - 3485830 SFCB Makes Redundant ActivateFilter Calls +- 3483294 InternalProvider Should Handle SFCB_RegisteredProfile Changes in 1.3.13 ================= diff --git a/configure.ac b/configure.ac index da0641a..883f61d 100644 --- a/configure.ac +++ b/configure.ac @@ -175,7 +175,11 @@ fi if test "$enable_slp" == "yes"; then AC_DEFINE(HAVE_SLP,,[SLP support enabled.]) + LOAD_PROFILE_PROVIDER= +else + LOAD_PROFILE_PROVIDER='#' fi +AC_SUBST(LOAD_PROFILE_PROVIDER) if test "$enable_slp_hostname_lib" == "yes"; then AC_DEFINE(SLP_HOSTNAME_LIB,,[SLP Hostname lib enabled]) diff --git a/default.reg.in b/default.reg.in index b3c5cc2..7d8d9d3 100644 --- a/default.reg.in +++ b/default.reg.in @@ -20,12 +20,12 @@ unload: never namespace: root/interop # -[$ProfileProvider$] - provider: ProfileProvider - location: sfcProfileProvider - type: instance method - unload: never - namespace: root/interop +@LOAD_PROFILE_PROVIDER@[$ProfileProvider$] +@LOAD_PROFILE_PROVIDER@ provider: ProfileProvider +@LOAD_PROFILE_PROVIDER@ location: sfcProfileProvider +@LOAD_PROFILE_PROVIDER@ type: method +@LOAD_PROFILE_PROVIDER@ unload: never +@LOAD_PROFILE_PROVIDER@ namespace: root/interop # @LOAD_QUALIFIER_PROVIDER@[$QualifierProvider$] @LOAD_QUALIFIER_PROVIDER@ provider: QualifierProvider @@ -78,10 +78,9 @@ @LOAD_SFCBACCOUNT_PROVIDER@ namespace: root/interop # [SFCB_RegisteredProfile] - provider: ProfileProvider - location: sfcProfileProvider + provider: InternalProvider + location: sfcInternalProvider type: instance - unload: never namespace: root/interop # [CIM_Namespace] diff --git a/profileProvider.c b/profileProvider.c index d502608..b148d07 100644 --- a/profileProvider.c +++ b/profileProvider.c @@ -105,226 +105,6 @@ static const CMPIBroker *_broker; * ------------------------------------------------------------------------- */ -CMPIContext * -prepareUpcall(const CMPIContext *ctx) -{ - /* - * used to invoke the internal provider in upcalls, otherwise we will be - * routed here again - */ - CMPIContext *ctxLocal; - ctxLocal = native_clone_CMPIContext(ctx); - CMPIValue val; - val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL, 0); - ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string); - return ctxLocal; -} - - -/* - * -------------------------------------------------------------------------- - */ -/* - * Instance Provider Interface - */ -/* - * -------------------------------------------------------------------------- - */ - -CMPIStatus -ProfileProviderCleanup(CMPIInstanceMI * mi, - const CMPIContext *ctx, CMPIBoolean terminate) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderCleanup"); -#ifdef HAVE_SLP - // Tell SLP update thread that we're shutting down - _SFCB_TRACE(1, ("--- Stopping SLP thread")); - pthread_kill(slpUpdateThread, SIGUSR2); - // Wait for thread to complete - pthread_join(slpUpdateThread, NULL); - _SFCB_TRACE(1, ("--- SLP Thread stopped")); -#endif // HAVE_SLP - _SFCB_RETURN(st); -} - -/* - * ------------------------------------------------------------------------- - */ - -CMPIStatus -ProfileProviderEnumInstanceNames(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * ref) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - CMPIEnumeration *enm; - CMPIContext *ctxLocal; - _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderEnumInstanceNames"); - - ctxLocal = prepareUpcall((CMPIContext *) ctx); - enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, ref, &st); - CMRelease(ctxLocal); - - while (enm && enm->ft->hasNext(enm, &st)) { - CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref); - } - if (enm) - CMRelease(enm); - _SFCB_RETURN(st); -} - -/* - * ------------------------------------------------------------------------- - */ - -CMPIStatus -ProfileProviderEnumInstances(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * ref, - const char **properties) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - CMPIEnumeration *enm; - CMPIContext *ctxLocal; - _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderEnumInstances"); - - ctxLocal = prepareUpcall((CMPIContext *) ctx); - enm = - _broker->bft->enumerateInstances(_broker, ctxLocal, ref, properties, - &st); - CMRelease(ctxLocal); - - while (enm && enm->ft->hasNext(enm, &st)) { - CMReturnInstance(rslt, (enm->ft->getNext(enm, &st)).value.inst); - } - if (enm) - CMRelease(enm); - _SFCB_RETURN(st); -} - -/* - * ------------------------------------------------------------------------- - */ - -CMPIStatus -ProfileProviderGetInstance(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * cop, - const char **properties) -{ - - CMPIStatus st = { CMPI_RC_OK, NULL }; - CMPIContext *ctxLocal; - CMPIInstance *ci; - - _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderGetInstance"); - - ctxLocal = prepareUpcall((CMPIContext *) ctx); - - ci = _broker->bft->getInstance(_broker, ctxLocal, cop, properties, &st); - if (st.rc == CMPI_RC_OK) { - CMReturnInstance(rslt, ci); - } - - CMRelease(ctxLocal); - - _SFCB_RETURN(st); - -} - -/* - * ------------------------------------------------------------------------- - */ - -CMPIStatus -ProfileProviderCreateInstance(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * cop, - const CMPIInstance *ci) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - CMPIContext *ctxLocal; - //cimomConfig cfg; - - _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderCreateInstance"); - - ctxLocal = prepareUpcall((CMPIContext *) ctx); - CMReturnObjectPath(rslt, - _broker->bft->createInstance(_broker, ctxLocal, cop, - ci, &st)); - CMRelease(ctxLocal); -#ifdef HAVE_SLP - //updateSLPRegistration - updateSLPReg(ctx, slpLifeTime); -#endif // HAVE_SLP - - _SFCB_RETURN(st); -} - -/* - * ------------------------------------------------------------------------- - */ - -CMPIStatus -ProfileProviderModifyInstance(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * cop, - const CMPIInstance *ci, - const char **properties) -{ - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderModifyInstance"); - _SFCB_RETURN(st); -} - -/* - * ------------------------------------------------------------------------- - */ - -CMPIStatus -ProfileProviderDeleteInstance(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * cop) -{ - CMPIStatus st = { CMPI_RC_OK, NULL }; - CMPIContext *ctxLocal; - - _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderDeleteInstance"); - - ctxLocal = prepareUpcall((CMPIContext *) ctx); - st = _broker->bft->deleteInstance(_broker, ctxLocal, cop); - CMRelease(ctxLocal); -#ifdef HAVE_SLP - //updateSLPRegistration - updateSLPReg(ctx, slpLifeTime); -#endif // HAVE_SLP - - _SFCB_RETURN(st); -} - -/* - * ------------------------------------------------------------------------- - */ - -CMPIStatus -ProfileProviderExecQuery(CMPIInstanceMI * mi, - const CMPIContext *ctx, - const CMPIResult *rslt, - const CMPIObjectPath * cop, - const char *lang, const char *query) -{ - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderExecQuery"); - _SFCB_RETURN(st); -} - CMPIStatus ProfileProviderInvokeMethod(CMPIMethodMI * mi, const CMPIContext *ctx, @@ -345,9 +125,17 @@ ProfileProviderInvokeMethod(CMPIMethodMI * mi, CMPIStatus ProfileProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { - CMPIStatus st = { CMPI_RC_OK, NULL }; - _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderMethodCleanup"); - _SFCB_RETURN(st); + CMPIStatus st = { CMPI_RC_OK, NULL }; + _SFCB_ENTER(TRACE_INDPROVIDER, "ProfileProviderCleanup"); +#ifdef HAVE_SLP + // Tell SLP update thread that we're shutting down + _SFCB_TRACE(1, ("--- Stopping SLP thread")); + pthread_kill(slpUpdateThread, SIGUSR2); + // Wait for thread to complete + pthread_join(slpUpdateThread, NULL); + _SFCB_TRACE(1, ("--- SLP Thread stopped")); +#endif // HAVE_SLP + _SFCB_RETURN(st); } @@ -518,17 +306,8 @@ spawnUpdateThread(const CMPIContext *ctx) #else // no HAVE_SLP #define UPDATE_SLP_REG CMNoHook #endif // HAVE_SLP -/* - * ------------------------------------------------------------------ * - * Instance MI Factory NOTE: This is an example using the convenience - * macros. This is OK as long as the MI has no special requirements, i.e. - * to store data between calls. - * ------------------------------------------------------------------ - */ -//CMInstanceMIStub(ProfileProvider, ProfileProvider, _broker, CMNoHook); -CMInstanceMIStub(ProfileProvider, ProfileProvider, _broker, UPDATE_SLP_REG); -CMMethodMIStub(ProfileProvider, ProfileProvider, _broker, CMNoHook); +CMMethodMIStub(ProfileProvider, ProfileProvider, _broker, UPDATE_SLP_REG); /* MODELINES */ /* DO NOT EDIT BELOW THIS COMMENT */ diff --git a/providerMgr.c b/providerMgr.c index 57b3b06..c088608 100644 --- a/providerMgr.c +++ b/providerMgr.c @@ -998,7 +998,9 @@ processProviderMgrRequests() startUpProvider("root/interop", "$InterOpProvider$"); } #endif +#ifdef HAVE_SLP startUpProvider("root/interop", "$ProfileProvider$"); +#endif for (;;) { MgrHandler hdlr; diff --git a/test/xmltest/modifyInstance_regprofile.lines b/test/xmltest/modifyInstance_regprofile.lines index 584374a..9337d8e 100644 --- a/test/xmltest/modifyInstance_regprofile.lines +++ b/test/xmltest/modifyInstance_regprofile.lines @@ -1,3 +1,3 @@ <IMETHODRESPONSE NAME="ModifyInstance"> -<ERROR CODE="7" DESCRIPTION="The requested operation is not supported"/> +<ERROR CODE="6" DESCRIPTION="The requested object could not be found"/> </IMETHODRESPONSE> hooks/post-receive -- SFCB - Small Footprint CIM Broker |