[libvirt] [PATCH] libxl: fix leaking logfile fds

Ján Tomko jtomko at redhat.com
Fri Jun 1 21:09:33 UTC 2018


On Thu, May 31, 2018 at 03:57:20PM -0600, Jim Fehlig wrote:
>Per-domain log files were introduced in commit a30b08b7179. The FILE
>objects associated with these log files are stored in a hash table
>using domid as a key. When a domain is shutdown, destroyed, or
>otherwise powered-off, the FILE object is removed from the hash table,
>where the free function will close the FILE.
>
>Unfortunately the call to remove the FILE from the hash table occurs
>after setting domid=-1 in the libxlDomainCleanup() function. The
>object is never removed from the hash table, the free function is
>never called, and the underlying fd is leaked. Fix by removing the
>FILE object from the hash table before setting domid=-1.
>
>Signed-off-by: Jim Fehlig <jfehlig at suse.com>
>---
> src/libxl/libxl_domain.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180601/c8b44283/attachment-0001.sig>


More information about the libvir-list mailing list