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

Heidi Eckhart heidieck at linux.vnet.ibm.com
Thu Nov 29 12:14:54 UTC 2007


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1196333528 -3600
# Node ID af7ce48b18bed937d49df9d4073cac564c391971
# Parent  c478a5b30689a80159588c8f914ac97263694372
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 c478a5b30689 -r af7ce48b18be Makefile.am
--- a/Makefile.am	Wed Nov 28 11:06:22 2007 -0800
+++ b/Makefile.am	Thu Nov 29 11:52:08 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 c478a5b30689 -r af7ce48b18be src/Virt_ElementConformsToProfile.c
--- a/src/Virt_ElementConformsToProfile.c	Wed Nov 28 11:06:22 2007 -0800
+++ b/src/Virt_ElementConformsToProfile.c	Thu Nov 29 11:52:08 2007 +0100
@@ -222,27 +222,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
@@ -253,7 +273,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