[PATCH 0 of 9] #2 - Reorganized association provider registration

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. Diff to patch #1: - clarified patch message - added match_hypervsior_prefix to association's handler functions Tested for sfcb and Pegasus, but encountered a strange behavior with Pegasus. Please can someone try to reproduce this on his/her system ? The following call wbemain -ac CIM_HostedDependency -noverify 'http://pegasus:pegasus@localhost/root/virt:KVM_HostSystem.CreationClassName="KVM_HostSystem",Name="localhost.localdomain"' should return localhost:5988/root/virt:KVM_ResourcePoolConfigurationService.SystemCreationClassName="KVM_HostSystem",SystemName="localhost.localdomain",CreationClassName="KVM_ResourcePoolConfigurationService",Name="RPCS" localhost:5988/root/virt:KVM_VirtualSystemManagementService.SystemCreationClassName="KVM_HostSystem",SystemName="localhost.localdomain",CreationClassName="KVM_VirtualSystemManagementService",Name="Management Service" localhost:5988/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1" but the returned results for Pegasus depend on the order, in which the providers Virt_HostedDependency and Virt_HostedService have been called. Either localhost:5988/root/virt:KVM_ResourcePoolConfigurationService.SystemCreationClassName="KVM_HostSystem",SystemName="localhost.localdomain",CreationClassName="KVM_ResourcePoolConfigurationService",Name="RPCS" localhost:5988/root/virt:KVM_VirtualSystemManagementService.SystemCreationClassName="KVM_HostSystem",SystemName="localhost.localdomain",CreationClassName="KVM_VirtualSystemManagementService",Name="Management Service" is returned if, Virt_HostedService was called first or localhost:5988/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1" is returned, if Virt_HostedDependency was called first. Thanks ... Heidi

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196844139 -3600 # Node ID 6500573879debb5d6086df84e17d4336090d8e92 # Parent 8140438a647cd53017d79b7036702fc053fe9e9c EAFP: 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 8140438a647c -r 6500573879de schema/ElementAllocatedFromPool.registration --- a/schema/ElementAllocatedFromPool.registration Fri Nov 30 17:21:33 2007 -0800 +++ b/schema/ElementAllocatedFromPool.registration Wed Dec 05 09:42:19 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes -Xen_ElementAllocatedFromPool root/virt Xen_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association -KVM_ElementAllocatedFromPool root/virt KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association +Xen_ElementAllocatedFromPool root/virt Virt_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association +KVM_ElementAllocatedFromPool root/virt Virt_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association diff -r 8140438a647c -r 6500573879de src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Fri Nov 30 17:21:33 2007 -0800 +++ b/src/Virt_ElementAllocatedFromPool.c Wed Dec 05 09:42:19 2007 +0100 @@ -61,12 +61,15 @@ static CMPIStatus vdev_to_pool(const CMP struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; uint16_t type; const char *id = NULL; char *poolid = NULL; virConnectPtr conn = NULL; CMPIInstance *pool = NULL; + + if (!match_hypervisor_prefix(ref, info)) + return s; type = class_to_type(ref); if (type == 0) { @@ -196,7 +199,10 @@ static CMPIStatus pool_to_vdev(const CMP struct inst_list *list) { const char *poolid; - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "InstanceID", &poolid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -326,8 +332,7 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); -STDA_AssocMIStub(, KVM_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, Virt_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables:

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196844140 -3600 # Node ID b07a0b1db5d9bb50e80d08a06d8138de3a132c69 # Parent 6500573879debb5d6086df84e17d4336090d8e92 EC: 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 6500573879de -r b07a0b1db5d9 schema/ElementCapabilities.registration --- a/schema/ElementCapabilities.registration Wed Dec 05 09:42:19 2007 +0100 +++ b/schema/ElementCapabilities.registration Wed Dec 05 09:42:20 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes -Xen_ElementCapabilities root/virt Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association -KVM_ElementCapabilities root/virt KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association +Xen_ElementCapabilities root/virt Virt_ElementCapabilitiesProvider Virt_ElementCapabilities association +KVM_ElementCapabilities root/virt Virt_ElementCapabilitiesProvider Virt_ElementCapabilities association diff -r 6500573879de -r b07a0b1db5d9 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Wed Dec 05 09:42:19 2007 +0100 +++ b/src/Virt_ElementCapabilities.c Wed Dec 05 09:42:20 2007 +0100 @@ -54,6 +54,9 @@ static CMPIStatus sys_to_cap(const CMPIO CMPIStatus s = {CMPI_RC_OK, NULL}; const char *prop; + if (!match_hypervisor_prefix(ref, info)) + return s; + s = get_host_cs(_BROKER, ref, &inst); if (s.rc != CMPI_RC_OK) goto out; @@ -80,6 +83,9 @@ static CMPIStatus cap_to_sys(const CMPIO CMPIInstance *inst; CMPIStatus s = {CMPI_RC_OK, NULL}; + if (!match_hypervisor_prefix(ref, info)) + return s; + s = get_host_cs(_BROKER, ref, &inst); if (s.rc != CMPI_RC_OK) goto out; @@ -98,6 +104,9 @@ static CMPIStatus cs_to_cap(const CMPIOb CMPIStatus s = {CMPI_RC_OK, NULL}; const char *sys_name = NULL; + if (!match_hypervisor_prefix(ref, info)) + return s; + if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -121,6 +130,9 @@ static CMPIStatus cap_to_cs(const CMPIOb CMPIInstance *inst; virConnectPtr conn; CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -160,6 +172,9 @@ static CMPIStatus pool_to_alloc(const CM uint16_t type; CMPIInstance *inst = NULL; CMPIStatus s = {CMPI_RC_OK}; + + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -359,8 +374,7 @@ struct std_assoc *assoc_handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); -STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); +STDA_AssocMIStub(, Virt_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: * mode: C

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196844141 -3600 # Node ID bce59cb2dd5054ba4f01bc20d805ed99bd767119 # Parent b07a0b1db5d9bb50e80d08a06d8138de3a132c69 ESD: 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 b07a0b1db5d9 -r bce59cb2dd50 schema/ElementSettingData.registration --- a/schema/ElementSettingData.registration Wed Dec 05 09:42:20 2007 +0100 +++ b/schema/ElementSettingData.registration Wed Dec 05 09:42:21 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_ElementSettingData root/virt Xen_ElementSettingDataProvider Virt_ElementSettingData association -KVM_ElementSettingData root/virt KVM_ElementSettingDataProvider Virt_ElementSettingData association +# Classname Namespace ProviderName ProviderModule ProviderTypes +Xen_ElementSettingData root/virt Virt_ElementSettingDataProvider Virt_ElementSettingData association +KVM_ElementSettingData root/virt Virt_ElementSettingDataProvider Virt_ElementSettingData association diff -r b07a0b1db5d9 -r bce59cb2dd50 src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Wed Dec 05 09:42:20 2007 +0100 +++ b/src/Virt_ElementSettingData.c Wed Dec 05 09:42:21 2007 +0100 @@ -39,13 +39,14 @@ static CMPIStatus vssd_to_vssd(const CMP struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; virConnectPtr conn = NULL; virDomainPtr dom = NULL; char *host = NULL; - ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + if (!match_hypervisor_prefix(ref, info)) + return s; if (!parse_instanceid(ref, NULL, &host)) { cu_statusf(_BROKER, &s, @@ -93,7 +94,8 @@ static CMPIStatus rasd_to_rasd(const CMP const char *id = NULL; uint16_t type; - ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -227,8 +229,7 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers); -STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, Virt_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables:

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196844142 -3600 # Node ID cf48a55a717b1aa79345e95aff6cfec96cbc2d65 # Parent bce59cb2dd5054ba4f01bc20d805ed99bd767119 HS: 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 bce59cb2dd50 -r cf48a55a717b schema/HostedService.registration --- a/schema/HostedService.registration Wed Dec 05 09:42:21 2007 +0100 +++ b/schema/HostedService.registration Wed Dec 05 09:42:22 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_HostedService root/virt Xen_HostedServiceProvider Virt_HostedService association -KVM_HostedService root/virt KVM_HostedServiceProvider Virt_HostedService association +# Classname Namespace ProviderName ProviderModule ProviderTypes +Xen_HostedService root/virt Virt_HostedServiceProvider Virt_HostedService association +KVM_HostedService root/virt Virt_HostedServiceProvider Virt_HostedService association diff -r bce59cb2dd50 -r cf48a55a717b src/Virt_HostedService.c --- a/src/Virt_HostedService.c Wed Dec 05 09:42:21 2007 +0100 +++ b/src/Virt_HostedService.c Wed Dec 05 09:42:22 2007 +0100 @@ -40,10 +40,11 @@ static CMPIStatus service_to_host(const struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; - ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + if (!match_hypervisor_prefix(ref, info)) + return s; s = get_host_cs(_BROKER, ref, &instance); if (s.rc == CMPI_RC_OK) @@ -59,7 +60,8 @@ static CMPIStatus host_to_service(const CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; - ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + if (!match_hypervisor_prefix(ref, info)) + return s; s = rpcs_instance(ref, &inst, _BROKER); if (s.rc != CMPI_RC_OK) @@ -159,8 +161,7 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers); -STDA_AssocMIStub(, KVM_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, Virt_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables:

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196844142 -3600 # Node ID 9751a165ebca953b720faf81c4fdfd5d0748aa6a # Parent cf48a55a717b1aa79345e95aff6cfec96cbc2d65 RAFP: 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 cf48a55a717b -r 9751a165ebca schema/ResourceAllocationFromPool.registration --- a/schema/ResourceAllocationFromPool.registration Wed Dec 05 09:42:22 2007 +0100 +++ b/schema/ResourceAllocationFromPool.registration Wed Dec 05 09:42:22 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes -Xen_ResourceAllocationFromPool root/virt Xen_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association -KVM_ResourceAllocationFromPool root/virt KVM_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association \ No newline at end of file +Xen_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association +KVM_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association \ No newline at end of file diff -r cf48a55a717b -r 9751a165ebca src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Wed Dec 05 09:42:22 2007 +0100 +++ b/src/Virt_ResourceAllocationFromPool.c Wed Dec 05 09:42:22 2007 +0100 @@ -41,13 +41,16 @@ static CMPIStatus rasd_to_pool(const CMP struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; uint16_t type; const char *id = NULL; char *poolid = NULL; virConnectPtr conn = NULL; struct inst_list _list; CMPIInstance *pool = NULL; + + if (!match_hypervisor_prefix(ref, info)) + return s; inst_list_init(&_list); @@ -177,8 +180,11 @@ static CMPIStatus pool_to_rasd(const CMP struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; const char *poolid; + + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "InstanceID", &poolid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -305,8 +311,7 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); -STDA_AssocMIStub(, KVM_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, Virt_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables:

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196844143 -3600 # Node ID f67ca8f5c7d74e5b288a7cbf6d9e8a9e3f27f05e # Parent 9751a165ebca953b720faf81c4fdfd5d0748aa6a SDC: 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 9751a165ebca -r f67ca8f5c7d7 schema/SettingsDefineCapabilities.registration --- a/schema/SettingsDefineCapabilities.registration Wed Dec 05 09:42:22 2007 +0100 +++ b/schema/SettingsDefineCapabilities.registration Wed Dec 05 09:42:23 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes -Xen_SettingsDefineCapabilities root/virt Xen_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association -KVM_SettingsDefineCapabilities root/virt KVM_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +Xen_SettingsDefineCapabilities root/virt Virt_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +KVM_SettingsDefineCapabilities root/virt Virt_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association diff -r 9751a165ebca -r f67ca8f5c7d7 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Dec 05 09:42:22 2007 +0100 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Dec 05 09:42:23 2007 +0100 @@ -781,6 +781,9 @@ static CMPIStatus alloc_cap_to_rasd(cons int ret; uint16_t type; + if (!match_hypervisor_prefix(ref, info)) + return s; + CU_DEBUG("Getting ResourceType"); ret = cu_get_u16_path(ref, "ResourceType", &type); @@ -900,8 +903,7 @@ struct std_assoc *assoc_handlers[] = { }; -STDA_AssocMIStub(, Xen_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); -STDA_AssocMIStub(, KVM_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); +STDA_AssocMIStub(, Virt_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables:

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196844144 -3600 # Node ID 904b939c9b2ae55caf2d7e713747fce00b7bcecc # Parent f67ca8f5c7d74e5b288a7cbf6d9e8a9e3f27f05e SDS: 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 f67ca8f5c7d7 -r 904b939c9b2a schema/SettingsDefineState.registration --- a/schema/SettingsDefineState.registration Wed Dec 05 09:42:23 2007 +0100 +++ b/schema/SettingsDefineState.registration Wed Dec 05 09:42:24 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes -Xen_SettingsDefineState root/virt Xen_SettingsDefineStateProvider Virt_SettingsDefineState association -KVM_SettingsDefineState root/virt KVM_SettingsDefineStateProvider Virt_SettingsDefineState association +Xen_SettingsDefineState root/virt Virt_SettingsDefineStateProvider Virt_SettingsDefineState association +KVM_SettingsDefineState root/virt Virt_SettingsDefineStateProvider Virt_SettingsDefineState association diff -r f67ca8f5c7d7 -r 904b939c9b2a src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Wed Dec 05 09:42:23 2007 +0100 +++ b/src/Virt_SettingsDefineState.c Wed Dec 05 09:42:24 2007 +0100 @@ -66,13 +66,16 @@ static CMPIStatus dev_to_rasd(const CMPI struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *rasd; struct inst_list rasds; const char *id = NULL; char *name = NULL; char *devid = NULL; int ret; + + if (!match_hypervisor_prefix(ref, info)) + return s; inst_list_init(&rasds); @@ -153,12 +156,13 @@ static CMPIStatus rasd_to_dev(const CMPI struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *dev = NULL; const char *id = NULL; uint16_t type; - ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -194,7 +198,10 @@ static CMPIStatus vs_to_vssd(const CMPIO virDomainPtr dom = NULL; const char *name; CMPIInstance *vssd; - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (!match_hypervisor_prefix(ref, info)) + return s; conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) @@ -238,8 +245,11 @@ static CMPIStatus vssd_to_vs(const CMPIO char *name = NULL; int ret; virConnectPtr conn = NULL; - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *cs; + + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -399,8 +409,7 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers); -STDA_AssocMIStub(, KVM_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, Virt_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables:

# 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:

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196844146 -3600 # Node ID b21fd24be46e086824d309f652b68ebe17eea34b # Parent 5b933cf3854176ae75fd07fe0c518a0aedb19a2b VSSDC: 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 5b933cf38541 -r b21fd24be46e schema/VSSDComponent.registration --- a/schema/VSSDComponent.registration Wed Dec 05 09:42:25 2007 +0100 +++ b/schema/VSSDComponent.registration Wed Dec 05 09:42:26 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes -Xen_VirtualSystemSettingDataComponent root/virt Xen_VSSDComponentProvider Virt_VSSDComponent association -KVM_VirtualSystemSettingDataComponent root/virt KVM_VSSDComponentProvider Virt_VSSDComponent association +Xen_VirtualSystemSettingDataComponent root/virt Virt_VSSDComponentProvider Virt_VSSDComponent association +KVM_VirtualSystemSettingDataComponent root/virt Virt_VSSDComponentProvider Virt_VSSDComponent association diff -r 5b933cf38541 -r b21fd24be46e src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Wed Dec 05 09:42:25 2007 +0100 +++ b/src/Virt_VSSDComponent.c Wed Dec 05 09:42:26 2007 +0100 @@ -40,7 +40,7 @@ static CMPIStatus vssd_to_rasd(const CMP struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; char *name = NULL; int i = 0; int types[] = { @@ -51,7 +51,8 @@ static CMPIStatus vssd_to_rasd(const CMP -1 }; - ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + if (!match_hypervisor_prefix(ref, info)) + return s; if (!parse_instanceid(ref, NULL, &name)) { cu_statusf(_BROKER, &s, @@ -115,14 +116,15 @@ static CMPIStatus rasd_to_vssd(const CMP struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *vssd = NULL; const char *id = NULL; char *host = NULL; char *devid = NULL; int ret; - ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + if (!match_hypervisor_prefix(ref, info)) + return s; if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, @@ -230,8 +232,7 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers); -STDA_AssocMIStub(, KVM_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, Virt_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables:

HE> The provider registration approach - registering one provider per HE> subclass (Xen_<classname>Provider, KVM_<classname>Provider) caused HE> interoperability issues with Pegasus and sfcb. The same call HE> returned duplicates with sfcb and worked with Pegasus. I applied all of these and tested almost all of them. Thanks Heidi! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (2)
-
Dan Smith
-
Heidi Eckhart