From 507640ea85023ccdd7f49f522b5637e44f207030 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 13 Mar 2013 10:29:22 -0400 Subject: [PATCH] createvol: Don't default to sparse LVM Sparse LVM volumes don't autogrow, which makes them not as useful for virt-manager target users. Don't do it by default --- src/virtManager/createvol.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/virtManager/createvol.py b/src/virtManager/createvol.py index d86a21347..4925ba381 100644 --- a/src/virtManager/createvol.py +++ b/src/virtManager/createvol.py @@ -135,9 +135,14 @@ class vmmCreateVolume(vmmGObjectUI): else: self.widget("vol-format").set_sensitive(False) + alloc = DEFAULT_ALLOC + if self.parent_pool.get_type() == "logical": + # Sparse LVM volumes don't auto grow, so alloc=0 is useless + alloc = DEFAULT_CAP + self.widget("vol-allocation").set_range(0, int(self.parent_pool.get_available() / 1024 / 1024)) - self.widget("vol-allocation").set_value(DEFAULT_ALLOC) + self.widget("vol-allocation").set_value(alloc) self.widget("vol-capacity").set_range(1, int(self.parent_pool.get_available() / 1024 / 1024)) self.widget("vol-capacity").set_value(DEFAULT_CAP)