[PATCH 0 of 2] Updates to RegisteredProfile and ElementConformsToProfile

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1193820858 -3600 # Node ID bd925f5f9fdacc3ed34b34eb17e348e8304ec382 # Parent 53903e7822dde586f073ffe469c544c1a37954a4 Enhance RegisteredProfile to support getInstance and gets static ID Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r 53903e7822dd -r bd925f5f9fda src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Tue Oct 30 12:48:28 2007 +0100 +++ b/src/Virt_RegisteredProfile.c Wed Oct 31 09:54:18 2007 +0100 @@ -38,27 +38,12 @@ const static CMPIBroker *_BROKER; -static bool reg_prof_set_id(CMPIInstance *instance, - struct reg_prof *profile) -{ - char *id; - - if (asprintf(&id, "%s_%s", profile->reg_name, - profile->reg_version) == -1) - id = NULL; - - if(id) - CMSetProperty(instance, "InstanceID", - (CMPIValue *)id, CMPI_chars); - - return id != NULL; -} - CMPIInstance *reg_prof_instance(const CMPIBroker *broker, - const CMPIObjectPath *ref, + const char *namespace, + const char **properties, struct reg_prof *profile) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; CMPIInstance *instance = NULL; char *classname; @@ -70,7 +55,7 @@ CMPIInstance *reg_prof_instance(const CM goto out; } - op = CMNewObjectPath(broker, NAMESPACE(ref), classname, &s); + op = CMNewObjectPath(broker, namespace, classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; @@ -78,10 +63,16 @@ CMPIInstance *reg_prof_instance(const CM if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; - reg_prof_set_id(instance, profile); - - CMSetProperty(instance, "CreationClassName", - (CMPIValue *)classname, CMPI_chars); + if (properties) { + s = CMSetPropertyFilter(instance, properties, NULL); + if (s.rc != CMPI_RC_OK) { + printf("Setting of property filter failed\n"); + goto out; + } + } + + CMSetProperty(instance, "InstanceID", + (CMPIValue *)profile->reg_id, CMPI_chars); CMSetProperty(instance, "RegisteredOrganization", (CMPIValue *)&profile->reg_org, CMPI_uint16); @@ -103,27 +94,17 @@ static CMPIStatus enum_profs(const CMPIO const char **properties, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *instance; int i; - CMPIStatus s = {CMPI_RC_OK, NULL}; - CMPIInstance *instance; for (i = 0; profiles[i] != NULL; i++) { - instance = reg_prof_instance(_BROKER, ref, profiles[i]); + instance = reg_prof_instance(_BROKER, NAMESPACE(ref), properties, profiles[i]); if (instance == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Can't create profile instance."); goto out; } - - if (properties) { - s = CMSetPropertyFilter(instance, properties, NULL); - if (s.rc != CMPI_RC_OK) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Property filter failed."); - goto out; - } - } if (names_only) cu_return_instance_name(results, instance); @@ -132,6 +113,41 @@ static CMPIStatus enum_profs(const CMPIO } out: + return s; +} + +static CMPIStatus get_prof(const CMPIObjectPath *ref, + const CMPIResult *results, + const char **properties) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *instance = NULL; + char* id; + int i; + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) { + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No InstanceID specified"); + return s; + } + + for (i = 0; profiles[i] != NULL; i++) { + if(STREQ(id, profiles[i]->reg_id)) { + instance = reg_prof_instance(_BROKER, NAMESPACE(ref), properties, profiles[i]); + break; + } + } + + if(instance) + CMReturnInstance(results, instance); + else + CMSetStatus(&s, CMPI_RC_ERR_NOT_FOUND); + + + free(id); + return s; } @@ -152,7 +168,15 @@ static CMPIStatus EnumInstances(CMPIInst return enum_profs(reference, results, properties, false); } -DEFAULT_GI(); +static CMPIStatus GetInstance(CMPIInstanceMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference, + const char **properties) +{ + return get_prof(reference, results, properties); +} + DEFAULT_CI(); DEFAULT_MI(); DEFAULT_DI(); diff -r 53903e7822dd -r bd925f5f9fda src/Virt_RegisteredProfile.h --- a/src/Virt_RegisteredProfile.h Tue Oct 30 12:48:28 2007 +0100 +++ b/src/Virt_RegisteredProfile.h Wed Oct 31 09:54:18 2007 +0100 @@ -22,7 +22,8 @@ #define __VIRT_REGISTERED_PROFILE_H CMPIInstance *reg_prof_instance(const CMPIBroker *broker, - const CMPIObjectPath *ref, + const char *namespace, + const char **properties, struct reg_prof *profile); #endif diff -r 53903e7822dd -r bd925f5f9fda src/profiles.h --- a/src/profiles.h Tue Oct 30 12:48:28 2007 +0100 +++ b/src/profiles.h Wed Oct 31 09:54:18 2007 +0100 @@ -20,6 +20,7 @@ */ struct reg_prof { uint16_t reg_org; // Valid: 1 = Other, 2 = DMTF + char *reg_id; char *reg_name; char *reg_version; int ad_types; @@ -28,49 +29,27 @@ struct reg_prof { char *provider_name; }; -struct reg_prof Processor = { +struct reg_prof SystemVirtualization = { .reg_org = 2, - .reg_name = "Processor Profile", - .reg_version = "2.15", - .provider_name = "Processor" + .reg_id = "DSP1042-1.0.0a", + .reg_name = "System Virtualization Profile", + .reg_version = "1.0.0a", + .provider_name = "HostSystem" }; -struct reg_prof LogicalDisk = { +struct reg_prof VirtualSystem = { .reg_org = 2, - .reg_name = "Logical Disk Profile", - .reg_version = "2.15", - .provider_name = "LogicalDisk" -}; - -struct reg_prof NetworkPort = { - .reg_org = 2, - .reg_name = "Network Port Profile", - .reg_version = "2.15", - .provider_name = "NetworkPort" -}; - -struct reg_prof ComputerSystem = { - .reg_org = 2, - .reg_name = "Computer System Profile", - .reg_version = "2.15", + .reg_id = "DSP1057-1.0.0a", + .reg_name = "Virtual System Profile", + .reg_version = "1.0.0a", .provider_name = "ComputerSystem" }; -struct reg_prof SVP = { - .reg_org = 2, - .reg_name = "System Virtualization Profile", - .reg_version = "2.15", - .provider_name = "VirtualSystemManagementService" -}; - // Make sure to add pointer to your reg_prof struct here. struct reg_prof *profiles[] = { - &Processor, - &LogicalDisk, - &NetworkPort, - &ComputerSystem, - &SVP, + &SystemVirtualization, + &VirtualSystem, NULL };

Heidi Eckhart wrote:
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1193820858 -3600 # Node ID bd925f5f9fdacc3ed34b34eb17e348e8304ec382 # Parent 53903e7822dde586f073ffe469c544c1a37954a4 Enhance RegisteredProfile to support getInstance and gets static ID Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com>
This one is fine now. My previous concerns (non-IBMers, this patch started on the internal list before we had this one) for this part have been addressed, and thanks for splitting it up. +1 -- -Jay

HE> + instance = reg_prof_instance(_BROKER, NAMESPACE(ref), properties, profiles[i]); Minor nit, but it would be appreciated if you could break this (and other long lines) into less-than-80-columns by putting each parameter on its own line. We're pretty consistent with that style everywhere else. HE> diff -r 53903e7822dd -r bd925f5f9fda src/Virt_RegisteredProfile.h HE> --- a/src/Virt_RegisteredProfile.h Tue Oct 30 12:48:28 2007 +0100 HE> +++ b/src/Virt_RegisteredProfile.h Wed Oct 31 09:54:18 2007 +0100 HE> @@ -22,7 +22,8 @@ HE> #define __VIRT_REGISTERED_PROFILE_H HE> CMPIInstance *reg_prof_instance(const CMPIBroker *broker, HE> - const CMPIObjectPath *ref, HE> + const char *namespace, HE> + const char **properties, HE> struct reg_prof *profile); It looks like the original version had some hard tabs in it. Your "properties" parameter is right, but your "namespace" one still has hard tabs. Other than that, I'll defer this ack to Jay, since he's more familiar with the profile stuff than I. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Heidi Eckhart wrote:
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1193820858 -3600 # Node ID bd925f5f9fdacc3ed34b34eb17e348e8304ec382 # Parent 53903e7822dde586f073ffe469c544c1a37954a4 Enhance RegisteredProfile to support getInstance and gets static ID Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com>
-struct reg_prof Processor = { +struct reg_prof SystemVirtualization = { .reg_org = 2, - .reg_name = "Processor Profile", - .reg_version = "2.15", - .provider_name = "Processor" + .reg_id = "DSP1042-1.0.0a", + .reg_name = "System Virtualization Profile", + .reg_version = "1.0.0a", + .provider_name = "HostSystem" };
-struct reg_prof LogicalDisk = { +struct reg_prof VirtualSystem = { .reg_org = 2, - .reg_name = "Logical Disk Profile", - .reg_version = "2.15", - .provider_name = "LogicalDisk" -}; - -struct reg_prof NetworkPort = { - .reg_org = 2, - .reg_name = "Network Port Profile", - .reg_version = "2.15", - .provider_name = "NetworkPort" -}; - -struct reg_prof ComputerSystem = { - .reg_org = 2, - .reg_name = "Computer System Profile", - .reg_version = "2.15", + .reg_id = "DSP1057-1.0.0a", + .reg_name = "Virtual System Profile", + .reg_version = "1.0.0a", .provider_name = "ComputerSystem" };
-struct reg_prof SVP = { - .reg_org = 2, - .reg_name = "System Virtualization Profile", - .reg_version = "2.15", - .provider_name = "VirtualSystemManagementService" -}; -
// Make sure to add pointer to your reg_prof struct here. struct reg_prof *profiles[] = { - &Processor, - &LogicalDisk, - &NetworkPort, - &ComputerSystem, - &SVP, + &SystemVirtualization, + &VirtualSystem, NULL };
One thing I forgot to ask about. Many of the profiles we were advertising have been removed. Is this temporary, or is there a reason to not advertise those? Also, I'm not so great at connecting the non-obvious profiles with their providers, could you explain why the System Virtualization Profile is now linked to HostSystem and not VirtualSystemManagementService? -- -Jay

One thing I forgot to ask about. Many of the profiles we were advertising have been removed. Is this temporary, or is there a reason to not advertise those? Its temporary, as at the moment most of the Resource Profiles that have been listed are not available or currently in the process of being defined by the DMTF. But as the Profiles become standard, we will update
Jay Gagnon wrote: the provider. As the approach is generic the effort will be only a new struct in profiles.h
Also, I'm not so great at connecting the non-obvious profiles with their providers, could you explain why the System Virtualization Profile is now linked to HostSystem and not VirtualSystemManagementService?
Instances of RegisteredProfile are connected via ECTP to the scoping class instance of the corresponding Profile. This means: the scoping class of the System Virtualization Profile is the CIM_System class, in our case the class KVM/Xen_HostSystem. The class VirtualSystemManagementService is part of the profile, but not the scoping class. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck@linux.vnet.ibm.com ************************************************** IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Herbert Kircher Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

HE> Instances of RegisteredProfile are connected via ECTP to the HE> scoping class instance of the corresponding Profile. This means: HE> the scoping class of the System Virtualization Profile is the HE> CIM_System class, in our case the class KVM/Xen_HostSystem. The HE> class VirtualSystemManagementService is part of the profile, but HE> not the scoping class. This means we need a HostedService class before the SVP profile will be useful, right? :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1193825279 -3600 # Node ID 0ce33a5e92a12929eb73497189f1ac574e689d39 # Parent bd925f5f9fdacc3ed34b34eb17e348e8304ec382 Adoption of changes in RegisteredProfile to association ElementConformsToProfile; ECTP uses upcalls to retrieve ManagedElements and minor bug fixes Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r bd925f5f9fda -r 0ce33a5e92a1 src/Makefile.am --- a/src/Makefile.am Wed Oct 31 09:54:18 2007 +0100 +++ b/src/Makefile.am Wed Oct 31 11:07:59 2007 +0100 @@ -7,7 +7,6 @@ noinst_HEADERS = profiles.h svpc_types.h Virt_ComputerSystemIndication.h \ Virt_Device.h \ Virt_DevicePool.h \ - Virt_ElementConformsToProfile.h \ Virt_EnabledLogicalElementCapabilities.h \ Virt_HostSystem.h \ Virt_RASD.h \ diff -r bd925f5f9fda -r 0ce33a5e92a1 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Oct 31 09:54:18 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Wed Oct 31 11:07:59 2007 +0100 @@ -35,7 +35,6 @@ #include "std_association.h" #include "Virt_RegisteredProfile.h" -#include "Virt_ElementConformsToProfile.h" /* Associate an XXX_RegisteredProfile to the proper XXX_ManagedElement. * @@ -46,75 +45,52 @@ const static CMPIBroker *_BROKER; -static CMPIStatus prof_from_ref(struct reg_prof *prof, - const CMPIObjectPath *ref) -{ - CMPIStatus s = {CMPI_RC_OK, NULL}; - char *tmp_str; - int tmp_int; - - memset(prof, 0, sizeof(*prof)); - - prof->reg_name = cu_get_str_path(ref, "RegisteredName"); - prof->reg_version = cu_get_str_path(ref, "RegisteredVersion"); - prof->other_reg_org = cu_get_str_path(ref, "OtherRegisteredOrganization"); - - tmp_str = cu_get_str_path(ref, "RegisteredOrganization"); - if (tmp_str) { - sscanf(tmp_str, "%d", &tmp_int); - prof->reg_org = (uint16_t)tmp_int; - } - - free(tmp_str); - return s; - -} - -static bool compare_profiles(struct reg_prof *target, - struct reg_prof *candidate) -{ - if (!STREQC(target->reg_name, candidate->reg_name)) - return false; - - COMPARE_OPT_STR(target, candidate, reg_version); - COMPARE_OPT_NUM(target, candidate, reg_org); - //COMPARE_OPT_NUM(target, candidate, ad_types); - COMPARE_OPT_STR(target, candidate, other_reg_org); - //COMPARE_OPT_STR(target, candidate, ad_type_descriptions); - - return true; -} - -static CMPIInstance *elem_instance(const CMPIObjectPath *ref, - char *provider_name) -{ - CMPIStatus s; +static CMPIStatus elem_instances(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list, + struct reg_prof *profile) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; - CMPIInstance *instance = NULL; char *classname; - - classname = get_typed_class(provider_name); + CMPIEnumeration *en = NULL; + CMPIData data ; + + classname = get_typed_class(profile->provider_name); if (classname == NULL) { //TRACE("Can't assemble classname."); printf("Can't assemble classname.\n"); goto out; } - op = CMNewObjectPath(_BROKER, NAMESPACE(ref), classname, &s); + op = CMNewObjectPath(_BROKER, "/root/ibmsd", classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) - goto out; - - instance = CMNewInstance(_BROKER, op, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(instance)) - goto out; - - CMSetProperty(instance, "CreationClassName", (CMPIValue *)classname, - CMPI_chars); - - out: + goto error; + + en = CBEnumInstances(_BROKER, info->context , op, NULL, &s); + if (en == NULL) { + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Upcall enumInstances to target class failed." ); + goto error; + } + + while (CMHasNext(en, &s)) { + data = CMGetNext(en, &s); + if (CMIsNullObject(data.value.inst)) { + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to retrieve enumeration entry." ); + goto error; + } + + inst_list_add(list, data.value.inst); + } + + error: free(classname); - - return instance; + out: + return s; } static CMPIStatus prof_to_elem(const CMPIObjectPath *ref, @@ -122,25 +98,28 @@ static CMPIStatus prof_to_elem(const CMP struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; - CMPIInstance *instance; - struct reg_prof target; - struct reg_prof *candidate; + char *id; int i; - - s = prof_from_ref(&target, ref); + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) { + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No InstanceID specified"); + goto out; + } for (i = 0; profiles[i] != NULL; i++) { - candidate = profiles[i]; - if (!compare_profiles(&target, candidate)) - continue; - - instance = elem_instance(ref, candidate->provider_name); - if (instance == NULL) - goto out; - - inst_list_add(list, instance); - } - + if (STREQ(id, profiles[i]->reg_id)) { + s = elem_instances(ref, info, list, profiles[i]); + if ((s.rc != CMPI_RC_OK)) + goto error; + break; + } + } + + error: + free(id); out: return s; } @@ -152,74 +131,64 @@ static CMPIStatus elem_to_prof(const CMP CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; char *classname; - char *provider_name; struct reg_prof *candidate; int i; - classname = cu_get_str_path(ref, "CreationClassName"); + classname = class_base_name(CLASSNAME(ref)); if (classname == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Can't get class name from element."); - goto error1; - } - - provider_name = class_base_name(classname); - if (provider_name == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Can't get provider name."); - goto error2; + "Can't get class name."); + goto out; } for (i = 0; profiles[i] != NULL; i++) { candidate = profiles[i]; - if (!STREQC(candidate->provider_name, provider_name)) + if (!STREQC(candidate->provider_name, classname)) continue; - instance = reg_prof_instance(_BROKER, ref, candidate); + instance = reg_prof_instance(_BROKER, "/root/interop", NULL, candidate); if (instance == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Can't create profile instance."); - goto error3; + goto error; } inst_list_add(list, instance); } - error3: - free(provider_name); - error2: + error: free(classname); - error1: - return s; -} - -static CMPIInstance *make_ref(const CMPIObjectPath *ref, - const CMPIInstance *inst, + out: + return s; +} + +static CMPIInstance *make_ref(const CMPIObjectPath *source_op, + const CMPIInstance *target_inst, struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *refinst; - char *base; - - base = class_base_name(assoc->target_class); - - refinst = get_typed_instance(_BROKER, - base, - NAMESPACE(ref)); - if (refinst != NULL) { - CMPIObjectPath *instop; - - instop = CMGetObjectPath(inst, NULL); - - CMSetProperty(refinst, assoc->source_prop, - (CMPIValue *)ref, CMPI_ref); - CMSetProperty(refinst, assoc->target_prop, - (CMPIValue *)instop, CMPI_ref); - } - - free(base); - - return refinst; + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *assoc_inst; + + assoc_inst = get_typed_instance(_BROKER, + "ElementConformsToProfile", + NAMESPACE(source_op)); + + if (!CMIsNullObject(assoc_inst)) { + CMPIObjectPath *target_op; + + target_op = CMGetObjectPath(target_inst, NULL); + + CMSetProperty(assoc_inst, assoc->source_prop, + (CMPIValue *)&(source_op), CMPI_ref); + CMSetProperty(assoc_inst, assoc->target_prop, + (CMPIValue *)&(target_op), CMPI_ref); + + fprintf(stderr,"Virt_ElementConformsToProfile: assoc_inst with data\n %s\n", + CMGetCharPtr(CDToString(_BROKER, assoc_inst, &s))); + } + + return assoc_inst; } struct std_assoc forward = { diff -r bd925f5f9fda -r 0ce33a5e92a1 src/Virt_ElementConformsToProfile.h --- a/src/Virt_ElementConformsToProfile.h Wed Oct 31 09:54:18 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright IBM Corp. 2007 - * - * Authors: - * Heidi Eckhart <heidieck@linux.vnet.ibm.com> - * Jay Gagnon <grendel@linux.vnet.ibm.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#define COMPARE_OPT_STR(t, c, field) \ - if (t->field && \ - !STREQC(t->field, c->field)) \ - return false; \ - -#define COMPARE_OPT_NUM(t, c, field) \ - if (t->field && \ - t->field != c->field) \ - return false; \ - -/* - * Local Variables: - * mode: C - * c-set-style: "K&R" - * tab-width: 8 - * c-basic-offset: 8 - * indent-tabs-mode: nil - * End: - */

Heidi Eckhart wrote:
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1193825279 -3600 # Node ID 0ce33a5e92a12929eb73497189f1ac574e689d39 # Parent bd925f5f9fdacc3ed34b34eb17e348e8304ec382 Adoption of changes in RegisteredProfile to association ElementConformsToProfile; ECTP uses upcalls to retrieve ManagedElements and minor bug fixes Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com>
I'm good with most of this, although a little confused about one thing. I've had the wrong idea about how ECTP was supposed to work in the past, so I wouldn't be surprised if I'm just confused again, but I'm afraid I don't understand why you changed the prof_to_elem behavior. I had it so that we would return an essentially empty instance of the provider that matched that profile, as I thought the idea was that the client would check the CreationClassName and know that this provider implements the profile they wanted. You appear to be finding the appropriate provider and invoking its EnumInstances method. I'm not sure why. Also, won't this present a problem for profiles that don't have EnumInstances? -- -Jay

Jay Gagnon wrote:
I'm good with most of this, although a little confused about one thing. I've had the wrong idea about how ECTP was supposed to work in the past, so I wouldn't be surprised if I'm just confused again, but I'm afraid I don't understand why you changed the prof_to_elem behavior. I had it so that we would return an essentially empty instance of the provider that matched that profile, as I thought the idea was that the client would check the CreationClassName and know that this provider implements the profile they wanted. You appear to be finding the appropriate provider and invoking its EnumInstances method. I'm not sure why. Also, won't this present a problem for profiles that don't have EnumInstances?
The DMTF specification defines the following behavior for ECTP, if traversed from an instance of RegisteredProfile to the instance(s) of the profile's scoping class. The result of this request is the list of all instances of the scoping class - which means an EnumInstances on the scoping class. So using an upcall to the EnumInstances function of the scoping class enables a generic implementation of the ECTP provider. What you have been talking about is client logic - but its definitely not the clients responsibility to select the appropriate instances of the profile's scoping class. This knowledge is anchored in the ECTP association. A scoping class always needs to implemented the EnumInstances function. And if there should once be the case that this did not happen then this is either a bug in the specification or in the code ;). -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck@linux.vnet.ibm.com ************************************************** IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Herbert Kircher Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Heidi Eckhart wrote:
Jay Gagnon wrote:
I'm good with most of this, although a little confused about one thing. I've had the wrong idea about how ECTP was supposed to work in the past, so I wouldn't be surprised if I'm just confused again, but I'm afraid I don't understand why you changed the prof_to_elem behavior. I had it so that we would return an essentially empty instance of the provider that matched that profile, as I thought the idea was that the client would check the CreationClassName and know that this provider implements the profile they wanted. You appear to be finding the appropriate provider and invoking its EnumInstances method. I'm not sure why. Also, won't this present a problem for profiles that don't have EnumInstances?
The DMTF specification defines the following behavior for ECTP, if traversed from an instance of RegisteredProfile to the instance(s) of the profile's scoping class. The result of this request is the list of all instances of the scoping class - which means an EnumInstances on the scoping class. So using an upcall to the EnumInstances function of the scoping class enables a generic implementation of the ECTP provider. What you have been talking about is client logic - but its definitely not the clients responsibility to select the appropriate instances of the profile's scoping class. This knowledge is anchored in the ECTP association. A scoping class always needs to implemented the EnumInstances function. And if there should once be the case that this did not happen then this is either a bug in the specification or in the code ;).
Understood. That's fine. My tendency to think like a client seems to have bitten me again. :) -- -Jay
participants (3)
-
Dan Smith
-
Heidi Eckhart
-
Jay Gagnon