pyocf: Make cache lookup by name a common utility
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
committed by
Piotr Debski
parent
5441cdb50a
commit
ef4bfc9ac3
@@ -977,6 +977,16 @@ class Cache:
|
||||
def settle(self):
|
||||
Queue.settle_many(self.io_queues + [self.mngt_queue])
|
||||
|
||||
@staticmethod
|
||||
def get_by_name(cache_name, owner=None):
|
||||
if owner is None:
|
||||
owner = OcfCtx.get_default()
|
||||
cache_pointer = c_void_p()
|
||||
return OcfLib.getInstance().ocf_mngt_cache_get_by_name(
|
||||
owner.ctx_handle, cache_name, byref(cache_pointer)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
lib = OcfLib.getInstance()
|
||||
|
||||
Reference in New Issue
Block a user