diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c index 203fe5d8712b870b9558ccc960bd3f85aa89214d..389ecd7e5dd10cf31301342ee231eb44b4184547 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -604,7 +604,10 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn, cmdargv = cmdargvsnap; } - snprintf(size, sizeof(size)-1, "%lluK", vol->capacity/1024); + unsigned long long int capacity; + capacity = (vol->capacity + 1023) /1024; + + snprintf(size, sizeof(size)-1, "%lluK", capacity); size[sizeof(size)-1] = '\0'; vol->type = VIR_STORAGE_VOL_BLOCK;