[Libvirt-cim] [PATCH 1 of 3] Add function to validate the client given object path o ComputerSystem
Kaitlin Rupert
kaitlin at linux.vnet.ibm.com
Fri Jan 11 16:41:25 UTC 2008
Heidi Eckhart wrote:.
>
> But your comments made me rethink about the patch. So I've consolidated
> and reordered a bit.
> - added a new function to libcmpiutil - cu_validate_ref(ref, inst) -
> that does the check between the system instance and the client given
> instance
I think this is a good idea. It seems like it'll be useful in other
places as well.
> - get_domain() is now using the new libcmpiutil function
> - the parameter CMPIInstance **inst is now used to "configure"
> get_domain(); for internal usage the inst is returned and for external
> usage this can be ignored by setting it to NULL
> - validate_domain_ref() is now only an interface name for the client;
> this could also be removed and the provider has then to call
> get_domain(broker, ref, NULL) or simply ignores the returned instance;
> but what I do not really like is, that this can confuse the reader of
> the code; but I'm open for discussion and opinions
As far as readability, I'm fine with this method. As an alternative,
you could have get_domain() return an instance and take a CMPIStatus
variable as a parameter. The provider can then choose to ignore the
returned instance. But that doesn't really fit with our existing code
style.
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
More information about the Libvirt-cim
mailing list