]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fixed 32-bit overflow
authorDaniel P. Berrange <berrange@redhat.com>
Sat, 17 Nov 2007 11:53:44 +0000 (11:53 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Sat, 17 Nov 2007 11:53:44 +0000 (11:53 +0000)
ChangeLog
src/stats_linux.c

index a23c3cd8ac79e140334ed211957cd3fbe78322d1..6efe3b13e7e229bd5c0548fc4bd83c48cb751d69 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Nov 17 11:55:33 UTC 2007 Daniel P. Berrange <berrange@redhat.com>
+
+       * src/stats_linux.c: Fixed overflow of left shift on 32-bit platforms
+
 Sat Nov 17 11:04:33 UTC 2007 Daniel P. Berrange <berrange@redhat.com>
 
         * qemud/Makefile.am: Remove protocol.[chx] from EXTRA_DIST.
index f35d5dd4e10520b9f8664fb7d1b54110317e6bd6..9c7ed72e2e3a74bb7cdb4b06a284997ca2f75873 100644 (file)
@@ -200,7 +200,7 @@ read_bd_stats (virConnectPtr conn, xenUnifiedPrivatePtr priv,
      * an assumed sector size.
      */
     if (stats->rd_bytes > 0) {
-        if (stats->rd_bytes >= 1L<<(63-9)) {
+        if (stats->rd_bytes >= ((unsigned long long)1)<<(63-9)) {
             statsErrorFunc (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__,
                             "stats->rd_bytes would overflow 64 bit counter",
                             domid);
@@ -209,7 +209,7 @@ read_bd_stats (virConnectPtr conn, xenUnifiedPrivatePtr priv,
         stats->rd_bytes *= 512;
     }
     if (stats->wr_bytes > 0) {
-        if (stats->wr_bytes >= 1L<<(63-9)) {
+        if (stats->wr_bytes >= ((unsigned long long)1)<<(63-9)) {
             statsErrorFunc (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__,
                             "stats->wr_bytes would overflow 64 bit counter",
                             domid);