Revision de758970

b/configure
2057 2057

  
2058 2058
if compile_prog "" "" ; then
2059 2059
  signalfd=yes
2060
elif test "$kvm" = "yes" -a "$io_thread" != "yes"; then
2061
  echo
2062
  echo "ERROR: Host kernel lacks signalfd() support,"
2063
  echo "but KVM depends on it when the IO thread is disabled."
2064
  echo
2065
  exit 1
2060 2066
fi
2061 2067

  
2062 2068
# check if eventfd is supported
b/cpus.c
319 319
            exit(1);
320 320
        }
321 321
    } while (sigismember(&chkset, SIG_IPI) || sigismember(&chkset, SIGBUS));
322

  
323
#ifndef CONFIG_IOTHREAD
324
    if (sigismember(&chkset, SIGIO) || sigismember(&chkset, SIGALRM)) {
325
        qemu_notify_event();
326
    }
327
#endif
322 328
}
323 329

  
324 330
#else /* _WIN32 */
......
368 374

  
369 375
    sigemptyset(&set);
370 376
    sigaddset(&set, SIG_IPI);
377
    sigaddset(&set, SIGIO);
378
    sigaddset(&set, SIGALRM);
371 379
    pthread_sigmask(SIG_BLOCK, &set, NULL);
372 380

  
373 381
    pthread_sigmask(SIG_BLOCK, NULL, &set);
374 382
    sigdelset(&set, SIG_IPI);
375 383
    sigdelset(&set, SIGBUS);
384
    sigdelset(&set, SIGIO);
385
    sigdelset(&set, SIGALRM);
376 386
    r = kvm_set_signal_mask(env, &set);
377 387
    if (r) {
378 388
        fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(-r));
......
381 391
#endif
382 392
}
383 393

  
394
#ifndef _WIN32
395
static sigset_t block_synchronous_signals(void)
396
{
397
    sigset_t set;
398

  
399
    sigemptyset(&set);
400
    if (kvm_enabled()) {
401
        /*
402
         * We need to process timer signals synchronously to avoid a race
403
         * between exit_request check and KVM vcpu entry.
404
         */
405
        sigaddset(&set, SIGIO);
406
        sigaddset(&set, SIGALRM);
407
    }
408

  
409
    return set;
410
}
411
#endif
412

  
384 413
int qemu_init_main_loop(void)
385 414
{
386 415
#ifndef _WIN32
387 416
    sigset_t blocked_signals;
388 417
    int ret;
389 418

  
390
    sigemptyset(&blocked_signals);
419
    blocked_signals = block_synchronous_signals();
391 420

  
392 421
    ret = qemu_signalfd_init(blocked_signals);
393 422
    if (ret) {

Also available in: Unified diff