[Libvirt-cim] [PATCH 2 of 2] Fix ECTP elem_to_prof() to work with central class

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Sep 10 20:29:34 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1221078423 25200
# Node ID 2a9fb589cd7ab6bd83ec132f8defb3e05af2d6c1
# Parent  bf0c9fa34906c28cfd049d4785ee5a54fcf7b30b
Fix ECTP elem_to_prof() to work with central class.

Also, add pools and VSMigrationService to the managed_element[] struct so that filtering by result class is possible.

Sample query:

wbemcli ain -arc KVM_NetworkPool 'http://localhost/root/interop:KVM_RegisteredProfile.InstanceID="CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0_n"'

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r bf0c9fa34906 -r 2a9fb589cd7a src/Virt_ElementConformsToProfile.c
--- a/src/Virt_ElementConformsToProfile.c	Wed Sep 10 13:26:40 2008 -0700
+++ b/src/Virt_ElementConformsToProfile.c	Wed Sep 10 13:27:03 2008 -0700
@@ -185,11 +185,14 @@
         }
 
         for (i = 0; profiles[i] != NULL; i++) {
-                if (profiles[i]->scoping_class == NULL)
+
+                if ((profiles[i]->scoping_class == NULL) || 
+                   (!STREQC(profiles[i]->scoping_class, classname))) {
+
+                   if ((profiles[i]->central_class == NULL) || 
+                      (!STREQC(profiles[i]->central_class, classname)))
                         continue;
-
-                if (!STREQC(profiles[i]->scoping_class, classname))
-                        continue;
+                }
 
                 s = get_profile(_BROKER,
                                 ref, 
@@ -222,10 +225,25 @@
 static char* managed_element[] = {
         "Xen_HostSystem",
         "Xen_ComputerSystem",
+        "Xen_DiskPool",
+        "Xen_MemoryPool",
+        "Xen_NetworkPool",
+        "Xen_ProcessorPool",
+        "Xen_VirtualSystemMigrationService",
         "KVM_HostSystem",
         "KVM_ComputerSystem",
+        "KVM_DiskPool",
+        "KVM_MemoryPool",
+        "KVM_NetworkPool",
+        "KVM_ProcessorPool",
+        "KVM_VirtualSystemMigrationService",
         "LXC_HostSystem",
         "LXC_ComputerSystem",
+        "LXC_DiskPool",
+        "LXC_MemoryPool",
+        "LXC_NetworkPool",
+        "LXC_ProcessorPool",
+        "LXC_VirtualSystemMigrationService",
         NULL
 };
 




More information about the Libvirt-cim mailing list