aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/storage/storage_backend_logical.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index eebeec1ba..de43c3a42 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -725,7 +725,8 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn,
NULL);
virCommandAddArg(cmd, "-L");
if (vol->capacity != vol->allocation) {
- virCommandAddArgFormat(cmd, "%lluK", VIR_DIV_UP(vol->allocation, 1024));
+ virCommandAddArgFormat(cmd, "%lluK",
+ VIR_DIV_UP(vol->allocation ? vol->allocation : 1, 1024));
virCommandAddArg(cmd, "--virtualsize");
}
virCommandAddArgFormat(cmd, "%lluK", VIR_DIV_UP(vol->capacity, 1024));