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