# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1199396274 28800
# Node ID 652cc30234dacb2bca5ca1b185dad32246aead48
# Parent 615554f6eca4cd21e5715a3af73a616637e54f96
VirtualSystemManagementCapabilities GetInstance() returns inst for invalid ref.
Instead of return_vsm_cap(), call get_vsm_cap() and the compare the properties of the ref
with the instance returned by get_vsm_cap().
Failing query:
wbemcli gi
'http://localhost/root/virt:Xen_VirtualSystemManagementCapabilities.InstanceID="wrong"'
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 615554f6eca4 -r 652cc30234da src/Virt_VirtualSystemManagementCapabilities.c
--- a/src/Virt_VirtualSystemManagementCapabilities.c Fri Dec 14 16:13:18 2007 -0800
+++ b/src/Virt_VirtualSystemManagementCapabilities.c Thu Jan 03 13:37:54 2008 -0800
@@ -172,7 +172,24 @@ static CMPIStatus GetInstance(CMPIInstan
const CMPIObjectPath *reference,
const char **properties)
{
- return return_vsm_cap(reference, results, 0);
+ CMPIInstance *inst;
+ CMPIStatus s;
+ const char *prop;
+
+ s = get_vsm_cap(_BROKER, reference, &inst);
+ if (s.rc != CMPI_RC_OK)
+ return s;
+
+ prop = cu_compare_ref(reference, inst);
+ if (prop != NULL) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_NOT_FOUND,
+ "No such instance (%s)", prop);
+ } else {
+ CMReturnInstance(results, inst);
+ }
+
+ return s;
}
DEFAULT_CI();