
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1196845867 -3600 # Node ID ce0b042ac7dea58ab7767e5bc74db81c37f99352 # Parent b21fd24be46e086824d309f652b68ebe17eea34b HD: Added match_hypervisor_prefix to avoid wrong results The request wbemain -ac Xen_HostedDependency 'http://localhost/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1"' returned localhost:5988/root/virt:KVM_HostSystem.CreationClassName="KVM_HostSystem",Name="localhost.localdomain" which is wrong, as KVM_ComputerSystem is referenced to KVM_HostSystem via KVM_HostedDependency instead of Xen_HostedDependency. Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r b21fd24be46e -r ce0b042ac7de src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Wed Dec 05 09:42:26 2007 +0100 +++ b/src/Virt_HostedDependency.c Wed Dec 05 10:11:07 2007 +0100 @@ -40,8 +40,11 @@ static CMPIStatus vs_to_host(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; + + if (!match_hypervisor_prefix(ref, info)) + return s; s = get_host_cs(_BROKER, ref, &instance); if (s.rc == CMPI_RC_OK) @@ -56,7 +59,10 @@ static CMPIStatus host_to_vs(const CMPIO { int ret; virConnectPtr conn; - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (!match_hypervisor_prefix(ref, info)) + return s; conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL)