[Libvirt-cim] [PATCH] Update EC to add support for VSMS to VSMC association

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Sat Feb 9 00:30:15 UTC 2008


Kaitlin Rupert wrote:
> Kaitlin Rupert wrote:
>> # HG changeset patch
>> # User Kaitlin Rupert <karupert at us.ibm.com>
>> # Date 1202490035 28800
>> # Node ID 54ffc7df5a17a13811ad65f968b7d780330630f7
>> # Parent  59c1d98cf8989adff7530eac08abee7b79a6cc03
>> Update EC to add support for VSMS to VSMC association.
>>
>> Removed the instance property validation.  The get_vsms() (etc) calls 
>> will need to be updated to handle the reference validation.
>>
>> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>>     +static CMPIStatus validate_caps_get_service(const CMPIObjectPath 
>> *ref,
>> +                                            CMPIInstance **inst)
>> +{
>> +        CMPIStatus s = {CMPI_RC_OK, NULL};
>> +        CMPIInstance *_inst;
>> +        char* classname;
>> +
>>          classname = class_base_name(CLASSNAME(ref));
>>
>>          if (STREQC(classname, "VirtualSystemManagementCapabilities")) {
>> -                s = get_vsm_cap(_BROKER, ref, &inst);
>> +                s = get_vsm_cap(_BROKER, ref, &_inst);
>> +                if ((s.rc != CMPI_RC_OK) || (_inst == NULL))
>> +                        goto out;
>> +
>> +                s = get_vsms(ref, &_inst, _BROKER);
>>          } else if (STREQC(classname, 
>> "VirtualSystemMigrationCapabilities")) {
>> -                s = get_migration_caps(ref, &inst, _BROKER);
>> -        }
>> -        -        if (s.rc != CMPI_RC_OK)
>> -                goto out;
>> -        -        prop = cu_compare_ref(ref, inst);
>> -        if (prop != NULL) {
>> -                cu_statusf(_BROKER, &s,
>> -                           CMPI_RC_ERR_NOT_FOUND,
>> -                           "No such instance (%s)", prop);
>> -        }
>> -        
> 
> I understand that this currently breaks the reference checking, but I 
> think it's a good idea to have the class get_<> functions do that 
> checking.  Thoughts?
> 
> Also, I'm sure that this function, the validate_service_get_caps() and 
> validate_service_ref() can be consolidated somehow, but I haven't worked 
> up a clean solution yet,
> 
> So this patch is a first step in a set of related changes.

I should also note that I have reference validation patches worked out 
for get_vsms(), get_vsm_cap(), get_migration_service(), 
get_migration_caps() that I can send out once this patch is approved.

They're dependent on this patch, and it's quite a large set, so I 
thought I'd wait to send them.

Thanks =)

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




More information about the Libvirt-cim mailing list