[go: up one dir, main page]

Menu

Commit [r1166]  Maximize  Restore  History

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.

bartw 2009-02-27

changed /cmpi-bindings/trunk/src/cmpi_provider.c