
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196844145 -3600 # Node ID 5b933cf3854176ae75fd07fe0c518a0aedb19a2b # Parent 904b939c9b2ae55caf2d7e713747fce00b7bcecc SD: Provider registered per subclass The provider registration approach - registering one provider per subclass (Xen_<classname>Provider, KVM_<classname>Provider) caused interoperability issues with Pegasus and sfcb. The same call returned duplicates with sfcb and worked with Pegasus. Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r 904b939c9b2a -r 5b933cf38541 schema/SystemDevice.registration --- a/schema/SystemDevice.registration Wed Dec 05 09:42:24 2007 +0100 +++ b/schema/SystemDevice.registration Wed Dec 05 09:42:25 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes -Xen_SystemDevice root/virt Xen_SystemDeviceProvider Virt_SystemDevice association -KVM_SystemDevice root/virt KVM_SystemDeviceProvider Virt_SystemDevice association +Xen_SystemDevice root/virt Virt_SystemDeviceProvider Virt_SystemDevice association +KVM_SystemDevice root/virt Virt_SystemDeviceProvider Virt_SystemDevice association diff -r 904b939c9b2a -r 5b933cf38541 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Wed Dec 05 09:42:24 2007 +0100 +++ b/src/Virt_SystemDevice.c Wed Dec 05 09:42:25 2007 +0100 @@ -162,7 +162,8 @@ static CMPIStatus sys_to_dev(const CMPIO CMPIStatus s = {CMPI_RC_OK, NULL}; int ret; - ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "Name", &host) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -196,9 +197,10 @@ static CMPIStatus dev_to_sys(const CMPIO char *host = NULL; char *dev = NULL; CMPIInstance *sys; - CMPIStatus s; - - ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "DeviceID", &devid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -288,8 +290,7 @@ static struct std_assoc *assoc_handlers[ NULL }; -STDA_AssocMIStub(, Xen_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers); -STDA_AssocMIStub(, KVM_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers); +STDA_AssocMIStub(, Virt_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: