[Libvirt-cim] [PATCH 2 of 2] Clean up CSI/CSMI integration

Jay Gagnon grendel at linux.vnet.ibm.com
Thu Jan 17 15:03:16 UTC 2008


Heidi Eckhart wrote:
> Jay Gagnon wrote:
>> # HG changeset patch
>> # User Jay Gagnon <grendel at linux.vnet.ibm.com>
>> # Date 1200514883 18000
>> # Node ID dd91142f9b502f4c3f134fe3c51c105c4a290cb1
>> # Parent  e4000f4735b6e90b0b0acc4fd40d8d9c06800032
>> Clean up CSI/CSMI integration
>>
>> The functions responsible for actually firing the indication weren't
>> really integrated in the first patch, so much as co-existing.  This
>> one attempts to reconcile the two approaches, although there is still
>> probably more that can be done.
>>
>> Signed-off-by: Jay Gagnon <grendel at linux.vnet.ibm.com>
>>   @@ -310,11 +285,10 @@ static bool async_ind(CMPIContext *conte
>>                  /* A deleted domain will have no instance to lookup */
>>                  newinst = CMNewInstance(_BROKER, op, &s);
>>
>> -        op = CMGetObjectPath(newinst, NULL);
>> -
>>          free(type_cn);
>>
>> -        return _lifecycle_indication(_BROKER, context, op, type_name);
>> +        return _do_indication(_BROKER, context, newinst, type,
>> type_name, +                              prefix, ns);
>>  }
>>
>>  static bool mod_ind(CMPIContext *context,
>> @@ -344,7 +318,9 @@ static bool mod_ind(CMPIContext *context
>>          CMSetProperty(mod_inst, "UUID",
>>                        (CMPIValue *)prev_dom.uuid, CMPI_chars);
>>
>> -        rc = _do_modified_indication(_BROKER, context, mod_inst,
>> prefix, ns);
>> +        rc = _do_indication(_BROKER, context, mod_inst,
>> +                            CS_MODIFIED,
>> "ComputerSystemModifiedIndication", +                           
>> prefix, ns);
>>
>>     
> Is it possible to merge async_ind() and mod_ind() ? For me it looks
> like, that async_ind() can be updated to also handle the modification
> case.
>
I made an early attempt to do that before I sent the patch out, but
found that there were so many if-else blocks to handle the differences
that it wasn't worth it.  I was also operating under the assumption that
I would lose some of the original functionality (information content
really), because I would need to switch Created and Deleted over to use
a struct dom_xml instead of a virDomainPtr.  But it appears that I may
have been wrong there, and all of them can use the list of dom_xml
structs that Modified requires, which would allow for considerable
consolidation.

I will give that a shot right now and see how it turns out.

-- 

-Jay




More information about the Libvirt-cim mailing list