# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1196460977 28800
# Node ID 1776beb36f5cffcfad4e581a8841f77f20bc3927
# Parent d5af3e219c22e8b32de64c69a29aea970ab6a9a4
SD doesn't return instances in all cases.
Virt_SystemDevice doesn't return instances when CIM_ManagedElement is passed as a
result class argument. This only applies to the VM to device case (see failint query
below).
The problem is that we use the result class to determine which device type to return. If
no result class is specified, we return all associated devices. However, if
CIM_ManagedElement is specified, we are unable to match the device type, and we return
nothing.
I think all of this can be removed because filter_results() in libcmpiutil should remove
the need for this kind of checking.
Failing query:
wbemcli ain -ac Xen_SystemDevice -arc CIM_ManagedElement
'http://root:elm3b41@localhost/root/virt:Xen_ComputerSystem.CreationClassName="Xen_ComputerSystem",Name="Domain-0"'
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r d5af3e219c22 -r 1776beb36f5c src/Virt_SystemDevice.c
--- a/src/Virt_SystemDevice.c Fri Nov 30 11:33:21 2007 -0800
+++ b/src/Virt_SystemDevice.c Fri Nov 30 14:16:17 2007 -0800
@@ -171,22 +171,10 @@ static CMPIStatus sys_to_dev(const CMPIO
goto out;
}
- if (info->result_class) {
- int type;
-
- type = device_type_from_classname(info->result_class);
-
- ret = get_dom_devices(host,
- list,
- type,
- CLASSNAME(ref),
- NAMESPACE(ref));
- } else {
- ret = get_all_devices(host,
- list,
- CLASSNAME(ref),
- NAMESPACE(ref));
- }
+ ret = get_all_devices(host,
+ list,
+ CLASSNAME(ref),
+ NAMESPACE(ref));
if (ret >= 0) {
CMSetStatus(&s, CMPI_RC_OK);