[rhinstaller/blivet/pulls/207 master] Better calculate required space for LVM cache

dwlehman installerbot-noreply at redhat.com
Mon Aug 24 20:53:29 UTC 2015


> @@ -1653,21 +1667,37 @@ def dependsOn(self, dep):
>  class LVMCache(Cache):
>      """Class providing the cache-related functionality of a cached LV"""
>  
> -    def __init__(self, cached_lv, size=None, exists=False, fast_pvs=None, mode=None):
> +    def __init__(self, cached_lv, size=None, md_size=None, exists=False, fast_pvs=None, mode=None):
>          """
>          :param cached_lv: the LV the cache functionality of which to provide
>          :type cached_lv: :class:`LVMLogicalVolumeDevice`
>          :param size: size of the cache (useful mainly for non-existing caches
>                       that cannot determine their size dynamically)
>          :type size: :class:`~.size.Size`
> +        :param md_size: size of the metadata part (LV) of the cache (for
> +                        non-existing caches that cannot determine their metadata
> +                        size dynamically) or None to use the default (see note below)
> +        :type md_size: :class:`~.size.Size` or NoneType
>          :param bool exists: whether the cache exists or not
>          :param fast_pvs: PVs to allocate the cache on/from (ignored for existing)
>          :type fast_pvs: list of :class:`~.devices.storage.StorageDevice`
>          :param str mode: desired mode for non-existing cache (ignored for existing)
>  
> +        .. note::
> +            If :param:`md_size` is None for a an unexisting cache, the default
> +            is used and it is subtracted from the requested :param:`size` so
> +            that the whole cache (data+metadata) fits in the space of size
> +            :param:`size`.
> +

This seems a bit ugly, but it's similar to what happens for new md arrays.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/207#discussion_r37803219


More information about the anaconda-patches mailing list