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

Heidi Eckhart heidieck at linux.vnet.ibm.com
Fri Nov 30 09:43:34 UTC 2007


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1196339320 -3600
# Node ID 69f4e34c1187ac9013cf779f78c2831544b4a5a4
# Parent  36e16117e8b18e85a4898879091b919074dc44dc
HD: 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.
Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>

diff -r 36e16117e8b1 -r 69f4e34c1187 src/Virt_HostedDependency.c
--- a/src/Virt_HostedDependency.c	Thu Nov 29 13:23:29 2007 +0100
+++ b/src/Virt_HostedDependency.c	Thu Nov 29 13:28:40 2007 +0100
@@ -99,55 +99,54 @@ static CMPIInstance *make_ref(const CMPI
         return refinst;
 }
 
-static struct std_assoc xen_vs_to_host = {
-        .source_class = "Xen_ComputerSystem",
+char* antecedent[] = {
+        "Xen_ComputerSystem",
+        "KVM_ComputerSystem",       
+        NULL
+};
+
+char* dependent[] = {
+        "Xen_HostSystem",
+        "KVM_HostSystem",
+        NULL
+};
+
+char* assoc_classname[] = {
+        "Xen_HostedDependency",
+        "KVM_HostedDependency",        
+        NULL
+};
+
+static struct std_assoc _vs_to_host = {
+        .source_class = (char**)&antecedent,
         .source_prop = "Antecedent",
 
-        .target_class = "Xen_HostSystem",
-        .source_prop = "Dependent",
+        .target_class = (char**)&dependent,
+        .target_prop = "Dependent",
+
+        .assoc_class = (char**)&assoc_classname,
 
         .handler = vs_to_host,
         .make_ref = make_ref
 };
 
-static struct std_assoc kvm_vs_to_host = {
-        .source_class = "KVM_ComputerSystem",
-        .source_prop = "Antecedent",
-
-        .target_class = "KVM_HostSystem",
+static struct std_assoc _host_to_vs = {
+        .source_class = (char**)&dependent,
         .source_prop = "Dependent",
 
-        .handler = vs_to_host,
-        .make_ref = make_ref
-};
+        .target_class = (char**)&antecedent,
+        .target_prop = "Antecedent",
 
-static struct std_assoc xen_host_to_vs = {
-        .source_class = "Xen_HostSystem",
-        .source_prop = "Dependent",
-
-        .target_class = "Xen_ComputerSystem",
-        .target_prop = "Antecedent",
+        .assoc_class = (char**)&assoc_classname,
 
         .handler = host_to_vs,
         .make_ref = make_ref
 };
 
-static struct std_assoc kvm_host_to_vs = {
-        .source_class = "KVM_HostSystem",
-        .source_prop = "Dependent",
-
-        .target_class = "KVM_ComputerSystem",
-        .target_prop = "Antecedent",
-
-        .handler = host_to_vs,
-        .make_ref = make_ref
-};
 
 static struct std_assoc *handlers[] = {
-        &xen_vs_to_host,
-        &xen_host_to_vs,
-        &kvm_vs_to_host,
-        &kvm_host_to_vs,
+        &_vs_to_host,
+        &_host_to_vs,
         NULL
 };
 




More information about the Libvirt-cim mailing list