예제 #1
0
CMPIArgs* KBase_ToArgs(
    const KBase* self, 
    CMPIBoolean in,
    CMPIBoolean out,
    CMPIStatus* status)
{
    CMPIArgs* ca;
    CMPIStatus st;

    /* Check parameters */

    if (!self || self->magic != KMAGIC)
    {
        KSetStatus(&st, ERR_FAILED);
        return NULL;
    }

    /* Create args */

    if (!(ca = CMNewArgs(self->cb, status)))
        return NULL;

    if (!KOkay(st = KBase_SetToArgs(self, in, out, ca)))
    {
        __KSetStatus(status, st.rc);
        return NULL;
    }

    return ca;
}
예제 #2
0
static CMPIResult* _DefaultGI_clone(
    const CMPIResult* self, 
    CMPIStatus* status)
{
    if (status)
        KSetStatus(status, ERR_FAILED);

    return NULL;
}
예제 #3
0
CMPIObjectPath* KBase_ToObjectPath(
    const KBase* self, 
    CMPIStatus* st)
{
    KPos pos;
    CMPIObjectPath* cop;

    /* Check parameters */

    if (self->magic != KMAGIC)
    {
        KSetStatus(st, ERR_FAILED);
        return NULL;
    }

    /* Create object path */

    KFirst(&pos, self);

    if (!(cop = CMNewObjectPath(self->cb, KChars(self->ns), pos.classname, 
        st)))
    {
        return NULL;
    }

    /* Set keys */

    while (KMore(&pos))
    {
        CMPIData cd;
        const KValue* value = (const KValue*)pos.field;

        if (value->exists && (pos.tag & KTAG_KEY))
        {
            CMPIStatus st;

            cd = _data(value, pos.tag);

            if (value->null)
                st = CMAddKey(cop, pos.name, NULL, cd.type);
            else
                st = CMAddKey(cop, pos.name, &cd.value, cd.type);

            if (!KOkay(st))
            {
                /* ATTN: log this but do not return! */
            }
        }

        KNext(&pos);
    }

    return cop;
}
예제 #4
0
KUint32 LMI_NFS_Share_RequestStateChange(
    const CMPIBroker* cb,
    CMPIMethodMI* mi,
    const CMPIContext* context,
    const LMI_NFS_ShareRef* self,
    const KUint16* RequestedState,
    KRef* Job,
    const KDateTime* TimeoutPeriod,
    CMPIStatus* status)
{
    KUint32 result = KUINT32_INIT;

    KSetStatus(status, ERR_NOT_SUPPORTED);
    return result;
}
예제 #5
0
CMPIInstance* KBase_ToInstance(
    const KBase* self, 
    CMPIStatus* st)
{
    KPos pos;
    CMPIObjectPath* cop;
    CMPIInstance* ci;

    /* Check parameters */

    if (self->magic != KMAGIC)
    {
        KSetStatus(st, ERR_FAILED);
        return NULL;
    }

    if (!self->ns)
    {
        /* Ignore */
    }

    /* Create object path */

    if (!(cop = KBase_ToObjectPath(self, st)))
    {
        return NULL;
    }

    /* Create instance */

    if (!(ci = CMNewInstance(self->cb, cop, st)))
        return NULL;

    /* Set properties */

    KFirst(&pos, self);

    while (KMore(&pos))
    {
        CMPIData cd;
        const KValue* value = (const KValue*)pos.field;

        if (value->exists)
        {
            CMPIStatus st;

            cd = _data(value, pos.tag);

            if (value->null)
                st = CMSetProperty(ci, pos.name, NULL, cd.type);
            else
                st = CMSetProperty(ci, pos.name, &cd.value, cd.type);

            if (!KOkay(st))
            {
                /* ATTN: log this but do not return! */
            }
        }

        KNext(&pos);
    }

    return ci;
}