[Libvirt-cim] [PATCH 3 of 3] Enhance handling of input parameter of std_association logic

Heidi Eckhart heidieck at linux.vnet.ibm.com
Fri Nov 30 10:54:55 UTC 2007


Kaitlin Rupert wrote:
> This works for associations.  But for references, the result class is 
> the association class name.  So, when you call std_assoc_get_handler() 
> from do_ref(), you end up checking the client's result class (which is 
> the association name) against the result class list instead of the 
> association list.  Here's some sample debug:
>
> std_association.c(152): Calling Provider: 
> 'associationVirt_HostedDependencyProvider'
> std_association.c(182): Check client's resultClass: 
> 'Xen_HostedDependency'
> std_association.c(78): provider accepts Xen_ComputerSystem resultclass
> std_association.c(78): provider accepts KVM_ComputerSystem resultclass
> std_association.c(190): ResultClass not valid.
> std_association.c(302): No handler found.
>
> You could add flag argument to std_assoc_get_handler() that indicates 
> whether the call is asking for references or an associators.  
> Although, I'm not sure that's the most elegant way.
>
> Also, adding the debug messages that print which values the provider 
> is checking the result class / assoc class / etc might be useful - 
> that is, print out what classes the provider accepts.  Someone else 
> can chime in as to whether this would be useful.
That's also a very good catch :). You are great in indicating bugs in 
the association logic :) !
Fortunately this can be fixed very easy - the assocClass and resultClass 
values have only been swapped while setting std_assoc_info values in 
stda_ReferenceNames() and stda_References(). In the case of reference 
calls the client's resultClass value needs to become the value for 
assocClass internally.

@@ -373,8 +397,8 @@ CMPIStatus stda_ReferenceNames(CMPIAssoc
                                const char *role)
 {
         struct std_assoc_info info = {
-                NULL,
-                resultClass,
+                resultClass ,
+                NULL,
                 role,
                 NULL,
                 NULL,
@@ -394,8 +418,8 @@ CMPIStatus stda_References(CMPIAssociati
                            const char **properties)
 {
         struct std_assoc_info info = {
-                NULL,
                 resultClass,
+                NULL,
                 role,
                 NULL,
                 properties,


-- 
Regards

Heidi Eckhart
Software Engineer
Linux Technology Center - Open Hypervisor

heidieck at linux.vnet.ibm.com

**************************************************
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294




More information about the Libvirt-cim mailing list