[Libvirt-cim] [PATCH] (2) Remove the embedded object parsing pieces from VirtualSystemManagmentService

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Fri Feb 1 15:44:50 UTC 2008


Heidi Eckhart wrote:
> Kaitlin Rupert wrote:
>> # HG changeset patch
>> # User Kaitlin Rupert <karupert at us.ibm.com>
>> # Date 1201801531 28800
>> # Node ID e27208a0ac3f69df3f704ecd32fdfdc78b79dc7c
>> # Parent  b8d69e734306e618b4efb53e23c17ffdd8bab128
>> (2) Remove the embedded object parsing pieces from 
>> VirtualSystemManagmentService.
>>
>> Updates from set 1 to set 2:
>>    Removed unsused sys_op from define_system()
>>    Removed unused list from update_resource_setting()
>>    Changed CMPIArray **out_arr to **ret_arr in rasd_refs_to_insts()
>>
>>   
> Opps, sorry, I'm sure I was not very clear on what I meant with the 
> out_arr. I thought something like this might look better in the code ... 
> instead of submitting *out_arr submitting a ret_arr (which itself 
> becomes the content of *out_arr at the end).

Oh, yes - I did misunderstand.  Thanks for the clarification. =)

However, I'm not sure what benefit this gives us.  I think I'm missing 
something - does this change prevent an error condition of some sort?

Thanks!

> 
>>  static CMPIStatus rasd_refs_to_insts(const CMPIContext *ctx,
>>                                       const CMPIObjectPath *reference,
>>                                       CMPIArray *arr,
>> -                                     struct inst_list *list)
>> +                                     CMPIArray **ret_arr)
>>  {
>>          CMPIStatus s;
>>          int i;
>>
>>   
> CMPIArray *ret_arr;
>> @@ -1049,6 +994,11 @@ static CMPIStatus rasd_refs_to_insts(con
>>          c = CMGetArrayCount(arr, &s);
>>          if (s.rc != CMPI_RC_OK)
>>                  return s;
>> +
>> +        *ret_arr = CMNewArray(_BROKER,
>>   
> ret_arr = CMNewArray(_BROKER,
>> +                              c,
>> +                              CMPI_instance,
>> +                              &s);
>>          for (i = 0; i < c; i++) {
>>                  CMPIData d;
>> @@ -1079,7 +1029,9 @@ static CMPIStatus rasd_refs_to_insts(con
>>
>>                  inst = get_rasd_instance(ctx, reference, _BROKER, id, 
>> type);
>>                  if (inst != NULL)
>> -                        inst_list_add(list, inst);
>> +                        CMSetArrayElementAt(*ret_arr, i,
>>   
> CMSetArrayElementAt(ret_arr, i,
>> +                                            &inst,
>> +                                            CMPI_instance);
>>                  else
>>                          CU_DEBUG("Failed to get instance for `%s'",
>>                                   REF2STR(ref));
>>
>>   
> ret_arr = *out_arr;
> 


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




More information about the Libvirt-cim mailing list