aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorChrysostomos Nanakos <cnanakos@grnet.gr>2014-09-18 14:30:49 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2014-09-22 11:39:48 +0100
commit2f78e491d7b46542158ce0b8132ee4e05bc0ade4 (patch)
treeb0bbeff681f1f2910502ecf132cfb96258a350ad /vl.c
parente91a8b2fef92e7d31290e785a35f85a503fa1356 (diff)
downloadqemu-2f78e491d7b46542158ce0b8132ee4e05bc0ade4.zip
qemu-2f78e491d7b46542158ce0b8132ee4e05bc0ade4.tar.gz
qemu-2f78e491d7b46542158ce0b8132ee4e05bc0ade4.tar.bz2
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>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index dc792fe..6d073c3 100644
--- a/vl.c
+++ b/vl.c
@@ -2968,6 +2968,7 @@ int main(int argc, char **argv, char **envp)
ram_addr_t maxram_size = default_ram_size;
uint64_t ram_slots = 0;
FILE *vmstate_dump_file = NULL;
+ Error *main_loop_err = NULL;
atexit(qemu_run_exit_notifiers);
error_set_progname(argv[0]);
@@ -3998,8 +3999,8 @@ int main(int argc, char **argv, char **envp)
os_daemonize();
- if (qemu_init_main_loop()) {
- fprintf(stderr, "qemu_init_main_loop failed\n");
+ if (qemu_init_main_loop(&main_loop_err)) {
+ error_report("%s", error_get_pretty(main_loop_err));
exit(1);
}