# HG changeset patch
# User Heidi Eckhart <heidieck(a)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(a)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: