[Libvirt-cim] [PATCH] Removing the code to fetch sblim instance

Sharad Mishra snmishra at us.ibm.com
Thu Sep 30 00:21:43 UTC 2010


# HG changeset patch
# User Sharad Mishra <snmishra at us.ibm.com>
# Date 1285806092 25200
# Node ID 4d59bde40044795f53f0a1e53bbf500ceb2b56fa
# Parent  2b22040708e97d0634d64d2a7e24205e7d701de3
Removing the code to fetch sblim instance.
This instance creates problem while getting
that instance.
Just returning fake host.

Signed-off-by: Sharad Mishra <snmishra at us.ibm.com>

diff -r 2b22040708e9 -r 4d59bde40044 src/Virt_HostSystem.c
--- a/src/Virt_HostSystem.c	Wed Sep 29 15:34:12 2010 -0700
+++ b/src/Virt_HostSystem.c	Wed Sep 29 17:21:32 2010 -0700
@@ -151,66 +151,6 @@
         return s;
 }
 
-static CMPIStatus sblim_host(const CMPIBroker *broker,
-                             const CMPIContext *context,
-                             const CMPIObjectPath *ref,
-                             CMPIInstance **inst)
-{
-        CMPIObjectPath *path;
-        CMPIEnumeration *en  = NULL;
-        CMPIData data;
-        CMPIStatus s;
-        const char *cn = "Linux_ComputerSystem";
-
-        path = CMNewObjectPath(broker, "root/cimv2", cn, &s);
-        if ((path == NULL) || (s.rc != CMPI_RC_OK)) {
-                cu_statusf(broker, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "Unable to create HostSystem path");
-                return s;
-        }
-
-        /* FIXME:  This approach may return the wrong instance if more than
-           one SBLIM Linux_ComputerSystem instance exists on the system.
-           This isn't likely to happen in most cases, but a better approach 
-           should be used here.
-         */
-        en = CBEnumInstances(broker, context, path, NULL, &s);
-        if (en == NULL) {
-                cu_statusf(broker, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "Upcall EnumInstances of %s class failed",
-                           cn);
-                goto out;
-        }
-
-        if (CMHasNext(en, &s)) {
-                data = CMGetNext(en, &s);
-                if (CMIsNullObject(data.value.inst)) {
-                        cu_statusf(broker, &s,
-                                   CMPI_RC_ERR_FAILED,
-                                   "Failed to retrieve enumeration entry");
-                        goto out;
-                }
-
-                *inst = data.value.inst;
-        } else {
-                cu_statusf(broker, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "No entry found");
-                goto out;
-        }
-
- out:
-        if (s.rc != CMPI_RC_OK) {
-                CU_DEBUG("SBLIM: %i %s", s.rc, CMGetCharPtr(s.msg));
-        } else {
-                CU_DEBUG("SBLIM: Returned instance");
-        }
-
-        return s;
-}
-
 CMPIStatus get_host(const CMPIBroker *broker,
                     const CMPIContext *context,
                     const CMPIObjectPath *reference,
@@ -219,10 +159,6 @@
 {
         CMPIStatus s;
 
-        s = sblim_host(broker, context, reference, _inst);
-        if (s.rc != CMPI_RC_OK)
-                s = fake_host(broker, reference, _inst);
-
         if (!is_get_inst && (s.rc == CMPI_RC_ERR_NOT_FOUND)) {
                 /* This is not an error */
                 return (CMPIStatus){CMPI_RC_OK, NULL};




More information about the Libvirt-cim mailing list