RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 766308 - libvirtd does not close all fds opened by virt-install
Summary: libvirtd does not close all fds opened by virt-install
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-11 15:08 UTC by Sadique Puthen
Modified: 2018-11-27 21:25 UTC (History)
7 users (show)

Fixed In Version: libvirt-0.9.9-1.el6
Doc Type: Bug Fix
Doc Text:
No Documentation needed
Clone Of:
Environment:
Last Closed: 2012-06-20 06:38:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
before installation (9.15 KB, text/plain)
2011-12-14 06:33 UTC, zhpeng
no flags Details
installation (11.29 KB, text/plain)
2011-12-14 06:34 UTC, zhpeng
no flags Details
after installation (9.61 KB, text/plain)
2011-12-14 06:35 UTC, zhpeng
no flags Details
after restart libvirtd (9.26 KB, text/plain)
2011-12-14 06:36 UTC, zhpeng
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description Sadique Puthen 2011-12-11 15:08:16 UTC
Description of problem:

libvirtd does not close all fds opened to install guests by virt-install after virt-install finished installing the guest.
 
Version-Release number of selected component (if applicable):

libvirt-0.9.4-12.el6.x86_64

How reproducible:

Always.

Steps to Reproduce:

Fds opened by libvirted before starting installation:

# lsof | grep libvirt | wc
    102     922   10980

During installation.

# lsof | grep libvirt | wc 
    117    1067   12790

Installation is done using the below command.

# virt-install -r 1000 -n sadique-test5 --disk path=/home/images/sadique-test5.img,format=raw,bus=virtio,size=10 --network bridge=br1,model=virtio --os-type=linux --os-variant=rhel6 --vcpus=2,maxvcpus=4 --cdrom=/tmp/rhel-server-5.4-x86_64-dvd.iso

After the installation. (we can see that 1 fd is not closed)

# lsof | grep libvirt | wc 
    103     933   11086

After restarting libvirtd immediately.

# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
[root@dhcp210-207 ~]# lsof | grep libvirt | wc 
    102     922   10980


I have done multiple installations to verify that the one extra fd is associated with virt-install and not by libvirtd for other purposes.

Comment 1 Dave Allan 2011-12-12 19:02:05 UTC
(In reply to comment #0)
> I have done multiple installations to verify that the one extra fd is
> associated with virt-install and not by libvirtd for other purposes.

Can you track down the problem further?  Ideally, I would think that this is the kind of BZ for which SEG could submit a patch.  It looks like a simple resource leak.

Comment 2 Alex Jia 2011-12-14 04:59:57 UTC
(In reply to comment #0)
> Description of problem:
> 
> libvirtd does not close all fds opened to install guests by virt-install after
> virt-install finished installing the guest.
> 
> Version-Release number of selected component (if applicable):
> 
> libvirt-0.9.4-12.el6.x86_64
> 
BTW, it's okay for libvirt-0.9.8-1.el6.x86_64, I haven't found fds leak after virt-install completing installation, so it should be also okay on upstream, although I can't confirm which commit fixed this issue.

Comment 3 zhpeng 2011-12-14 06:33:41 UTC
Created attachment 546578 [details]
before installation

Comment 4 zhpeng 2011-12-14 06:34:26 UTC
Created attachment 546579 [details]
installation

Comment 5 zhpeng 2011-12-14 06:35:11 UTC
Created attachment 546580 [details]
after installation

Comment 6 zhpeng 2011-12-14 06:36:46 UTC
Created attachment 546585 [details]
after restart libvirtd

Comment 7 zhpeng 2011-12-14 06:39:48 UTC
I can reproduce this with libvirt-0.9.4-23.el6.x86_64.
And can't reproduce this with libvirt-0.9.8-1.el6.x86_64.

Updated 4 logs of comment 0 from "before installation" to "restart libvirtd" of comment 0.

Comment 8 Alex Jia 2011-12-14 08:58:21 UTC
It seems some patch hasn't been backported into libvirt rpm package of RHEL:

commit 7ea2ef4ce82be9574b4e1fb2a90f2f2c8dc84172
Author: Daniel P. Berrange <berrange>
Date:   Tue Jul 19 14:11:33 2011 +0100

    Use a virFreeCallback on virNetSocket to ensure safe release
    
    When unregistering an I/O callback from a virNetSocket object,
    there is still a chance that an event may come in on the callback.
    In this case it is possible that the virNetSocket might have been
    freed already. Make use of a virFreeCallback when registering
    the I/O callbacks and hold a reference for the entire time the
    callback is set.
    
    * src/rpc/virnetsocket.c: Register a free function for the
      file handle watch
    * src/rpc/virnetsocket.h, src/rpc/virnetserverservice.c,
      src/rpc/virnetserverclient.c, src/rpc/virnetclient.c: Add
      a free function for the socket I/O watches

If so, maybe, should open the bug in 6.2.z, then cherry-pick the patch.

Comment 9 Dave Allan 2012-01-04 20:36:37 UTC
(In reply to comment #7)
> I can reproduce this with libvirt-0.9.4-23.el6.x86_64.
> And can't reproduce this with libvirt-0.9.8-1.el6.x86_64.
> 
> Updated 4 logs of comment 0 from "before installation" to "restart libvirtd" of
> comment 0.

Moving to POST

Comment 11 yanbing du 2012-01-10 10:54:38 UTC
Test this bug with libvirt-0.9.9-1.el6.x86_64.
1. Before starting installation:
# lsof | grep libvirt | wc
    171    1542   17900
2. During installation:
# lsof | grep libvirt | wc
    185    1676   19793
3. After installation:
# lsof | grep libvirt | wc 
    171    1542   17900
All fds opened by virt-install are closed, so move bug to VERIFIED.

Comment 12 Peter Krempa 2012-05-02 09:44:37 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No Documentation needed

Comment 14 errata-xmlrpc 2012-06-20 06:38:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html


Note You need to log in before you can comment on or make changes to this bug.