@@ -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`.
+
I agree, but actually I think we should do the same for thin pools. It brings the user
code one big benefit -- they don't have to care about any meta data space if they
don't want to.
--
To view this pull request on github, visit
https://github.com/rhinstaller/blivet/pull/207#discussion_r37833693