+1.
NOTE: Since the fake_host function (and underlying functions) are not
currently used, they are generating warnings (which are treated as
errors with current compiler settings). As such, I'm going to comment
out those functions along with this patch.
Sharad Mishra wrote:
# HG changeset patch
# User Sharad Mishra <snmishra(a)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(a)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};
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Chip Vincent
Open Virtualization, Linux Technology Center
IBM Systems & Technology Group
phone: 919-254-4482, T/L 444-4482
email: cvincent(a)us.ibm.com