[Libvirt-cim] [PATCH 0 of 3] Fix AC GetInstance() error

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Dec 18 16:39:35 UTC 2007


Heidi Eckhart wrote:
> Heidi Eckhart wrote:
>> I will have a look into it and try to find out where it segfault.
>>
> After some testing and debugging, I figured out that sfcb seems to have 
> a problem with a return result "no instance and status OK" for 
> getInstance(). This should not cause a segfault in sfcb, but the 
> behavior in general is correct, as this result is not valid for 
> getInstance. If the requested instances was not found, then the status 
> has to be set to something else than OK. I will send this issue to the 
> sblim-devel mailing list.

Thanks for looking into this. =)  Sounds like an interesting bug - good 
catch!

> 
> This patch fixes the getInstance() segfault with sfcb.
> 
> diff -r 84b0269e9994 src/Virt_AllocationCapabilities.c
> --- a/src/Virt_AllocationCapabilities.c    Tue Dec 18 12:20:13 2007 +0100
> +++ b/src/Virt_AllocationCapabilities.c    Tue Dec 18 12:21:53 2007 +0100
> @@ -118,8 +118,10 @@ static CMPIStatus alloc_cap_instances(co
>                                    "Error fetching device pool 
> InstanceID");
>                         goto out;
>                 }
> -                if (id && (!STREQ(inst_id, id)))
> +                if (id && (!STREQ(inst_id, id))) {
> +                        inst_id = NULL;
>                         continue;
> +                }
>                        s = ac_from_pool(broker, ref,
>                                  device_pool_list.list[i],
> @@ -131,6 +133,13 @@ static CMPIStatus alloc_cap_instances(co
> 
>                 if (id && (STREQ(inst_id, id)))
>                         break;
> +        }
> +
> +        if (id && !inst_id) {
> +                cu_statusf(broker, &s,
> +                           CMPI_RC_ERR_NOT_FOUND,
> +                           "Requested Object could not be found.");
> +                goto out;
>         }
> 
>         if (names_only)
> 
> 

I can send out a re-worked patch.  Thanks for coding this up.  =)

-- 
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com




More information about the Libvirt-cim mailing list