From 15f81b6ed9a2bc9821c90a4058b7b528e001a10f Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 3 Jun 2013 13:38:59 +0200 Subject: kvm: Add handling of EAGAIN when creating timers timer_create can apparently return -1 and set errno to EAGAIN if the kernel suffered a temporary failure when allocating a timer. This happens from time to time, so we need to handle it. --- src/cpu/kvm/timer.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cpu/kvm/timer.cc b/src/cpu/kvm/timer.cc index e1f74a552..03cdea6fb 100644 --- a/src/cpu/kvm/timer.cc +++ b/src/cpu/kvm/timer.cc @@ -59,8 +59,11 @@ PosixKvmTimer::PosixKvmTimer(int signo, clockid_t clockID, sev.sigev_notify = SIGEV_SIGNAL; sev.sigev_signo = signo; sev.sigev_value.sival_ptr = NULL; - if (timer_create(clockID, &sev, &timer) == -1) - panic("timer_create"); + + while (timer_create(clockID, &sev, &timer) == -1) { + if (errno != EAGAIN) + panic("timer_create: %i", errno); + } } PosixKvmTimer::~PosixKvmTimer() -- cgit v1.2.3