I share your curiosity. I couldn't figure out the reasoning. Searched the
libvirt-cim archives to see if there was a note on why it filters out SBLIM
instance. I could not find any. I sent an email to the person who made the
change. He did not remember either and I don't blame him, since its more
than 2 years old code.
Regards,
Sharad Mishra
Open Virtualization
Linux Technology Center
IBM
Chip Vincent
<cvincent(a)linux.v
net.ibm.com> To
Sent by: List for discussion and development
libvirt-cim-bounc of libvirt CIM
es(a)redhat.com <libvirt-cim(a)redhat.com>
cc
09/23/2010 08:20 Subject
AM Re: [Libvirt-cim] [PATCH] (#2) Do
not filter out SBLIM host
Please respond to
List for
discussion and
development of
libvirt CIM
<libvirt-cim@redh
at.com>
Curious why there is code to both fetch and filter out the SBLIM
instance. Anyway, the code looks good and has been pushed upstream.
+1
Sharad Mishra wrote:
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1285004026 25200
# Node ID 9cdaa2ce4c1541235182bf5a8097caffcf0dbcfc
# Parent 5dcb6bc27cc6e7fdcb2e595358d523cf29023808
(#2) Do not filter out SBLIM host.
This patch removes the code that does not return SBLIM host system.
The original code did not have this filter and was added later.
I searched the archives and did not find any reason to add this code.
Update #2 - Added an else case where if enumeration of instances is null,
a fake host is returned.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 5dcb6bc27cc6 -r 9cdaa2ce4c15 src/Virt_HostSystem.c
--- a/src/Virt_HostSystem.c Wed Sep 08 16:36:08 2010 -0400
+++ b/src/Virt_HostSystem.c Mon Sep 20 10:33:46 2010 -0700
@@ -194,6 +194,11 @@
}
*inst = data.value.inst;
+ } else {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "No entry found");
+ goto out;
}
out:
@@ -237,20 +242,11 @@
{
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)
cu_return_instance_name(results, inst);
else
_______________________________________________
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
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim