Re: [libvirt] [PATCH] Strict check when listing domains

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/24/2010 11:19 AM, Eduardo Otubo wrote:

>      /* exit early if there are no domains */
> -    if (nids == 0)
> +    if (nids_numdomains == 0 || nids_listdomains == 0
> +        || nids_numdomains != nids_listdomains)
>          return 0;

Should we be reporting an error here...

>  
> -    if (VIR_ALLOC_N(ids, nids) < 0) {
> +    if (VIR_ALLOC_N(ids, nids_listdomains) < 0) {
>          virReportOOMError();
>          goto err;
>      }
>  
> -    if ((nids = phypListDomainsGeneric(conn, ids, nids, 1)) < 0)
> -        goto err;
> -
> -    /* exit early if there are no domains */
> -    /* FIXME: phypNumDomainsGeneric() returned > 0 but phypListDomainsGeneric()
> -     *        returned 0. indicates this an error condition?
> -     *        an even stricter check would be to treat
> -     *
> -     *          phypNumDomainsGeneric() != phypListDomainsGeneric()
> -     *
> -     *        as an error */

...given this comment?  You treated it as an early exit of 0, even if
both values were non-zero.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]