[PATCH] Make RASD not dependent on ResourceType key

# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1193673965 25200 # Node ID 07b9be7502efdeead8b1ab83df2d13bcb5398548 # Parent 82ff2daf1ddb72c0bd8a83588a03bd7a37ea110b Make RASD not dependent on ResourceType key I have tested DefineSystem() and some of the ResourcePool associations. It would be good to get a quick smoke test of the AllocationCapabilities stuff as well, just to make sure I didn't break anything. Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r 82ff2daf1ddb -r 07b9be7502ef schema/KVM_ResourceAllocationSettingData.mof --- a/schema/KVM_ResourceAllocationSettingData.mof Mon Oct 29 12:20:44 2007 +0100 +++ b/schema/KVM_ResourceAllocationSettingData.mof Mon Oct 29 09:06:05 2007 -0700 @@ -1,9 +1,4 @@ // Copyright IBM Corp. 2007 class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { - [Key, - Description ("The type of allocated resource"), - Override ("ResourceType")] - uint16 ResourceType; - }; diff -r 82ff2daf1ddb -r 07b9be7502ef schema/Xen_ResourceAllocationSettingData.mof --- a/schema/Xen_ResourceAllocationSettingData.mof Mon Oct 29 12:20:44 2007 +0100 +++ b/schema/Xen_ResourceAllocationSettingData.mof Mon Oct 29 09:06:05 2007 -0700 @@ -1,9 +1,4 @@ // Copyright IBM Corp. 2007 class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { - [Key, - Description ("The type of allocated resource"), - Override ("ResourceType")] - uint16 ResourceType; - }; diff -r 82ff2daf1ddb -r 07b9be7502ef src/Makefile.am --- a/src/Makefile.am Mon Oct 29 12:20:44 2007 +0100 +++ b/src/Makefile.am Mon Oct 29 09:06:05 2007 -0700 @@ -83,8 +83,10 @@ libVirt_ElementCapabilities_la_LIBADD = -lVirt_HostSystem libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c +libVirt_AllocationCapabilities_la_SOURCES = -lVirt_RASD libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c +libVirt_SettingsDefineCapabilities_la_SOURCES = -lVirt_RASD libVirt_RegisteredProfile_la_SOURCES = Virt_RegisteredProfile.c diff -r 82ff2daf1ddb -r 07b9be7502ef src/Virt_AllocationCapabilities.c --- a/src/Virt_AllocationCapabilities.c Mon Oct 29 12:20:44 2007 +0100 +++ b/src/Virt_AllocationCapabilities.c Mon Oct 29 09:06:05 2007 -0700 @@ -29,6 +29,7 @@ #include "misc_util.h" #include "Virt_AllocationCapabilities.h" +#include "Virt_RASD.h" const static CMPIBroker *_BROKER; @@ -44,8 +45,7 @@ CMPIStatus get_alloc_cap(const CMPIBroke *inst = get_typed_instance(broker, "AllocationCapabilities", NAMESPACE(ref)); - ret = cu_get_u16_path(ref, "ResourceType", &type); - if (ret != 1) { + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, "Could not get ResourceType."); goto out; diff -r 82ff2daf1ddb -r 07b9be7502ef src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Oct 29 12:20:44 2007 +0100 +++ b/src/Virt_RASD.c Mon Oct 29 09:06:05 2007 -0700 @@ -205,10 +205,38 @@ static CMPIInstance *get_rasd_instance(c return inst; } +CMPIrc rasd_type_from_classname(const char *cn, uint16_t *type) +{ + char *base = NULL; + CMPIrc rc = CMPI_RC_ERR_FAILED; + + base = class_base_name(cn); + if (base == NULL) + goto out; + + if (STREQ(base, "DiskResourceAllocationSettingData")) + *type = CIM_RASD_TYPE_DISK; + else if (STREQ(base, "NetResourceAllocationSettingData")) + *type = CIM_RASD_TYPE_NET; + else if (STREQ(base, "ProcResourceAllocationSettingData")) + *type = CIM_RASD_TYPE_PROC; + else if (STREQ(base, "MemResourceAllocationSettingData")) + *type = CIM_RASD_TYPE_MEM; + else + goto out; + + rc = CMPI_RC_OK; + + out: + free(base); + + return rc; +} + static CMPIStatus GetInstance(CMPIInstanceMI *self, const CMPIContext *context, const CMPIResult *results, - const CMPIObjectPath *reference, + const CMPIObjectPath *ref, const char **properties) { CMPIStatus s = {CMPI_RC_OK, NULL}; @@ -216,7 +244,7 @@ static CMPIStatus GetInstance(CMPIInstan char *id = NULL; uint16_t type; - id = cu_get_str_path(reference, "InstanceID"); + id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -224,14 +252,14 @@ static CMPIStatus GetInstance(CMPIInstan goto out; } - if (!cu_get_u16_path(reference, "ResourceType", &type)) { + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Missing or invalid ResourceType"); - goto out; - } - - inst = get_rasd_instance(context, reference, id, type); + "Unable to determine RASD type"); + goto out; + } + + inst = get_rasd_instance(context, ref, id, type); if (inst != NULL) CMReturnInstance(results, inst); diff -r 82ff2daf1ddb -r 07b9be7502ef src/Virt_RASD.h --- a/src/Virt_RASD.h Mon Oct 29 12:20:44 2007 +0100 +++ b/src/Virt_RASD.h Mon Oct 29 09:06:05 2007 -0700 @@ -27,6 +27,7 @@ int rasds_for_domain(const CMPIBroker *b const uint16_t type, const char *ns, struct inst_list *_list); +CMPIrc rasd_type_from_classname(const char *cn, uint16_t *type); #endif diff -r 82ff2daf1ddb -r 07b9be7502ef src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Mon Oct 29 12:20:44 2007 +0100 +++ b/src/Virt_ResourceAllocationFromPool.c Mon Oct 29 09:06:05 2007 -0700 @@ -42,7 +42,6 @@ static CMPIStatus rasd_to_pool(const CMP struct inst_list *list) { CMPIStatus s; - int ret; uint16_t type; char *id = NULL; char *poolid = NULL; @@ -52,11 +51,10 @@ static CMPIStatus rasd_to_pool(const CMP inst_list_init(&_list); - ret = cu_get_u16_path(ref, "ResourceType", &type); - if (!ret) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Missing ResourceType"); + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to determine RASD type"); goto out; } @@ -113,8 +111,16 @@ static int filter_by_pool(struct inst_li for (i = 0; i < src->cur; i++) { CMPIInstance *inst = src->list[i]; - - cu_get_u16_prop(inst, "ResourceType", &type); + CMPIObjectPath *op; + + op = CMGetObjectPath(inst, NULL); + if (op == NULL) + continue; + + if (rasd_type_from_classname(CLASSNAME(op), &type) != + CMPI_RC_OK) + continue; + cu_get_str_prop(inst, "InstanceID", &rasd_id); poolid = pool_member_of(_BROKER, type, rasd_id); diff -r 82ff2daf1ddb -r 07b9be7502ef src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Oct 29 12:20:44 2007 +0100 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Oct 29 09:06:05 2007 -0700 @@ -37,6 +37,7 @@ #include "svpc_types.h" #include "Virt_SettingsDefineCapabilities.h" +#include "Virt_RASD.h" const static CMPIBroker *_BROKER; @@ -315,13 +316,11 @@ static CMPIStatus alloc_cap_to_rasd(cons struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK}; - int ret; uint16_t type; CU_DEBUG("Getting ResourceType.\n"); - ret = cu_get_u16_path(ref, "ResourceType", &type); - if (ret != 1) { + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get ResourceType."); goto out; diff -r 82ff2daf1ddb -r 07b9be7502ef src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Mon Oct 29 12:20:44 2007 +0100 +++ b/src/Virt_SettingsDefineState.c Mon Oct 29 09:06:05 2007 -0700 @@ -162,7 +162,6 @@ static CMPIStatus rasd_to_dev(const CMPI CMPIStatus s; CMPIInstance *dev = NULL; char *id = NULL; - int ret; uint16_t type; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); @@ -175,8 +174,7 @@ static CMPIStatus rasd_to_dev(const CMPI goto out; } - ret = cu_get_u16_path(ref, "ResourceType", &type); - if (!ret) { + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing ResourceType"); diff -r 82ff2daf1ddb -r 07b9be7502ef src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Oct 29 12:20:44 2007 +0100 +++ b/src/Virt_VirtualSystemManagementService.c Mon Oct 29 09:06:05 2007 -0700 @@ -157,9 +157,15 @@ static int rasd_to_vdev(CMPIInstance *in char *id = NULL; char *name = NULL; char *devid = NULL; - - if (cu_get_u16_prop(inst, "ResourceType", &type) != CMPI_RC_OK) + CMPIObjectPath *op; + + op = CMGetObjectPath(inst, NULL); + if (op == NULL) goto err; + + if (rasd_type_from_classname(CLASSNAME(op), &type) != CMPI_RC_OK) + goto err; + dev->type = (int)type; if (cu_get_str_prop(inst, "InstanceID", &id) != CMPI_RC_OK) @@ -206,7 +212,6 @@ static int classify_resources(struct ins static int classify_resources(struct inst_list *all, struct domain *domain) { - int ret; int i; uint16_t type; @@ -219,8 +224,14 @@ static int classify_resources(struct ins domain->dev_net = calloc(all->cur, sizeof(struct virt_device)); for (i = 0; i < all->cur; i++) { - ret = cu_get_u16_prop(all->list[i], "ResourceType", &type); - if (ret != CMPI_RC_OK) + CMPIObjectPath *op; + + op = CMGetObjectPath(all->list[i], NULL); + if (op == NULL) + return 0; + + if (rasd_type_from_classname(CLASSNAME(op), &type) != + CMPI_RC_OK) return 0; if (type == CIM_RASD_TYPE_PROC) @@ -681,6 +692,7 @@ static CMPIStatus _update_resources_for( struct domain *dominfo = NULL; uint16_t type; char *xml = NULL; + CMPIObjectPath *op; if (!get_dominfo(dom, &dominfo)) { cu_statusf(_BROKER, &s, @@ -689,10 +701,18 @@ static CMPIStatus _update_resources_for( goto out; } - if (cu_get_u16_prop(rasd, "ResourceType", &type) != CMPI_RC_OK) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Missing ResourceType"); + op = CMGetObjectPath(rasd, NULL); + if (op == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get RASD path"); + goto out; + } + + if (rasd_type_from_classname(CLASSNAME(op), &type) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to determine RASD type"); goto out; }

DS> diff -r 82ff2daf1ddb -r 07b9be7502ef src/Makefile.am DS> --- a/src/Makefile.am Mon Oct 29 12:20:44 2007 +0100 DS> +++ b/src/Makefile.am Mon Oct 29 09:06:05 2007 -0700 DS> @@ -83,8 +83,10 @@ libVirt_ElementCapabilities_la_LIBADD = DS> -lVirt_HostSystem DS> libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c DS> +libVirt_AllocationCapabilities_la_SOURCES = -lVirt_RASD DS> libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c DS> +libVirt_SettingsDefineCapabilities_la_SOURCES = -lVirt_RASD Oops, just noticed that I added a second _SOURCES for each modified target instead of _LIBADD. I've fixed my local version. This will still work for testing, but throws a couple warnings. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Dan Smith wrote:
diff -r 82ff2daf1ddb -r 07b9be7502ef schema/KVM_ResourceAllocationSettingData.mof --- a/schema/KVM_ResourceAllocationSettingData.mof Mon Oct 29 12:20:44 2007 +0100 +++ b/schema/KVM_ResourceAllocationSettingData.mof Mon Oct 29 09:06:05 2007 -0700 @@ -1,9 +1,4 @@ // Copyright IBM Corp. 2007 class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData {
- [Key, - Description ("The type of allocated resource"), - Override ("ResourceType")] - uint16 ResourceType; - }; diff -r 82ff2daf1ddb -r 07b9be7502ef schema/Xen_ResourceAllocationSettingData.mof --- a/schema/Xen_ResourceAllocationSettingData.mof Mon Oct 29 12:20:44 2007 +0100 +++ b/schema/Xen_ResourceAllocationSettingData.mof Mon Oct 29 09:06:05 2007 -0700 @@ -1,9 +1,4 @@ // Copyright IBM Corp. 2007 class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData {
- [Key, - Description ("The type of allocated resource"), - Override ("ResourceType")] - uint16 ResourceType; - };
What is your intention behind defining Xen/KVM_ResourceAllocationSettingData in separate mof files and adding the additional registration script register_base.sh ? Especially the registration script introduces additional maintenance effort, while the registration process is already solved by provider_register.sh. -- 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> What is your intention behind defining HE> Xen/KVM_ResourceAllocationSettingData in separate mof files and HE> adding the additional registration script register_base.sh ? HE> Especially the registration script introduces additional HE> maintenance effort, while the registration process is already HE> solved by provider_register.sh. When I put the Xen_RASD.mof in the MOFS make target, sfcb worked fine, but the pegasus registration process failed. If you know of a better way to do this, I'm more than happy to revert what I've done so far. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Dan Smith wrote:
HE> What is your intention behind defining HE> Xen/KVM_ResourceAllocationSettingData in separate mof files and HE> adding the additional registration script register_base.sh ? HE> Especially the registration script introduces additional HE> maintenance effort, while the registration process is already HE> solved by provider_register.sh.
When I put the Xen_RASD.mof in the MOFS make target, sfcb worked fine, but the pegasus registration process failed. If you know of a better way to do this, I'm more than happy to revert what I've done so far.
I suggest the following patch: - removes schema/KVM_ResourceAllocationSettingData.mof, schema/Xen_ResourceAllocationSettingData.mof and register_base.sh - adds definition of KVM/Xen_ResourceAllocationSettingData to schema/ResourceAllocationSettingData.mof diff -r c94a9d6b36d9 Makefile.am --- a/Makefile.am Tue Oct 30 12:42:10 2007 +0100 +++ b/Makefile.am Tue Oct 30 12:48:24 2007 +0100 @@ -71,12 +71,8 @@ INTEROP_REGS = \ schema/RegisteredProfile.registration \ schema/ElementConformsToProfile.registration -EXTRA_BASE_MOFS = \ - schema/Xen_ResourceAllocationSettingData.mof \ - schema/KVM_ResourceAllocationSettingData.mof - pkgdata_DATA = $(MOFS) $(REGS) -pkgdata_SCRIPTS = provider-register.sh register_base.sh +pkgdata_SCRIPTS = provider-register.sh EXTRA_DIST = schema $(pkgdata_DATA) $(pkgdata_SCRIPTS) \ libvirt-cim.spec.in libvirt-cim.spec \ @@ -85,7 +81,6 @@ EXTRA_DIST = schema $(pkgdata_DATA) $(pk # Un/Register the providers and class definitions from/to the current CIMOM. # @CIMSERVER@ is set by the configure script postinstall: - sh register_base.sh @CIMSERVER@ $(EXTRA_BASE_MOFS) sh provider-register.sh -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) sh provider-register.sh -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) diff -r c94a9d6b36d9 register_base.sh --- a/register_base.sh Tue Oct 30 12:42:10 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -#!/bin/bash -# -# A script to register base classes with the CIMOM -# -# Copyright IBM Corp. 2007 -# Author: Dan Smith <danms@us.ibm.com> -# -# Usage: -# -# $ register_base.sh (sfcb|pegasus) [MOF...] -# -# FIXME: Need to make pegasus location and namespace variable - -CIMOM=$1 - -if [ -z "$CIMOM" ]; then - echo "Usage: $0 (pegasus|sfcb)" - exit 1 -fi - -shift - -if [ "$CIMOM" = "pegasus" ]; then - for i in $*; do - cimmofl -W -uc -aEV -R/var/lib/Pegasus -n /root/ibmsd $i - done -elif [ "$CIMOM" = "sfcb" ]; then - for i in $*; do - sfcbstage -n /root/ibmsd $i - done -else - echo "Unknown CIMOM type: $CIMOM" -fi diff -r c94a9d6b36d9 schema/KVM_ResourceAllocationSettingData.mof --- a/schema/KVM_ResourceAllocationSettingData.mof Tue Oct 30 12:42:10 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -// Copyright IBM Corp. 2007 -class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { - - [Key, - Description ("The type of allocated resource"), - Override ("ResourceType")] - uint16 ResourceType; - -}; diff -r c94a9d6b36d9 schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Tue Oct 30 12:42:10 2007 +0100 +++ b/schema/ResourceAllocationSettingData.mof Tue Oct 30 12:44:57 2007 +0100 @@ -1,4 +1,12 @@ // Copyright IBM Corp. 2007 +class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { + +}; + +class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { + +}; + [Description ("Xen virtual disk configuration")] class Xen_DiskResourceAllocationSettingData : Xen_ResourceAllocationSettingData{ diff -r c94a9d6b36d9 schema/Xen_ResourceAllocationSettingData.mof --- a/schema/Xen_ResourceAllocationSettingData.mof Tue Oct 30 12:42:10 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -// Copyright IBM Corp. 2007 -class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { - - [Key, - Description ("The type of allocated resource"), - Override ("ResourceType")] - uint16 ResourceType; - -}; -- 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> I suggest the following patch: HE> - removes schema/KVM_ResourceAllocationSettingData.mof, HE> schema/Xen_ResourceAllocationSettingData.mof and register_base.sh HE> - adds definition of KVM/Xen_ResourceAllocationSettingData to HE> schema/ResourceAllocationSettingData.mof That's what we originally had[1]! Does this work for you? It works fine for me with sfcb, but Pegasus refuses to install the RASD MOF because "One or more classes have children" (or some such similar error). [1] http://libvirt.org/hg/libvirt-cim/file/d41b62edd941/schema/ResourceAllocatio... -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Dan Smith wrote:
HE> I suggest the following patch: HE> - removes schema/KVM_ResourceAllocationSettingData.mof, HE> schema/Xen_ResourceAllocationSettingData.mof and register_base.sh HE> - adds definition of KVM/Xen_ResourceAllocationSettingData to HE> schema/ResourceAllocationSettingData.mof
That's what we originally had[1]! Does this work for you? It works fine for me with sfcb, but Pegasus refuses to install the RASD MOF because "One or more classes have children" (or some such similar error).
Thank you for this hint. I've encountered the same problem, which was caused by a bug in provider_register's uninstall process for Pegasus. The fix went out to the mailing list some minutes ago.
[1] http://libvirt.org/hg/libvirt-cim/file/d41b62edd941/schema/ResourceAllocatio...
-- 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> Thank you for this hint. I've encountered the same problem, which HE> was caused by a bug in provider_register's uninstall process for HE> Pegasus. The fix went out to the mailing list some minutes ago. Okay, I haven't tried it yet, but if it solves my pegasus problem, we can remove register_base.sh from the tree. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Dan Smith wrote:
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1193673965 25200 # Node ID 07b9be7502efdeead8b1ab83df2d13bcb5398548 # Parent 82ff2daf1ddb72c0bd8a83588a03bd7a37ea110b Make RASD not dependent on ResourceType key I have tested DefineSystem() and some of the ResourcePool associations. It would be good to get a quick smoke test of the AllocationCapabilities stuff as well, just to make sure I didn't break anything.
Signed-off-by: Dan Smith <danms@us.ibm.com>
@@ -315,13 +316,11 @@ static CMPIStatus alloc_cap_to_rasd(cons struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK}; - int ret; uint16_t type;
CU_DEBUG("Getting ResourceType.\n");
- ret = cu_get_u16_path(ref, "ResourceType", &type); - if (ret != 1) { + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get ResourceType."); goto out;
I think you got a little overzealous with this one. That ref it's getting ResourceType from is an AllocationCapabilites reference, not a RASD. If we need to make the same change for AllocationCapabilities, we can do that, but as is right now that's definitely going to cause some problems. -- -Jay

JG> I think you got a little overzealous with this one. That ref it's JG> getting ResourceType from is an AllocationCapabilites reference, JG> not a RASD. If we need to make the same change for JG> AllocationCapabilities, we can do that, but as is right now that's JG> definitely going to cause some problems. Heh, good catch, I'll revert that hunk. I *knew* I'd break something in there :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (3)
-
Dan Smith
-
Heidi Eckhart
-
Jay Gagnon