[Libvirt-cim] [PATCH 3 of 3] Make the EnumInstances and GetInstance logic in HostSystem SBLIM-aware

Dan Smith danms at us.ibm.com
Tue Aug 19 21:14:06 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1219180424 25200
# Node ID e216e19e47bcaf4dd299b10532808a8c7c994d73
# Parent  304d6c3d06697f93c35b64c0b059090648de8e5e
Make the EnumInstances and GetInstance logic in HostSystem SBLIM-aware

...so that we don't return Linux_ComputerSystem instances if we found
SBLIM ones

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r 304d6c3d0669 -r e216e19e47bc src/Virt_HostSystem.c
--- a/src/Virt_HostSystem.c	Tue Aug 19 14:13:44 2008 -0700
+++ b/src/Virt_HostSystem.c	Tue Aug 19 14:13:44 2008 -0700
@@ -163,9 +163,18 @@
 {
         CMPIStatus s = {CMPI_RC_OK, NULL};
         CMPIInstance *inst = NULL;
+        CMPIObjectPath *path = NULL;
 
         s = get_host(_BROKER, context, reference, &inst, is_get_inst);
         if (s.rc != CMPI_RC_OK || inst == NULL)
+                goto out;
+
+        path = CMGetObjectPath(inst, &s);
+        if ((path == NULL) || (s.rc != CMPI_RC_OK))
+                return s;
+
+        if (STARTS_WITH(CLASSNAME(path), "Linux_"))
+                /* Don't return SBLIM instances */
                 goto out;
 
         if (name_only)




More information about the Libvirt-cim mailing list