[PATCH 0 of 3] #2 Fix VSMC enumeration failure.
by Kaitlin Rupert
wbemcli ein http://root:elm3b41@localhost/root/virt:Xen_VirtualSystemManagementCapabi...
This currently returns: "Missing key: Name". This is because get_vsm_cap() is expecting a Name attribute in the ref, which doesn't exist on an enumeration query.
This patch set fixes the enum issue in VSMC. Part of this fix is to add a new parameter to get_vsm_cap(). One of the handlers in ElementCapabilities calls get_vsm_cap(), so that function call has been updated as well.
Updates: Instead of using gethostname() call, get the instance of the host system and use it's value for the Name attribute.
16 years, 9 months
[PATCH 0 of 3] #3 - Enhance std association logic for reference lists and input parameter handling
by Heidi Eckhart
Please don't ask me what happened to the patch set before and why patch 3 was not submitted to the list. So resending the complete patch set once again ... and hope.
This patch set fixes:
- enhance the std_assoc struct to support lists for source, target and association classnames
- fixed a wrong error return for a NULL handler
- reworked check for input parameter: assocClass, resultClass, role, resultRole
16 years, 9 months
[PATCH 00 of 12] #2 - Adoption of changes to std_assoc struct in std_association for all associations
by Heidi Eckhart
This is the follow up patch to the API changes made in
std_association. The struct std_assoc does now take lists
for source, target and assoc classnames.
Diff tp patch set #1:
- fixed SD: former patch specified HostSystem as group_component instead of ComputerSystem
- fixed HS: class ResourcePoolConfigurationService was missing for dependent
- fixed SDC: fixed check against CMPIRc in alloc_cap_to_rasd; this still needs to be fixed in another patch, as ResourceType is no key property but is handled as one
16 years, 9 months
[PATCH 0 of 3] #4 - Enhance std association logic for reference lists and input parameter handling
by Heidi Eckhart
This patch set fixes:
- enhance the std_assoc struct to support lists for source, target and association classnames
- fixed a wrong error return for a NULL handler
- reworked check for input parameter: assocClass, resultClass, role, resultRole
Diff to patch set #3:
- fixed patch 3 of 3: std_assoc_get_handler did not set handler to NULL in case of "no valid handler found" and so returned wrong handler
16 years, 9 months
[PATCH] ECTP: Adoption of changes to std_assoc struct in std_association
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1196287282 -3600
# Node ID 786976aa40c60088afe17571372b4a5d82a0d29e
# Parent 535f219fe23fec8a5de725e0875e4fcdadbd584c
ECTP: Adoption of changes to std_assoc struct in std_association
This is the follow up patch to the API changes made in
std_association. The struct std_assoc does now take lists
for source, target and assoc classnames.
It also adds the registration of ComputerSystem and
HostSystem to the interop namespace. This is necessary to
check the client's resultClass value.
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 535f219fe23f -r 786976aa40c6 Makefile.am
--- a/Makefile.am Wed Nov 28 11:39:55 2007 +0100
+++ b/Makefile.am Wed Nov 28 23:01:22 2007 +0100
@@ -36,6 +36,8 @@ MOFS = \
schema/ElementSettingData.mof
INTEROP_MOFS = \
+ schema/ComputerSystem.mof \
+ schema/HostSystem.mof \
schema/RegisteredProfile.mof \
schema/ElementConformsToProfile.mof
diff -r 535f219fe23f -r 786976aa40c6 src/Virt_ElementConformsToProfile.c
--- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 11:39:55 2007 +0100
+++ b/src/Virt_ElementConformsToProfile.c Wed Nov 28 23:01:22 2007 +0100
@@ -224,27 +224,47 @@ static CMPIInstance *make_ref(const CMPI
return assoc_inst;
}
+char* conformant_standard[] = {
+ "Xen_RegisteredProfile",
+ "KVM_RegisteredProfile",
+ NULL
+};
+
+char* managed_element[] = {
+ "Xen_HostSystem",
+ "Xen_ComputerSystem",
+ "KVM_HostSystem",
+ "KVM_ComputerSystem",
+ NULL
+};
+
+char* assoc_classname[] = {
+ "Xen_ElementConformsToProfile",
+ "KVM_ElementConformsToProfile",
+ NULL
+};
+
struct std_assoc forward = {
- .source_class = "CIM_RegisteredProfile",
+ .source_class = (char**)&conformant_standard,
.source_prop = "ConformantStandard",
- .target_class = "CIM_ManagedElement",
+ .target_class = (char**)&managed_element,
.target_prop = "ManagedElement",
- .assoc_class = NULL,
+ .assoc_class = (char**)&assoc_classname,
.handler = prof_to_elem,
.make_ref = make_ref
};
struct std_assoc backward = {
- .source_class = "CIM_ManagedElement",
+ .source_class = (char**)&managed_element,
.source_prop = "ManagedElement",
- .target_class = "CIM_RegisteredProfile",
+ .target_class = (char**)&conformant_standard,
.target_prop = "ConformantStandard",
- .assoc_class = NULL,
+ .assoc_class = (char**)&assoc_classname,
.handler = elem_to_prof,
.make_ref = make_ref
@@ -255,7 +275,6 @@ struct std_assoc *assoc_handlers[] = {
&backward,
NULL
};
-
STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
/*
16 years, 9 months
[PATCH] Enhance handling of input parameter of std_association logic
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1196161060 -3600
# Node ID a9d4ef4c783c788db2b8ebd9da71255e492a0950
# Parent 16ac621eb3b34d11caca00100901d27bede7a7c7
Enhance handling of input parameter of std_association logic
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 16ac621eb3b3 -r a9d4ef4c783c std_association.c
--- a/std_association.c Tue Nov 27 11:45:33 2007 +0100
+++ b/std_association.c Tue Nov 27 11:57:40 2007 +0100
@@ -67,14 +67,20 @@ static bool match_class(const CMPIBroker
char *comp_class;
int i;
+ if (test_class == NULL)
+ return true;
+
+ if (comp_class_list == NULL)
+ return true;
+
rop = CMNewObjectPath(broker, ns, test_class, NULL);
+ if (CMIsNullObject(rop))
+ return false;
for (i = 0; comp_class_list[i]; i++) {
comp_class = comp_class_list[i];
- if ((test_class == NULL) ||
- (comp_class == NULL) ||
- match_op(broker, rop, comp_class))
+ if (!CMClassPathIsA(broker, rop, comp_class, NULL))
return true;
}
@@ -137,18 +143,82 @@ out:
static struct std_assoc *
std_assoc_get_handler(const struct std_assoc_ctx *ctx,
+ struct std_assoc_info *info,
const CMPIObjectPath *ref)
{
struct std_assoc *ptr = NULL;
int i;
+ bool rc;
+
+ CU_DEBUG("Calling Provider: '%s'",
+ info->provider_name);
for (i = 0; ctx->handlers[i]; i++) {
ptr = ctx->handlers[i];
if (match_source_class(ctx->brkr, ref, ptr))
- return ptr;
- }
-
+ break;
+ }
+
+ if (ptr) {
+ if (info->assoc_class) {
+ CU_DEBUG("Check client's assocClass: '%s'",
+ info->assoc_class);
+
+ rc = match_class(ctx->brkr,
+ NAMESPACE(ref),
+ info->assoc_class,
+ ptr->assoc_class);
+
+ if (!rc) {
+ CU_DEBUG("AssocClass not valid.");
+ goto out;
+ }
+ CU_DEBUG("AssocClass valid.");
+ }
+
+ if (info->result_class) {
+ CU_DEBUG("Check client's resultClass: '%s'",
+ info->result_class);
+
+ rc = match_class(ctx->brkr,
+ NAMESPACE(ref),
+ info->result_class,
+ ptr->target_class);
+
+ if (!rc) {
+ CU_DEBUG("ResultClass not valid.");
+ goto out;
+ }
+ CU_DEBUG("ResultClass valid.");
+ }
+
+ if (info->role) {
+ CU_DEBUG("Check client's role: '%s'",
+ info->role);
+
+ if (!STREQC(info->role, ptr->source_prop)) {
+ CU_DEBUG("Role not valid.");
+ goto out;
+ }
+ CU_DEBUG("Role valid.");
+ }
+
+ if (info->result_role) {
+ CU_DEBUG("Check client's resultRole: '%s'",
+ info->result_role);
+
+ if (!STREQC(info->result_role, ptr->target_prop)) {
+ CU_DEBUG("ResultRole not valid.");
+ goto out;
+ }
+ CU_DEBUG("ResultRole valid.");
+ }
+
+ return ptr;
+ }
+
+ out:
return NULL;
}
@@ -158,57 +228,21 @@ static CMPIStatus do_assoc(struct std_as
const CMPIObjectPath *ref,
bool names_only)
{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
struct inst_list list;
- CMPIStatus s;
struct std_assoc *handler;
- bool rc;
inst_list_init(&list);
CU_DEBUG("Getting handler...");
-
- handler = std_assoc_get_handler(ctx, ref);
+ handler = std_assoc_get_handler(ctx, info, ref);
if (handler == NULL) {
CU_DEBUG("No handler found.");
goto out;
}
-
- CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'",
- handler->source_class,
- handler->target_class,
- handler->assoc_class);
- CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'",
- info->result_class);
-
- rc = match_class(ctx->brkr,
- NAMESPACE(ref),
- info->result_class,
- handler->target_class);
- if (!rc) {
- CU_DEBUG("Match_class failed.");
- cu_statusf(ctx->brkr, &s,
- CMPI_RC_ERR_FAILED,
- "Result class is not valid for this association");
- goto out;
- }
- CU_DEBUG("Match_class succeeded.");
-
- CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'",
- info->assoc_class);
- rc = match_class(ctx->brkr,
- NAMESPACE(ref),
- info->assoc_class,
- handler->assoc_class);
- if (!rc) {
- CU_DEBUG("Match_class failed.");
- cu_statusf(ctx->brkr, &s,
- CMPI_RC_ERR_FAILED,
- "Association class given is not valid for"
- "this association");
- goto out;
- }
- CU_DEBUG("Match_class succeeded, calling handler->handler...");
-
+ CU_DEBUG("Getting handler succeeded.");
+
+ CU_DEBUG("Calling handler->handler...");
s = handler->handler(ref, info, &list);
if (s.rc != CMPI_RC_OK) {
@@ -256,32 +290,22 @@ static CMPIStatus do_ref(struct std_asso
const CMPIObjectPath *ref,
bool names_only)
{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
struct inst_list list;
- CMPIStatus s;
- int i;
struct std_assoc *handler;
- bool rc;
+ int i;
inst_list_init(&list);
- handler = std_assoc_get_handler(ctx, ref);
+ CU_DEBUG("Getting handler...");
+ handler = std_assoc_get_handler(ctx, info, ref);
if (handler == NULL) {
CU_DEBUG("No handler found.");
goto out;
}
-
- rc = match_class(ctx->brkr,
- NAMESPACE(ref),
- info->result_class,
- handler->assoc_class);
- if (!rc) {
- cu_statusf(ctx->brkr, &s,
- CMPI_RC_ERR_FAILED,
- "Result class is not valid for this association");
- goto out;
- }
-
-
+ CU_DEBUG("Getting handler succeeded.");
+
+ CU_DEBUG("Calling handler->handler...");
s = handler->handler(ref, info, &list);
if ((s.rc != CMPI_RC_OK) || (list.list == NULL))
goto out;
16 years, 9 months
[PATCH] Fix AllocationCapabilities install issue
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1196276782 28800
# Node ID b6fdc32e25897a3cc0b38d31a738d4217c467328
# Parent f230e4d57a78a48efb5c32e70e048ce229c2cca4
Fix AllocationCapabilities install issue.
The Virt_AllocationCapabilities provider install fails because it links with Virt_DevicePool, which is installed after Virt_AllocationCapabilities.
When you run make install, you should see the following error:
/usr/bin/ld: cannot find -lVirt_DevicePool
collect2: ld returned 1 exit status
libtool: install: error: relink `libVirt_AllocationCapabilities.la' with the above command before installing it
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r f230e4d57a78 -r b6fdc32e2589 src/Makefile.am
--- a/src/Makefile.am Wed Nov 28 11:27:09 2007 +0100
+++ b/src/Makefile.am Wed Nov 28 11:06:22 2007 -0800
@@ -34,12 +34,12 @@ provider_LTLIBRARIES = libVirt_ComputerS
libVirt_VirtualSystemManagementService.la \
libVirt_VirtualSystemManagementCapabilities.la \
libVirt_EnabledLogicalElementCapabilities.la \
+ libVirt_DevicePool.la \
libVirt_AllocationCapabilities.la \
libVirt_VSSD.la \
libVirt_HostedDependency.la \
libVirt_RegisteredProfile.la \
libVirt_ElementConformsToProfile.la \
- libVirt_DevicePool.la \
libVirt_SettingsDefineCapabilities.la \
libVirt_HostedResourcePool.la \
libVirt_ElementCapabilities.la \
16 years, 9 months