Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1072677 - Incorrect error message when hot-plugging interface with an inexistence nwfilter
Incorrect error message when hot-plugging interface with an inexistence nwfilter
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Michal Privoznik
Virtualization Bugs
: Upstream
: 1122337 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-04 21:46 EST by Hu Jianwei
Modified: 2015-03-05 02:31 EST (History)
8 users (show)

See Also:
Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:31:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description Hu Jianwei 2014-03-04 21:46:37 EST
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 14:26:59 EST
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 18:14:51 EST
The problem is due to the freeing of the zero file descriptor. Patch on the way.
Comment 3 Michal Privoznik 2014-03-11 05:33:54 EDT
The patch has been pushed to upstream repo:

commit 6768b210335e9c0c7d97bb96ad2ff69a276236a3
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Mon Mar 10 18:47:19 2014 -0400
Commit:     Stefan Berger <stefanb@us.ibm.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@linux.vnet.ibm.com>

v1.2.2-76-g6768b21
Comment 4 Michal Privoznik 2014-07-08 12:33:56 EDT
Moving to POST per comment 3.
Comment 5 Ján Tomko 2014-07-23 08:25:29 EDT
*** Bug 1122337 has been marked as a duplicate of this bug. ***
Comment 7 Hu Jianwei 2014-11-24 05:16:03 EST
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 02:31:07 EST
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.