Re: [PATCH 4/6] conf: Refactor domain list collection critical section

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

 



On Mon, May 11, 2015 at 06:29:35 -0400, John Ferlan wrote:
> 
> 
> On 04/30/2015 08:44 AM, Peter Krempa wrote:
> 
> ...
> 
> > 
> > -    if (!(dom = virGetDomain(data->conn, vm->def->name, vm->def->uuid))) {
> > -        data->error = true;
> > -        goto cleanup;
> > +
> > +int
> > +virDomainObjListCollect(virDomainObjListPtr domlist,
> > +                        virConnectPtr conn,
> > +                        virDomainObjPtr **vms,
> > +                        size_t *nvms,
> > +                        virDomainObjListACLFilter filter,
> > +                        unsigned int flags)
> > +{
> > +    struct virDomainListData data = { NULL, 0 };
> > +
> > +    virObjectLock(domlist);
> > +    if (VIR_ALLOC_N(data.vms, virHashSize(domlist->objs)) < 0) {
> 
> Coverity checker wasn't very happy with this especially if virHashSize
> returns a negative number.

False positive. virHashSize returns null only if the hash is NULL which
never happens for domlist-objs.

Peter

Attachment: signature.asc
Description: 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]