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