summaryrefslogtreecommitdiffstats
path: root/block/qcow2-cluster.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/qcow2-cluster.c')
-rw-r--r--block/qcow2-cluster.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index e444e53..f88118c 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -39,6 +39,9 @@ int qcow2_grow_l1_table(BlockDriverState *bs, int min_size)
new_l1_size = s->l1_size;
if (min_size <= new_l1_size)
return 0;
+ if (new_l1_size == 0) {
+ new_l1_size = 1;
+ }
while (min_size > new_l1_size) {
new_l1_size = (new_l1_size * 3 + 1) / 2;
}
OpenPOWER on IntegriCloud