Red Hat Bugzilla – Bug 1271060
virtio_pci_set_host_notifier_internal: unable to init event notifier: -24
Last modified: 2017-08-01 23:24:58 EDT
Description of problem: Version-Release number of selected component (if applicable): Host: 3.10.0-322.el7.ppc64le qemu-kvm-rhev-2.3.0-29.el7.ppc64le Guest: 3.10.0-322.el7.ppc64 How reproducible: 100% Steps to Reproduce: 1.Start qemu-kvm with 28 virtio-serial-pci devices. /usr/libexec/qemu-kvm -name RHEL-7.2_BE -machine pseries,accel=kvm,usb=off -m 8192 -realtime mlock=off -smp 8,sockets=2,cores=2,threads=2 \ -rtc base=localtime,clock=host,driftfix=slew \ -monitor stdio \ -boot menu=on \ -device usb-ehci,id=usb,bus=pci.0,addr=0x1 \ -drive file=/home/mazhang/rhel7.2-ppc.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none,rerror=stop,werror=stop,aio=native \ -device virtio-blk-pci,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bus=pci.0,addr=0x3,bootindex=1 \ -vnc :99 -device VGA,id=video0,vgamem_mb=16,bus=pci.0,addr=0x5 \ -device usb-kbd,id=input0 \ -device usb-mouse,id=input1 \ -device usb-tablet,id=input2 \ -msg timestamp=on \ -netdev tap,id=hostnet0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:c4:e7:93,bus=pci.0,addr=0x6 \ -serial unix:/tmp/console0,server,nowait \ -device virtio-serial-pci,id=virtio-serial0,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial1,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial2,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial3,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial4,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial5,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial6,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial7,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial8,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial9,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial10,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial11,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial12,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial13,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial14,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial15,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial16,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial17,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial18,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial19,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial20,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial21,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial22,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial23,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial24,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial25,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial26,bus=pci.0 \ -device virtio-serial-pci,id=virtio-serial27,bus=pci.0 \ 2. 3. Actual results: Hmp print below errors during boot kernel. But guest seems works well. QEMU 2.3.0 monitor - type 'help' for more information (qemu) 2015-10-13T05:24:46.224780Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.230508Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.275582Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.281265Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.325692Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.331371Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.379405Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.385082Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.431438Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.437116Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.482580Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.488248Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.531083Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.536768Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.586083Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.591773Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.639663Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.645342Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.694775Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.700469Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.748458Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.754136Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.802487Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.808158Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). 2015-10-13T05:24:46.858111Z qemu-kvm: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 2015-10-13T05:24:46.863811Z qemu-kvm: virtio_pci_start_ioeventfd: failed. Fallback to a userspace (slower). Expected results: No complain in hmp. Additional info:
The "-24" means EMFILE - "Too many open files". Does it work if you increase the maximum possible number of open file descriptors? (not sure, but I think you can do that with "ulimit -n")
(In reply to Thomas Huth from comment #2) > The "-24" means EMFILE - "Too many open files". Does it work if you increase > the maximum possible number of open file descriptors? (not sure, but I think > you can do that with "ulimit -n") Setting needinfo(reporter)
(In reply to Thomas Huth from comment #2) > The "-24" means EMFILE - "Too many open files". Does it work if you increase > the maximum possible number of open file descriptors? (not sure, but I think > you can do that with "ulimit -n") Test on 3.10.0-327.5.1.el7.ppc64le and qemu-kvm-rhev-2.3.0-31.el7_2.5.ppc64le. Those messages gone after increase the maximum possible number of open file descriptors.
Ok, so how should we proceed here? Would it be acceptable to simply improve the error message with a hint that the number of possible open file descriptors should be increased with "ulimit -n"?
(In reply to Thomas Huth from comment #5) > Ok, so how should we proceed here? Would it be acceptable to simply improve > the error message with a hint that the number of possible open file > descriptors should be increased with "ulimit -n"? Summary: virtio_pci_set_host_notifier_internal: unable to init event notifier: -24 means "Too many open files", and it will works if increase the maximum possible number of open file descriptors. Base on 902632#c10 and 1124311#c29, close this bug is ok. If any problem please let me know. Thanks, Mazhang.
Okay, we've concluced the "this doesn't work" aspect actually "works as designed". What's left ist the "this error message could use improvement" aspect: we should print strerror(number) instead of number.
I've now suggested a patch for this upstream: http://news.gmane.org/find-root.php?message_id=1467065523-13881-1-git-send-email-thuth@redhat.com (note that upstream, the code has been moved around there a little bit, in downstream the code is in hw/virtio/virtio-pci.c instead)
*** Bug 1370356 has been marked as a duplicate of this bug. ***
Patch has been merged in upstream now, so the improved error message should be included in QEMU 2.8: http://git.qemu.org/?p=qemu.git;a=commitdiff;h=a8bba0ada41b228e4dd5113a02f20bbc0f5d6f0a
Verified this bug with qemu-kvm-rhev-2.8.0-5.el7.ppc64le. Steps: Same as comment 0. Results: Error messages became more readable. 2017-02-28T01:58:27.307667Z qemu-kvm: virtio_bus_set_host_notifier: unable to init event notifier: Too many open files (-24) 2017-02-28T01:58:27.328345Z qemu-kvm: virtio_bus_start_ioeventfd: failed. Fallback to userspace (slower). And these would gone after increased the maximum possible number of open file descriptors. So, the bug has been fixed.
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://access.redhat.com/errata/RHSA-2017:2392