[Libvirt-cim] [PATCH] ECTP: Adoption of changes to std_assoc struct in std_association

Heidi Eckhart heidieck at linux.vnet.ibm.com
Wed Nov 28 21:01:39 UTC 2007


# HG changeset patch
# User Heidi Eckhart <heidieck at 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 at 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);
 /*




More information about the Libvirt-cim mailing list