-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LVM cache detection, manipulation and reporting #156
LVM cache detection, manipulation and reporting #156
Conversation
7c64dff
to
c562f15
Compare
Inheriting classes will implement specific functionality for LVM cache and Bcache.
6c27daf
to
113058f
Compare
I think this is ok. |
Any example? The problem is that e.g. the stats reported for Bcache look quite different from stats reported for the LVM cache. |
I'm not so familiar with the problematic to tell you. |
I'm no blivet expert but I think this is ok :) |
|
||
self._cache = LVMCache(self, size=pool.size, exists=True) | ||
|
||
return self._cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always creates an LVMCache
, no? So then the cached
property above will always be True for existing LVs. I think it just needs an if pool is not None:
guarding the assignment to self._cache
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, good catch, thanks! It would actually result in a traceback when accessing the size
attribute of pool
, but that doesn't matter. Fixing and updating the PR with this change.
Other than the minor problem in |
This way LVMLogicalVolumeDevice can report whether they are cached, provide information related to their cache and attach cache pool to themselves so that they become cached.
113058f
to
85a3812
Compare
LVM cache detection, manipulation and reporting
These commits add generic classes for Cache monitoring, manipulation and reporting, the implementation for the LVM Cache and pieces of code needed for the
LVMLogicalVolumeDevice
class to support cached LVs.The reason why cached LV is not a new, separate class is that when the cache is detached, such (formerly) cached LV becomes a normal LV like any other and its not possible to change the type/class of an existing object. Thus the
LVMCache
class is added instead the instances of which are referenced by cached LVs and provide the cache-related functionality to them. The same approach will be later used forBcacheDevice
andBcacheCache
classes (a device can be formatted as aBcacheDevice
with no cache attached to it).