[Libvirt-cim] [PATCH 1 of 3] [CU] Turn std_indication's awesome knob to eleven

Dan Smith danms at us.ibm.com
Mon Feb 25 21:47:21 UTC 2008


JG>  static CMPIStatus trigger(struct std_indication_ctx *ctx,
JG>                            const CMPIContext *context)
JG>  {
JG> -        if (ctx->handler->trigger_fn == NULL)
JG> +        if (ctx->handler == NULL || ctx->handler->trigger_fn == NULL)
JG>                  return (CMPIStatus){CMPI_RC_OK, NULL};

Maybe I'm misreading the diff, but do you check for enabled/activated
on trigger?

JG> +CMPIStatus stdi_activate_filter(CMPIIndicationMI* mi,
JG> +                                const CMPIContext* ctx,
JG> +                                const CMPISelectExp* se,
JG> +                                const char *ns,
JG> +                                const CMPIObjectPath* op,
JG> +                                CMPIBoolean first)
JG> +{
JG> +        CMPIStatus s = {CMPI_RC_OK, NULL};
JG> +        struct std_indication_ctx *_ctx;
JG> +        _ctx = (struct std_indication_ctx *)mi->hdl;
JG> +        char *cn = NULL;
JG> +        
JG> +        _ctx = (struct std_indication_ctx *)mi->hdl;

Looks like you have the _ctx initialization twice in here.  Remove the
first to avoid intermixed statements and declarations.

JG> +CMPIStatus stdi_deactivate_filter(CMPIIndicationMI* mi,
JG> +                                  const CMPIContext* ctx,
JG> +                                  const CMPISelectExp* se,
JG> +                                  const  char *ns,
JG> +                                  const CMPIObjectPath* op,
JG> +                                  CMPIBoolean last)
JG> +{
JG> +        CMPIStatus s = {CMPI_RC_OK, NULL};
JG> +        struct std_indication_ctx *_ctx;
JG> +        _ctx = (struct std_indication_ctx *)mi->hdl;
JG> +        char *cn = NULL;
JG> +
JG> +        _ctx = (struct std_indication_ctx *)mi->hdl;

Here too.

JG> +_EI_RTYPE stdi_enable_indications (CMPIIndicationMI* mi,
JG> +                                   const CMPIContext *ctx)
JG> +{
JG> +        struct std_indication_ctx *_ctx;
JG> +        _ctx = (struct std_indication_ctx *)mi->hdl;
JG> +
JG> +        CU_DEBUG("enabling indications");

I think this debug would be a lot more useful if it had the indication
type in it.  Would that be much trouble?

JG> +_EI_RTYPE stdi_disable_indications (CMPIIndicationMI* mi,
JG> +                                    const CMPIContext *ctx)
JG> +{
JG> +        struct std_indication_ctx *_ctx;
JG> +        _ctx = (struct std_indication_ctx *)mi->hdl;
JG> +
JG> +        CU_DEBUG("disabling indications");

This one too.

Otherwise this looks fantastic...Thanks!

-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms at us.ibm.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20080225/596149fd/attachment.sig>


More information about the Libvirt-cim mailing list