Dan Smith wrote:
HE> # HG changeset patch
HE> # User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
HE> # Date 1195733309 -3600
HE> # Node ID 8c0410bfe3d3da3ef61aa40bfe75f1f23426b77d
HE> # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1
HE> Enumeration on HostSystem class is returning dups
I think most of the changes in this patch are good, but I'm not quite
sure why they prevent returning dups. Can you explain a little bit?
This was the result of an enumeration against CIM_ComputerSystem. The
HostSystem provider returned instances of Xen_HostSystem, while I have
no Xen installed on my system.
[heidineu@localhost ~]$ wbemein
http://localhost/root/virt:CIM_ComputerSystem
localhost:5988/root/virt:KVM_HostSystem.CreationClassName="KVM_HostSystem",Name="localhost.localdomain"
localhost:5988/root/virt:Xen_HostSystem.CreationClassName="Xen_HostSystem",Name="localhost.localdomain"
localhost:5988/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1"
The reason why this happened is, that the provider_is_responsible()
function checks only for "CIM" prefix now and no longer "compares" the
requested class prefix against the hypervisor type installed on the
machine. This is now done by connect_by_classname(). The result was,
that the provider returned instances independent of the installed
hypervisor.
HE> + err:
HE> + virConnectClose(conn);
HE> out:
virConnectClose(NULL) is a no-op (like free(NULL)). Everywhere else
in the code, we just have a single out label. I'd prefer that we
remain consistent with that, unless there is a good reason not to for
a particular instance.
fixed
--
Regards
Heidi Eckhart
Software Engineer
Linux Technology Center - Open Hypervisor
heidieck(a)linux.vnet.ibm.com
**************************************************
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294