]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
xenconsoled: Fix rate-limit calculation overflow leading to console
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 23 Jun 2009 10:36:45 +0000 (11:36 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 23 Jun 2009 10:36:45 +0000 (11:36 +0100)
freezes.

From: Eric Tessler <eric@3tera.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset:   19814:20c0df018786
xen-unstable date:        Tue Jun 23 11:25:38 2009 +0100

tools/console/daemon/io.c

index bee9cea7c3c56f1425120863e8b052fae5beeb5f..8f564178be53f6b5f92f55d1d910c2d12a52e0a7 100644 (file)
@@ -684,7 +684,7 @@ static struct domain *create_domain(int domid)
        dom->buffer.capacity = 0;
        dom->buffer.max_capacity = 0;
        dom->event_count = 0;
-       dom->next_period = (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000) + RATE_LIMIT_PERIOD;
+       dom->next_period = ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 1000000) + RATE_LIMIT_PERIOD;
        dom->next = NULL;
 
        dom->ring_ref = -1;
@@ -1005,7 +1005,7 @@ void handle_io(void)
 
                if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0)
                        return;
-               now = (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
+               now = ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
 
                /* Re-calculate any event counter allowances & unblock
                   domains with new allowance */