Re: [PATCH v2 4/9] hostdev: Add virHostdevOnlyDetachPCIDevice()

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

 



On Tue, 2016-01-26 at 18:58 -0500, John Ferlan wrote:
> 
> > -    while (virPCIDeviceListCount(pcidevs) > 0)
> > -        virPCIDeviceListStealIndex(pcidevs, 0);
> > -
> 
> Hmmm.. interesting looks like this would have been a memory leak since
> the code ignoree the return....  Normal when *Steal is called from
> *ListDel, a *DeviceFree is called on the returned stolen device.

I don't think it was, because earlier on the devices in 'pcidevs' are
added, not copied, to the active list. So stealing all of them
from 'pcidevs' here is a way to prevent 'virObjectUnref(pcidevs)' in
the cleanup part to free the memory associated with them

Cheers.

-- 
Andrea Bolognani
Software Engineer - Virtualization Team

--
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]