diff --git a/man/virt-install.pod.in b/man/virt-install.pod.in index 5d863fbd..9abc6a92 100644 --- a/man/virt-install.pod.in +++ b/man/virt-install.pod.in @@ -449,10 +449,11 @@ size (in GB) to use if creating new storage =item B whether to skip fully allocating newly created storage. Value is 'true' or -'false'. Default is 'true' (do not fully allocate). +'false'. Default is 'true' (do not fully allocate) unless it isn't +supported by the underlying storage type. The initial time taken to fully-allocate the guest virtual disk (sparse=false) -will be usually by balanced by faster install times inside the guest. Thus +will be usually balanced by faster install times inside the guest. Thus use of this option is recommended to ensure consistently high performance and to avoid I/O errors in the guest should the host filesystem fill up. @@ -589,7 +590,7 @@ Connect to a virtual network in the host called C. Virtual networks can be listed, created, deleted using the C command line tool. In an unmodified install of C there is usually a virtual network with a name of C. Use a virtual network if the host has dynamic -networking (eg NetworkManager), or using wireless. The guest will be +networking (eg NetworkManager), or using wireless. The guest will be NATed to the LAN by whichever connection is active. =item user @@ -1368,4 +1369,3 @@ is NO WARRANTY, to the extent permitted by law. C, C, C, the project website C =cut - diff --git a/virtinst/Storage.py b/virtinst/Storage.py index 4d31266d..1a39641c 100644 --- a/virtinst/Storage.py +++ b/virtinst/Storage.py @@ -1,5 +1,5 @@ # -# Copyright 2008 Red Hat, Inc. +# Copyright 2008, 2013 Red Hat, Inc. # Cole Robinson # # This program is free software; you can redistribute it and/or modify @@ -1349,12 +1349,28 @@ class LogicalVolume(StorageVolume): def __init__(self, name, capacity, pool=None, pool_name=None, conn=None, allocation=None, perms=None): + if allocation and allocation != capacity: + raise ValueError(_("Sparse logical volumes are not supported, " + "allocation must be equal to capacity")) StorageVolume.__init__(self, name=name, pool=pool, pool_name=pool_name, - allocation=allocation, capacity=capacity, + allocation=capacity, capacity=capacity, conn=conn) if perms: self.perms = perms + def set_capacity(self, capacity): + super(LogicalVolume, self).set_capacity(capacity) + self.allocation = capacity + capacity = property(StorageVolume.get_capacity, set_capacity) + + def set_allocation(self, allocation): + if allocation != self.capacity: + raise ValueError(_("Sparse logical volumes are not supported, " + "allocation must be equal to capacity")) + super(LogicalVolume, self).set_allocation(allocation) + capacity = property(StorageVolume.get_allocation, set_allocation) + + def _get_target_xml(self): return "%s" % self._get_perms_xml()