[Libvirt-cim] [PATCH 1 of 2] [CU] Add embedded object parse functionality to std_invokemethod

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Jan 29 15:40:03 UTC 2008


Kaitlin Rupert wrote:
> Dan Smith wrote:
>> KR> Yes, since modify args.  This is the new arg element that will
>> KR> eventually be returned.
>>
>> Er, the rest of the function only seems to call CMAddArg(*args, ...),
>> which doesn't necessitate a double pointer.  Unless I missed something
>> like:
>>   *args = CMNewArgs(...);
>>
>> then I think you're fine.
>>
>> KR> However, based on the suggestion above, I think things can be
>> KR> reworked so that we won't need the double-pointer.
>>
>> Even better :)
> 
> Hmm - I didn't end up fixing this. The call is:
> 
> +static int parse_eo_param(CMPIArgs **args,
> +                          const CMPIBroker *broker,
> +                          CMPIData data,
> +                          CMPIType type,
> +                          const char *arg_name,
> +                          const char *ns,
> +                          CMPIStatus *s)
> +{
> 
> parse_eo_param() updates the args list using CMAddArg(). 
> parse_eo_param() is called by validate_arg_type().  validate_arg_type() 
> gets called on every arg in the original arg list.
> 
> So, to remove the double pointer, you'd either need to pass the value up 
> from parse_eo_param() to validate_arg_type() and then up again, or you 
> can just pass the arg list down and modify it as you go.
> 
> I took a look at passing the value up, but dealing with a CMPIValue arg 
> didn't seem as clean.  I'm definitely open to suggestions here though, 
> because I think this is awkward as it is.
> 

Ah, my mistake on the double-pointer here.  For some reason, I was 
thinking we'd need the double-pointer so that we could update the arg 
list.  But we only need to update what the pointer points to, so you're 
right - we can remove the double pointer.  I'll send out an update.

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list