Add check in EAFP to ensure ref passed is an actual instance.
Add check in EAFP to ensure ref passed is an actual instance.

EAFP currently returns instances for invalid refs where the InstanceID doesn't match the classname type (see failing query).

Get the ResourcePool instance that corresponds to the ref using get_pool_inst().  If this fails, the reference is not valid.

Failing query:
wbemcli ain -ac Xen_ElementAllocatedFromPool 'http://localhost:5988/root/virt:Xen_DiskPool.InstanceID="NetworkPool/virbr0"'

Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>

 Virt_ElementAllocatedFromPool.c |    4 ++++
 1 file changed, 4 insertions(+)

libvirt/libvirt-cim,libvirt/libvirt-cim,libvirt/libvirt-cim