5e9dbb5e92
Also move "num_blocks" parameter calculation outside of the create_pmem_pool function to keep it consistent with rest of similar functions. Add docstrings while at it. Change-Id: I024abf0ed450f51d67a6acdb3927b06e205102d8 Signed-off-by: Karol Latecki <karol.latecki@intel.com> Reviewed-on: https://review.gerrithub.io/415740 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
30 lines
893 B
Python
Executable File
30 lines
893 B
Python
Executable File
def create_pmem_pool(client, pmem_file, num_blocks, block_size):
|
|
"""Create pmem pool at specified path.
|
|
Args:
|
|
pmem_file: path at which to create pmem pool
|
|
num_blocks: number of blocks for created pmem pool file
|
|
block_size: block size for pmem pool file
|
|
"""
|
|
params = {'pmem_file': pmem_file,
|
|
'num_blocks': num_blocks,
|
|
'block_size': block_size}
|
|
return client.call('create_pmem_pool', params)
|
|
|
|
|
|
def pmem_pool_info(client, pmem_file):
|
|
"""Get details about pmem pool.
|
|
Args:
|
|
pmem_file: path to pmem pool
|
|
"""
|
|
params = {'pmem_file': pmem_file}
|
|
return client.call('pmem_pool_info', params)
|
|
|
|
|
|
def delete_pmem_pool(client, pmem_file):
|
|
"""Delete pmem pool.
|
|
Args:
|
|
pmem_file: path to pmem pool
|
|
"""
|
|
params = {'pmem_file': pmem_file}
|
|
return client.call('delete_pmem_pool', params)
|