[Libvirt-cim] [PATCH] [TEST] #3 Update VSMS 14_define_sys_disk.py to use cim_define()

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Feb 10 15:21:13 UTC 2009


Kaitlin Rupert wrote:
>>>
>>> -    params = { 'vssd' : vssd,
>>> -               'rasd' : rasd_list -             }
>>> +    return rasd_list
>>> -    return params +def verify_disk_path(ip, virt, addr, guest_name):
>>> +    inst = None
>>> +
>>> +    try:
>>> +        drasd_cn = get_typed_class(virt, 
>>> 'DiskResourceAllocationSettingData')
>>> +        enum_list = EnumInstances(ip, drasd_cn)
>>>   
>> GetInstance of the DiskRASD would be much more simpler than 
>> EnumInstances.
>> Any reason behind using EnumInstances instead .
> 
> Using GetInstance() means that you have to know how the InstanceID of 
> the reference you're querying is formatted.  The only reason we know how 
> the InstanceID is formatted is because we know how the providers work =)
> 
> The idea behind CIM is that you don't have to know how the underlying 
> implementation works in order to get information from the providers.  So 
> a CIM client shouldn't need to know how we format our InstanceIDs in 
> order to use our providers.
> 
> I'm not sure how often CIM clients build their own references.  In 
> reality, they should be using the references the providers return.  They 
> shouldn't be building their own (like we do in cimtest's GetInstance() 
> call).
> 
> So I try to use EnumInstances() to avoid building my own reference. This 
> forces the providers to return the references for me.
> 
> cimtest's GetInstance() function really should only take a reference as 
> a parameter instead of taking keys and doing a call to CIMInstanceName().
> 
> But faking a reference can be useful in some situations. =)  I'm 
> inclined to leave this as is unless you think it'd be easier to read / 
> maintain with GetInstance() in place of EnumInstances().

Deepti - is this patch ready to go?  Or should I change EnumInstances() 
to GetInstance()?

Thanks!

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




More information about the Libvirt-cim mailing list