You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(5) |
Feb
(16) |
Mar
(5) |
Apr
(5) |
May
(13) |
Jun
(12) |
Jul
(1) |
Aug
(2) |
Sep
(13) |
Oct
(6) |
Nov
(1) |
Dec
(29) |
| 2008 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(57) |
May
(35) |
Jun
(45) |
Jul
(132) |
Aug
(87) |
Sep
(141) |
Oct
(86) |
Nov
(17) |
Dec
(2) |
| 2009 |
Jan
(3) |
Feb
(2) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
|
22
|
23
|
24
|
25
|
26
(1) |
27
(1) |
28
|
|
From: <ba...@us...> - 2009-02-27 00:03:33
|
Revision: 1166
http://omc.svn.sourceforge.net/omc/?rev=1166&view=rev
Author: bartw
Date: 2009-02-27 00:03:27 +0000 (Fri, 27 Feb 2009)
Log Message:
-----------
Removed on-demand TargetInitialization, and moved target initialization
to the generic "Create" factory functions. The on-demand initialization
was done previously because SFCB passed a null CMPIStatus to the factory
functions, which meant they couldn't gracefully fail. This has since
been fixed in SFCB.
This change was necessary to properly implement Cleanup(). In Cleanup(),
it is was not previously safe to allow providers to return
CMPI_RC_DO_NOT_UNLOAD, such that they will not be unloaded.
For example, consider an instance and method provider. If
the provider is called for a method only, the factory functions
for both instance and method will be called, allocating
a ProviderMIHandle for each provider type. However, only the
method provider will have miHdl->instance initialized. When
Cleanup() is called by SFCB, the instance Cleanup() is called
first, then the method Cleanup(). Problem: when instance
Cleanup() is called, the miHdl->Instance is null, so the provider
isn't called. Then the instance miHdl is free'd, and the MI_COUNT
is decremented (in the case of Python at least). Next the
method provider Cleanup() is called. The target provider's cleanup() is
called, and it may return CMPI_RC_DO_NOT_UNLOAD. So, the provider
is not unloaded. If a subsequent instance operation comes in,
we have a problem because the instance miHdl has already been
free'd. Also, the MI_COUNT is incorrect. So, we'll tell the
target provider we're always terminating until this can be
fixed.
Modified Paths:
--------------
cmpi-bindings/trunk/src/cmpi_provider.c
Modified: cmpi-bindings/trunk/src/cmpi_provider.c
===================================================================
--- cmpi-bindings/trunk/src/cmpi_provider.c 2009-02-26 04:03:49 UTC (rev 1165)
+++ cmpi-bindings/trunk/src/cmpi_provider.c 2009-02-27 00:03:27 UTC (rev 1166)
@@ -186,9 +186,6 @@
static pthread_mutex_t _CMPI_INIT_MUTEX = PTHREAD_MUTEX_INITIALIZER; /* mutex around _MI_COUNT */
static Target_Type _TARGET_MODULE = Target_Null; /* The target module (aka namespace) */
-/* on-demand init */
-#define TARGET_CMPI_INIT { if (((ProviderMIHandle*)(self->hdl))->instance == Target_Null) if (TargetInitialize(((ProviderMIHandle*)(self->hdl)), &status) != 0) return status; }
-
#if defined(SWIGPYTHON)
#include "target_python.c"
#endif
@@ -216,10 +213,6 @@
miHdl, miHdl->instance, context, terminating));
CMPIStatus status = {CMPI_RC_OK, NULL};
- // If an instance/method provider is loaded, but only an instance operation
- // is called, Cleanup() will be called twice (once for instance, once
- // for method). However, since only instance operations were requested,
- // miHdl->instance won't be set for one of the calls to Cleanup().
if (miHdl->instance != Target_Null)
{
Target_Type _context;
@@ -350,8 +343,6 @@
_SBLIM_TRACE(1,("EnumInstancesNames() called, context %p, result %p, reference %p", context, result, reference));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0);
_result = SWIG_NewPointerObj((void*) result, SWIGTYPE_p__CMPIResult, 0);
@@ -390,8 +381,6 @@
_SBLIM_TRACE(1,("EnumInstances() called, context %p, result %p, reference %p, properties %p", context, result, reference, properties));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0);
_result = SWIG_NewPointerObj((void*) result, SWIGTYPE_p__CMPIResult, 0);
@@ -431,8 +420,6 @@
_SBLIM_TRACE(1,("GetInstance() called, context %p, results %p, reference %p, properties %p", context, results, reference, properties));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0);
_result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0);
@@ -475,8 +462,6 @@
_SBLIM_TRACE(1,("CreateInstance() called, context %p, results %p, reference %p, newinstance %p", context, results, reference, newinstance));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0);
_result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0);
@@ -523,8 +508,6 @@
_SBLIM_TRACE(1,("SetInstance() called, context %p, results %p, reference %p, newinstance %p, properties %p", context, results, reference, newinstance, properties));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0);
_result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0);
@@ -563,8 +546,6 @@
_SBLIM_TRACE(1,("DeleteInstance() called, context %p, results %p, reference %p", context, results, reference));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0);
_result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0);
@@ -603,8 +584,6 @@
_SBLIM_TRACE(1,("ExecQuery() called, context %p, results %p, reference %p, query %s, language %s", context, results, reference, query, language));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0);
_result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0);
@@ -658,8 +637,6 @@
_SBLIM_TRACE(1,("associatorNames() called, ctx %p, rslt %p, objName %p, assocClass %s, resultClass %s, role %s, resultRole %s", ctx, rslt, objName, assocClass, resultClass, role, resultRole));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
_rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0);
@@ -727,8 +704,6 @@
_SBLIM_TRACE(1,("associators() called, ctx %p, rslt %p, objName %p, assocClass %s, resultClass %s, role %s, resultRole %s", ctx, rslt, objName, assocClass, resultClass, role, resultRole));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
_rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0);
@@ -793,8 +768,6 @@
_SBLIM_TRACE(1,("referenceNames() called, ctx %p, rslt %p, objName %p, resultClass %s, role %s", ctx, rslt, objName, resultClass, role));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
_rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0);
@@ -848,8 +821,6 @@
_SBLIM_TRACE(1,("references() called, ctx %p, rslt %p, objName %p, resultClass %s, role %s, properties %p", ctx, rslt, objName, resultClass, role, properties));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
_rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0);
@@ -902,8 +873,6 @@
_SBLIM_TRACE(1,("invokeMethod() called, ctx %p, rslt %p, objName %p, method %s, in %p, out %p", ctx, rslt, objName, method, in, out));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
_rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0);
@@ -947,8 +916,6 @@
_SBLIM_TRACE(1,("authorizeFilter() called, ctx %p, filter %p, className %s, classPath %p, owner %s", ctx, filter, className, classPath, owner));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
_filter = SWIG_NewPointerObj((void*) filter, SWIGTYPE_p__CMPISelectExp, 0);
@@ -989,8 +956,6 @@
_SBLIM_TRACE(1,("activateFilter() called, ctx %p, filter %p, className %s, classPath %p, firstActivation %d", ctx, filter, className, classPath, firstActivation));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
_filter = SWIG_NewPointerObj((void*) filter, SWIGTYPE_p__CMPISelectExp, 0);
@@ -1031,8 +996,6 @@
_SBLIM_TRACE(1,("deActivateFilter() called, ctx %p, filter %p, className %s, classPath %p, lastActivation %d", ctx, filter, className, classPath, lastActivation));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
_filter = SWIG_NewPointerObj((void*) filter, SWIGTYPE_p__CMPISelectExp, 0);
@@ -1075,8 +1038,6 @@
//_SBLIM_TRACE(1,("mustPoll() called, ctx %p, rslt %p, filter %p, className %s, classPath %p", ctx, rslt, filter, className, classPath));
_SBLIM_TRACE(1,("mustPoll() called, ctx %p, filter %p, className %s, classPath %p", ctx, filter, className, classPath));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
//Target_Type _rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0);
@@ -1110,8 +1071,6 @@
_SBLIM_TRACE(1,("enableIndications() called, ctx %p", ctx));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
@@ -1137,8 +1096,6 @@
_SBLIM_TRACE(1,("disableIndications() called, ctx %p", ctx));
- TARGET_CMPI_INIT
-
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
@@ -1205,18 +1162,14 @@
};
-static void
+static int
createInit(const CMPIBroker* broker,
- const CMPIContext* context, const char* miname, CMPIStatus* st)
+ const CMPIContext* context,
+ ProviderMIHandle* miHdl,
+ const char* miname, CMPIStatus* st)
{
- _SBLIM_TRACE(1,("\n>>>>> createInit() called, miname= %s (ctx=%p)\n", miname, context));
-
- /*
- * We can't initialize the target here and load target modules, because
- * SFCB passes a NULL CMPIStatus* st, which means we can't report
- * back error strings. Instead, we'll check and initialize in each
- * MIFT function
- */
+ _SBLIM_TRACE(1,("\n>>>>> createInit() called, broker %p, miname= %s (ctx=%p), status %p\n", broker, miname, context, st));
+ return TargetInitialize(miHdl, st);
}
@@ -1233,12 +1186,17 @@
hdl->miName = strdup(miname); \
hdl->broker = broker; \
} \
- mi= (CMPI##ptype##MI*)malloc(sizeof(CMPI##ptype##MI)); \
+ if (createInit(broker, context, hdl, miname, st) != 0) { \
+ if (st) st->rc = CMPI_RC_ERR_FAILED; \
+ free(hdl->miName); \
+ free(hdl); \
+ return NULL; \
+ } \
+ mi = (CMPI##ptype##MI*)malloc(sizeof(CMPI##ptype##MI)); \
if (mi) { \
mi->hdl = hdl; \
mi->ft = &ptype##MIFT__; \
} \
- createInit(broker, context, miname, st); \
/*_SBLIM_TRACE(1, ("\n>>>>> returning mi=0x%08x mi->hdl=0x%08x mi->ft=0x%08x", mi, mi->hdl, mi->ft));*/ \
++_MI_COUNT; \
return mi; \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2009-02-26 04:03:54
|
Revision: 1165
http://omc.svn.sourceforge.net/omc/?rev=1165&view=rev
Author: bartw
Date: 2009-02-26 04:03:49 +0000 (Thu, 26 Feb 2009)
Log Message:
-----------
Pass cleanup function along to providers so they can perform necessary
cleanup. Allow them to specify that they don't want to be unloaded.
Modified Paths:
--------------
cmpi-bindings/trunk/src/cmpi_provider.c
cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
Modified: cmpi-bindings/trunk/src/cmpi_provider.c
===================================================================
--- cmpi-bindings/trunk/src/cmpi_provider.c 2009-01-27 21:42:25 UTC (rev 1164)
+++ cmpi-bindings/trunk/src/cmpi_provider.c 2009-02-26 04:03:49 UTC (rev 1165)
@@ -212,7 +212,35 @@
const CMPIContext * context,
CMPIBoolean terminating)
{
- CMPIStatus status = {CMPI_RC_OK, NULL}; /* Return status of CIM operations. */
+ _SBLIM_TRACE(1,("Cleanup() called, miHdl %p, miHdl->instance %p, context %p, terminating %d",
+ miHdl, miHdl->instance, context, terminating));
+ CMPIStatus status = {CMPI_RC_OK, NULL};
+
+ // If an instance/method provider is loaded, but only an instance operation
+ // is called, Cleanup() will be called twice (once for instance, once
+ // for method). However, since only instance operations were requested,
+ // miHdl->instance won't be set for one of the calls to Cleanup().
+ if (miHdl->instance != Target_Null)
+ {
+ Target_Type _context;
+ Target_Type _terminating;
+
+ TARGET_THREAD_BEGIN_BLOCK;
+ _context = SWIG_NewPointerObj((void*) context,
+ SWIGTYPE_p__CMPIContext, 0);
+ _terminating = Target_Bool(terminating);
+
+ TargetCall(miHdl, &status, "cleanup", 2, _context, _terminating);
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("Cleanup() %d", status.rc));
+ }
+
+ if (!terminating && (status.rc == CMPI_RC_DO_NOT_UNLOAD ||
+ status.rc == CMPI_RC_NEVER_UNLOAD))
+ {
+ _SBLIM_TRACE(1,("Cleanup() Provider requested not to be unloaded."));
+ return status;
+ }
if (miHdl != NULL)
{
@@ -224,7 +252,6 @@
free(miHdl);
miHdl = NULL;
}
-
TargetCleanup();
_SBLIM_TRACE(1,("Cleanup() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
===================================================================
--- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2009-01-27 21:42:25 UTC (rev 1164)
+++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2009-02-26 04:03:49 UTC (rev 1165)
@@ -673,6 +673,18 @@
return (0, '')
+ def cleanup(self, ctx, terminating):
+ env = ProviderEnvironment(self, ctx)
+ try:
+ if not terminating:
+ if not self.proxy.MI_canunload(env):
+ return (cmpi.CMPI_RC_DO_NOT_UNLOAD, '')
+ self.proxy.MI_shutdown(env)
+ except pywbem.CIMError, args:
+ return args[:2]
+
+ return (0, '')
+
# conversion routines
#######################################################################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|