Compare commits
1 Commits
5f0a32cddb
...
02a209aff8
Author | SHA1 | Date | |
---|---|---|---|
02a209aff8 |
@ -219,6 +219,9 @@ class cas_config(object):
|
|||||||
if not stat.S_ISBLK(mode):
|
if not stat.S_ISBLK(mode):
|
||||||
raise ValueError(f'{path} is not block device')
|
raise ValueError(f'{path} is not block device')
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f"cas_config(caches={[str(cache) for cache in self.caches.values()]}, cores={[str(core) for core in self.cores]}, version_tag={self.version_tag})"
|
||||||
|
|
||||||
class cache_config(object):
|
class cache_config(object):
|
||||||
def __init__(self, cache_id, device, cache_mode, **params):
|
def __init__(self, cache_id, device, cache_mode, **params):
|
||||||
self.cache_id = int(cache_id)
|
self.cache_id = int(cache_id)
|
||||||
@ -227,6 +230,9 @@ class cas_config(object):
|
|||||||
self.params = params
|
self.params = params
|
||||||
self.cores = dict()
|
self.cores = dict()
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f"cache_config(cache_id={self.cache_id}, device={self.device}, cache_mode={self.cache_mode}, params={self.params}, cores={self.cores})"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_line(cls, line, allow_incomplete=False):
|
def from_line(cls, line, allow_incomplete=False):
|
||||||
values = line.split()
|
values = line.split()
|
||||||
@ -387,6 +393,9 @@ class cas_config(object):
|
|||||||
self.device = path
|
self.device = path
|
||||||
self.params = params
|
self.params = params
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f"core_config(cache_id={self.cache_id}, core_id={self.core_id}, device={self.device}, params={self.params})"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_line(cls, line, allow_incomplete=False):
|
def from_line(cls, line, allow_incomplete=False):
|
||||||
values = line.split()
|
values = line.split()
|
||||||
@ -646,12 +655,12 @@ def configure_cache(cache):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def add_core(core, attach):
|
def add_core(core, try_add):
|
||||||
casadm.add_core(
|
casadm.add_core(
|
||||||
device=core.device,
|
device=core.device,
|
||||||
cache_id=core.cache_id,
|
cache_id=core.cache_id,
|
||||||
core_id=core.core_id,
|
core_id=core.core_id,
|
||||||
try_add=attach)
|
try_add=try_add)
|
||||||
|
|
||||||
# Another helper functions
|
# Another helper functions
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user