Kaitlin Rupert wrote:
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1202490035 28800
# Node ID 54ffc7df5a17a13811ad65f968b7d780330630f7
# Parent 59c1d98cf8989adff7530eac08abee7b79a6cc03
Update EC to add support for VSMS to VSMC association.
Removed the instance property validation. The get_vsms() (etc) calls will need to be
updated to handle the reference validation.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
+static CMPIStatus validate_caps_get_service(const CMPIObjectPath *ref,
+ CMPIInstance **inst)
+{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+ CMPIInstance *_inst;
+ char* classname;
+
classname = class_base_name(CLASSNAME(ref));
if (STREQC(classname, "VirtualSystemManagementCapabilities")) {
- s = get_vsm_cap(_BROKER, ref, &inst);
+ s = get_vsm_cap(_BROKER, ref, &_inst);
+ if ((s.rc != CMPI_RC_OK) || (_inst == NULL))
+ goto out;
+
+ s = get_vsms(ref, &_inst, _BROKER);
} else if (STREQC(classname, "VirtualSystemMigrationCapabilities")) {
- s = get_migration_caps(ref, &inst, _BROKER);
- }
-
- if (s.rc != CMPI_RC_OK)
- goto out;
-
- prop = cu_compare_ref(ref, inst);
- if (prop != NULL) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_NOT_FOUND,
- "No such instance (%s)", prop);
- }
-
I understand that this currently breaks the reference checking, but I
think it's a good idea to have the class get_<> functions do that
checking. Thoughts?
Also, I'm sure that this function, the validate_service_get_caps() and
validate_service_ref() can be consolidated somehow, but I haven't worked
up a clean solution yet,
So this patch is a first step in a set of related changes.
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com