Re: CIMOM refuses EmbeddedObject with unknown class

Jan Safranek <[email protected]> Fri, 29 Mar 2013 14:26:56 +0100
Newsgroups gmane.network.open-pegasus.general
Message-ID <[email protected]>
On 03/20/2013 08:12 PM, Andreas Maier wrote:
> Let me make it more concrete (and modify it a bit): The classes that have
> the dynamic set of properties are __MethodParameters, __JobInParameters and
> __JobOutParameters, so these would be defined as empty top-level classes,
> and they would have one subclass for each extrinsic method that needs Job
> Control support. The parameters of these methods will determine the set of
> properties in these subclasses. These three top-level classes would be
> defined with the Indication qualifier (to allow them having embedded
> instances but no keys), and thus they would not inherit from
> CIM_ManagedElement (which is only the mother of all non-association and
> non-indication classes, and that is not a requirement but just the current
> convention in the CIM Schema).
> 
> The potential caveat with the idea is whether or not these method-specific
> subclasses prevent an implementation of the Job Control Profile that is
> stands on its own, independent of these methods.
> 
> Jan,
> is this something you could try out ?

Finally I've tried to declare class for every asynchronous method and I
stumbled upon references.

As the text above suggests, I should use Indication qualifier for my
__MethodResult:

[Indication]
class __MethodResult
{
};

/* uint32 ReturnToStoragePool(
 *     [OUT] CIM_ConcreteJob Job,
 *     [IN]  CIM_LogicalElement TheElement)
 */
class __ReturnToStoragePoolParameters : __MethodResult
{
     CIM_LogicalElement REF TheElement;
};

With this MOF file I get an error that references are allowed only in
associations. Ok, if I use [Association], it is working. Until I try
more complex method:

/* uint32 CreateOrModifyElementFromElements (
 *     [IN}  string ElementName,
 *     [IN]  uint16 ElementType,
 *     [OUT] CIM_ConcreteJob Job,
 *     [IN]  CIM_ManagedElement Goal,
 *     [IN,OUT] uint64 Size,
 *     [IN] CIM_StorageExtent REF InElements[],
 *     [IN,OUT] CIM_LogicalElement TheElement)
 */
[Association]
class __CreateOrModifyElementFromElementsParameters : __MethodResult
{
    string ElementName;
    uint16 ElementType;
    CIM_ManagedElement REF Goal;
    uint64 Size;
    CIM_StorageExtent REF InElements[];
    CIM_LogicalElement REF TheElement;
};

Now cimmof complains "syntax error before '['", meaning it does not like
array "StorageExtent REF InElements[]". Such array is highly unlikely to
find in an association and thus is rejected.

So, even more changes may be necessary in Pegasus to allow embedded
objects with unknown '__MethodResult' class. If I should create a class
for every asynchronous method, I need some changes in the MOF parser then.

Jan