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 1072677 - Incorrect error message when hot-plugging interface with an inexistence nwfilter
Summary: Incorrect error message when hot-plugging interface with an inexistence nwfilter
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 1122337 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-05 02:46 UTC by Hu Jianwei
Modified: 2015-03-05 07:31 UTC (History)
8 users (show)

Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:31:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description Hu Jianwei 2014-03-05 02:46:37 UTC
Description of problem:
Incorrect error message when hot-plugging interface with an inexistence nwfilter.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-25.el7.x86_64
qemu-kvm-rhev-1.5.3-50.el7.x86_64
kernel-3.10.0-97.el7.x86_64

How reproducible:
50%(probability issue)

Steps to Reproduce:
1. Hot-plug one interface with inexistence nwfiter(maybe you need attach it several times to reproduce it.)

[root@intel-e5530-8-2 ~]# cat interface.xml
   <interface type='network'>
      <source network='default'/>
      <filterref filter='my1'>
      </filterref>
    </interface>

[root@intel-e5530-8-2 ~]# virsh attach-device r7 interface.xml 
error: Failed to attach device from interface.xml
error: Network filter not found: Could not find filter 'my1'
.
.
.
[root@intel-e5530-8-2 ~]# virsh attach-device r7 interface.xml
error: Failed to attach device from interface.xml
error: End of file while reading data: Input/output error
error: One or more references were leaked after disconnect from the hypervisor
error: Reconnected to the hypervisor

2. Check the libvirtd status(libvirtd is living, not restart or stop)
[root@intel-e5530-8-2 ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 35    r7                             running

Actual results:
As shown above.

Expected results:
I think libvirt should print proper message to foreground. Just like the first error message above "Network filter not found: Could not find filter 'my1'"

Comment 1 Stefan Berger 2014-03-08 19:26:59 UTC
I am seeing this error in the log the 2nd time I try to attach the interface:

2014-03-08 19:07:24.605+0000: 549: warning : virFileClose:83 : Tried to close invalid fd 0

I see it internally visiting the error message above also the 2nd time it runs. After that we then run into the following error:

[Switching to Thread 0x7f59b28cd840 (LWP 3084)]

Breakpoint 1, virFileClose (fdptr=fdptr@entry=0x7fa5d00e6318, 
    flags=flags@entry=VIR_FILE_CLOSE_PRESERVE_ERRNO) at util/virfile.c:82
82	                if (!(flags & VIR_FILE_CLOSE_IGNORE_EBADF))
(gdb) bt
#0  virFileClose (fdptr=fdptr@entry=0x7fa5d00e6318, 
    flags=flags@entry=VIR_FILE_CLOSE_PRESERVE_ERRNO) at util/virfile.c:82
#1  0x00007fa5ce779252 in virNetSocketDispose (obj=0x7fa5d00e62e0)
    at rpc/virnetsocket.c:1049
#2  0x00007fa5ce64f45b in virObjectUnref (anyobj=<optimized out>)
    at util/virobject.c:262
#3  0x00007fa5ce62dbaa in virEventPollCleanupHandles ()
    at util/vireventpoll.c:583
#4  0x00007fa5ce62ea03 in virEventPollRunOnce () at util/vireventpoll.c:619
#5  0x00007fa5ce62d64b in virEventRunDefaultImpl () at util/virevent.c:306
#6  0x00007fa5ce76e70d in virNetServerRun (srv=srv@entry=0x7fa5d00d8920)
    at rpc/virnetserver.c:1117
#7  0x00007fa5cf1b3918 in main (argc=<optimized out>, argv=<optimized out>)
    at libvirtd.c:1526

Comment 2 Stefan Berger 2014-03-08 23:14:51 UTC
The problem is due to the freeing of the zero file descriptor. Patch on the way.

Comment 3 Michal Privoznik 2014-03-11 09:33:54 UTC
The patch has been pushed to upstream repo:

commit 6768b210335e9c0c7d97bb96ad2ff69a276236a3
Author:     Stefan Berger <stefanb.ibm.com>
AuthorDate: Mon Mar 10 18:47:19 2014 -0400
Commit:     Stefan Berger <stefanb.com>
CommitDate: Mon Mar 10 18:47:19 2014 -0400

    BZ1072677: Avoid freeing of 0 file descriptor
    
    Avoid the freeing of an array of zero file descriptors in case
    of error. Initialize the array to -1 using memset.
    
    Signed-off-by: Stefan Berger <stefanb.ibm.com>

v1.2.2-76-g6768b21

Comment 4 Michal Privoznik 2014-07-08 16:33:56 UTC
Moving to POST per comment 3.

Comment 5 Ján Tomko 2014-07-23 12:25:29 UTC
*** Bug 1122337 has been marked as a duplicate of this bug. ***

Comment 7 Hu Jianwei 2014-11-24 10:16:03 UTC
Verified as below:

[root@ibm-x3850x5-06 ~]# rpm -q libvirt
libvirt-1.2.8-7.el7.x86_64

[root@ibm-x3850x5-06 ~]# cat interface.xml 
   <interface type='network'>
      <source network='default'/>
      <filterref filter='my1'>
      </filterref>
    </interface>
[root@ibm-x3850x5-06 ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 17    r7                             running

[root@ibm-x3850x5-06 ~]# virsh attach-device r7 interface.xml 
error: Failed to attach device from interface.xml
error: Network filter not found: Could not find filter 'my1'

[root@ibm-x3850x5-06 ~]# virsh attach-device r7 interface.xml 
error: Failed to attach device from interface.xml
error: Network filter not found: Could not find filter 'my1'

After repeating vish cmd more than 10 times:

[root@ibm-x3850x5-06 ~]# virsh attach-device r7 interface.xml 
error: Failed to attach device from interface.xml
error: Network filter not found: Could not find filter 'my1'



libvirt always report a consistent error message, move to Verified.

Comment 9 errata-xmlrpc 2015-03-05 07:31:07 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.

https://rhn.redhat.com/errata/RHSA-2015-0323.html


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