From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34021 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrQoN-000438-Nk for qemu-devel@nongnu.org; Mon, 21 Feb 2011 03:08:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrQoM-0000ux-Hm for qemu-devel@nongnu.org; Mon, 21 Feb 2011 03:08:03 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:62623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrQoM-0000uj-9v for qemu-devel@nongnu.org; Mon, 21 Feb 2011 03:08:02 -0500 Received: by eyx24 with SMTP id 24so160703eyx.33 for ; Mon, 21 Feb 2011 00:08:01 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4D621D5D.5040807@redhat.com> Date: Mon, 21 Feb 2011 09:07:57 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1297359464-9789-1-git-send-email-pbonzini@redhat.com> <1297359464-9789-3-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 2/7] implement win32 dynticks timer List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On 02/20/2011 10:15 PM, Blue Swirl wrote: > On Thu, Feb 10, 2011 at 7:37 PM, Paolo Bonzini wrote: >> Signed-off-by: Paolo Bonzini >> Cc: Stefan Weil >> Cc: Blue Swirl >> --- >> qemu-timer.c | 6 +++++- >> 1 files changed, 5 insertions(+), 1 deletions(-) >> >> diff --git a/qemu-timer.c b/qemu-timer.c >> index b0db780..42960de 100644 >> --- a/qemu-timer.c >> +++ b/qemu-timer.c >> @@ -1006,6 +1006,7 @@ static void win32_stop_timer(struct qemu_alarm_timer *t) >> static void win32_rearm_timer(struct qemu_alarm_timer *t) >> { >> struct qemu_alarm_win32 *data = t->priv; >> + int nearest_delta_ms; >> >> assert(alarm_has_dynticks(t)); >> if (!active_timers[QEMU_CLOCK_REALTIME]&& >> @@ -1015,7 +1016,10 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t) >> >> timeKillEvent(data->timerId); >> >> - data->timerId = timeSetEvent(1, >> + nearest_delta_ms = (qemu_next_alarm_deadline() + 999999) / 1000000; >> + if (nearest_delta_ms< 1) >> + nearest_delta_ms = 1; > > Braces, please. Oops, checkpatch missed it. Will fix. Paolo