From e807e4d9e9a766bd00a89b0a9c179edfad52773c Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 3 Apr 2009 14:13:02 +0000 Subject: [PATCH] Fix sparse volume allocation reporting. --- ChangeLog | 4 ++++ src/storage_backend.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fa26cd5638..e1d32f662f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Apr 3 10:02:57 EDT 2009 Cole Robinson + + * src/storage_backend.c: Fix sparse volume allocation reporting. + Fri Apr 3 15:07:00 BST 2009 Daniel P. Berrange Fix crash in svirt verification, and incorrect cleanup in diff --git a/src/storage_backend.c b/src/storage_backend.c index 71b80201cf..79c070c9f6 100644 --- a/src/storage_backend.c +++ b/src/storage_backend.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #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