]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix sparse volume allocation reporting.
authorCole Robinson <crobinso@redhat.com>
Fri, 3 Apr 2009 14:13:02 +0000 (14:13 +0000)
committerCole Robinson <crobinso@redhat.com>
Fri, 3 Apr 2009 14:13:02 +0000 (14:13 +0000)
ChangeLog
src/storage_backend.c

index fa26cd5638d3bc8c7978acd3297c09dc4db21592..e1d32f662f78b23717e1177c9d65dd3e04f294cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Apr  3 10:02:57 EDT 2009 Cole Robinson <crobinso@redhat.com>
+
+       * src/storage_backend.c: Fix sparse volume allocation reporting.
+
 Fri Apr  3 15:07:00 BST 2009 Daniel P. Berrange <berrange@redhat.com>
 
        Fix crash in svirt verification, and incorrect cleanup in
index 71b80201cf0c5a5b56a9be31b3f9c75b0c520639..79c070c9f6be978b34583b3012b8545f92d89fa9 100644 (file)
@@ -36,6 +36,7 @@
 #include <fcntl.h>
 #include <stdint.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <dirent.h>
 
 #if HAVE_SELINUX
@@ -64,6 +65,9 @@
 #include "storage_backend_fs.h"
 #endif
 
+#ifndef DEV_BSIZE
+#define DEV_BSIZE 512
+#endif
 
 #define VIR_FROM_THIS VIR_FROM_STORAGE
 
@@ -211,7 +215,7 @@ virStorageBackendUpdateVolTargetInfoFD(virConnectPtr conn,
         if (S_ISREG(sb.st_mode)) {
 #ifndef __MINGW32__
             *allocation = (unsigned long long)sb.st_blocks *
-                (unsigned long long)sb.st_blksize;
+                          (unsigned long long)DEV_BSIZE;
 #else
             *allocation = sb.st_size;
 #endif