# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1196846065 -3600
# Node ID c3e4344951cef32a2c89e90f5345b20171c5e58d
# Parent ce0b042ac7dea58ab7767e5bc74db81c37f99352
HRP: Added match_hypervisor_prefix to avoid wrong results
The request
wbemain -ac Xen_HostedResourcePool
'http://localhost/root/virt:KVM_HostSystem.CreationClassName="KVM_HostSystem",Name="localhost.localdomain"'
returned
localhost:5988/root/virt:KVM_ProcessorPool.InstanceID="ProcessorPool/0"
localhost:5988/root/virt:KVM_MemoryPool.InstanceID="MemoryPool/0"
localhost:5988/root/virt:KVM_DiskPool.InstanceID="DiskPool/foo"
which is wrong, as KVM_HostSystem is referenced to
KVM_MemoryPool (...) via KVM_HostedResourcePool instead of
Xen_HostedResourcePool.
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r ce0b042ac7de -r c3e4344951ce src/Virt_HostedResourcePool.c
--- a/src/Virt_HostedResourcePool.c Wed Dec 05 10:11:07 2007 +0100
+++ b/src/Virt_HostedResourcePool.c Wed Dec 05 10:14:25 2007 +0100
@@ -42,7 +42,10 @@ static CMPIStatus pool_to_sys(const CMPI
struct inst_list *list)
{
CMPIInstance *host;
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
s = get_host_cs(_BROKER, ref, &host);
if (s.rc != CMPI_RC_OK)
@@ -57,11 +60,14 @@ static CMPIStatus sys_to_pool(const CMPI
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
int i;
virConnectPtr conn;
CMPIInstance *host;
const char *prop;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
s = get_host_cs(_BROKER, ref, &host);
if (s.rc != CMPI_RC_OK)