]> git.proxmox.com Git - mirror_qemu.git/commit - qemu-img.c
async: aio_context_new(): Handle event_notifier_init failure
authorChrysostomos Nanakos <cnanakos@grnet.gr>
Thu, 18 Sep 2014 11:30:49 +0000 (14:30 +0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 22 Sep 2014 10:39:48 +0000 (11:39 +0100)
commit2f78e491d7b46542158ce0b8132ee4e05bc0ade4
treeb0bbeff681f1f2910502ecf132cfb96258a350ad
parente91a8b2fef92e7d31290e785a35f85a503fa1356
async: aio_context_new(): Handle event_notifier_init failure

On a system with a low limit of open files the initialization
of the event notifier could fail and QEMU exits without printing any
error information to the user.

The problem can be easily reproduced by enforcing a low limit of open
files and start QEMU with enough I/O threads to hit this limit.

The same problem raises, without the creation of I/O threads, while
QEMU initializes the main event loop by enforcing an even lower limit of
open files.

This commit adds an error message on failure:

 # qemu [...] -object iothread,id=iothread0 -object iothread,id=iothread1
 qemu: Failed to initialize event notifier: Too many open files in system

Signed-off-by: Chrysostomos Nanakos <cnanakos@grnet.gr>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
12 files changed:
async.c
include/block/aio.h
include/qemu/main-loop.h
iothread.c
main-loop.c
qemu-img.c
qemu-io.c
qemu-nbd.c
tests/test-aio.c
tests/test-thread-pool.c
tests/test-throttle.c
vl.c