
+ + if (properties != NULL) { + const char *keys[] = {"InstanceID", NULL}; + s = CMSetPropertyFilter(inst, properties, keys); + /* FIXME - in case of an error, should we continue on? */ + if (s.rc != CMPI_RC_OK) + CU_DEBUG("Unable to set property filter: %d", s.rc); + }
That's a very good point to enable the provider interfaces for the property filtering :). I think it makes sense to move this code into get_typed_instance() of libxkutil, to avoid implementing these lines for every provider. What's then only necessary is routing the properties list through the interfaces. But you will now think ... and how about the keys ? Well, that's an interesting thing. The CMPI 2.0 spec tells the following about the keys: CMPI 2.0 Spec; "The keyList argument shall be ignored by the MB; it is here to maintain binary compatibility with previous specifications. Providers should explicitly set the key names and values via the CMPIInstanceMI.setObjectPath() function." Translated I think this means, that we can ignore the keys by setting it to NULL. Do you agree ?
I tried using NULL for the keys based on the same line from the CMPI spec, but this crashed the provider. I might be missing something though.
You can also skip the check if a the properties filter is there, as NULL is interpreted as "all properties accepted". CMPI 2.0 Spec: "The propertyList argument defines the properties that will be accepted by subsequent setProperty() operations. The propertyList argument is an array of pointers to character strings, terminated by a NULL pointer. A NULL value effectively means that all properties will be accepted. A pointer to an empty list means that no properties will be accepted."
Ah, good to know. I'll remove this check and rebase the patch on your recent changes. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com