[Libvirt-cim] [PATCH 1 of 9] EAFP: Provider registered per subclass

Heidi Eckhart heidieck at linux.vnet.ibm.com
Mon Dec 3 11:36:58 UTC 2007


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1196683313 -3600
# Node ID 6dbbe2c148a7cc2ba74ffc9e3ddcf7acdc30042c
# Parent  8140438a647cd53017d79b7036702fc053fe9e9c
EAFP: Provider registered per subclass

The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.

wbemain -ac CIM_ElementAllocatedFromPool 'http://localhost/root/virt:KVM_Memory.DeviceID="qemu1/mem",CreationClassName="KVM_Memory",SystemName="qemu1",SystemCreationClassName=""'
localhost:5988/root/virt:KVM_MemoryPool.InstanceID="MemoryPool/0"
localhost:5988/root/virt:KVM_MemoryPool.InstanceID="MemoryPool/0"
Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>

diff -r 8140438a647c -r 6dbbe2c148a7 schema/ElementAllocatedFromPool.registration
--- a/schema/ElementAllocatedFromPool.registration	Fri Nov 30 17:21:33 2007 -0800
+++ b/schema/ElementAllocatedFromPool.registration	Mon Dec 03 13:01:53 2007 +0100
@@ -1,4 +1,4 @@
 # Copyright IBM Corp. 2007
 # Classname Namespace ProviderName ProviderModule ProviderTypes
-Xen_ElementAllocatedFromPool root/virt Xen_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association
-KVM_ElementAllocatedFromPool root/virt KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association
+Xen_ElementAllocatedFromPool root/virt Virt_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association
+KVM_ElementAllocatedFromPool root/virt Virt_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association
diff -r 8140438a647c -r 6dbbe2c148a7 src/Virt_ElementAllocatedFromPool.c
--- a/src/Virt_ElementAllocatedFromPool.c	Fri Nov 30 17:21:33 2007 -0800
+++ b/src/Virt_ElementAllocatedFromPool.c	Mon Dec 03 13:01:53 2007 +0100
@@ -326,8 +326,7 @@ static struct std_assoc *handlers[] = {
         NULL
 };
 
-STDA_AssocMIStub(, Xen_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
 
 /*
  * Local Variables:




More information about the Libvirt-cim mailing list