[Libvirt-cim] [PATCH 1 of 2] SDC: returned instances are not of type specific subclass

Jay Gagnon grendel at linux.vnet.ibm.com
Tue Dec 11 18:35:15 UTC 2007


Kaitlin Rupert wrote:
> Heidi Eckhart wrote:
>>        +        if (base)
>> +                inst = get_typed_instance(broker,
>> +                                          CLASSNAME(ref),
>> +                                          base,
>> +                                          NAMESPACE(ref));
>>                   CMSetProperty(inst, "InstanceID", inst_id,
>> CMPI_chars);
>>          CMSetProperty(inst, "PropertyPolicy", &policy, CMPI_uint16);
>>   
> Should there be an else statement here?  If the if statement fails,
> then an instance isn't created.  CMSetProperty() would be trying to
> get the value of a NULL inst, which would most likely fail.
>
Seems like a good idea to me.  Just something simple that sets status as
appropriate and bails is all that should be necessary there.

-- 

-Jay




More information about the Libvirt-cim mailing list