ia64/xen-unstable

changeset 19814:20c0df018786

xenconsoled: Fix rate-limit calculation overflow leading to console freezes.

From: Eric Tessler <eric@3tera.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 23 11:25:38 2009 +0100 (2009-06-23)
parents b55070edb185
children b6612dd06218
files tools/console/daemon/io.c
line diff
     1.1 --- a/tools/console/daemon/io.c	Tue Jun 23 11:23:27 2009 +0100
     1.2 +++ b/tools/console/daemon/io.c	Tue Jun 23 11:25:38 2009 +0100
     1.3 @@ -688,7 +688,7 @@ static struct domain *create_domain(int 
     1.4  	dom->buffer.capacity = 0;
     1.5  	dom->buffer.max_capacity = 0;
     1.6  	dom->event_count = 0;
     1.7 -	dom->next_period = (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000) + RATE_LIMIT_PERIOD;
     1.8 +	dom->next_period = ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 1000000) + RATE_LIMIT_PERIOD;
     1.9  	dom->next = NULL;
    1.10  
    1.11  	dom->ring_ref = -1;
    1.12 @@ -1009,7 +1009,7 @@ void handle_io(void)
    1.13  
    1.14  		if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0)
    1.15  			return;
    1.16 -		now = (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
    1.17 +		now = ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
    1.18  
    1.19  		/* Re-calculate any event counter allowances & unblock
    1.20  		   domains with new allowance */