From 2096e344897d0598245a72ff43f094566d3887d0 Mon Sep 17 00:00:00 2001 From: Gershon Geva Date: Sun, 8 Oct 2023 12:33:06 +0300 Subject: [PATCH] Pass user's params when opening a core volume Signed-off-by: Michal Mielewczyk --- inc/ocf_mngt.h | 6 ++++++ src/mngt/ocf_mngt_core.c | 2 +- tests/functional/pyocf/types/core.py | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/inc/ocf_mngt.h b/inc/ocf_mngt.h index 9234879..cd33c60 100644 --- a/inc/ocf_mngt.h +++ b/inc/ocf_mngt.h @@ -34,6 +34,12 @@ struct ocf_mngt_core_config { */ uint8_t volume_type; + /** + * @brief Optional opaque volume parameters, passed down to core volume + * open callback + */ + void *volume_params; + /** * @brief Add core to pool if cache isn't present or add core to * earlier loaded cache diff --git a/src/mngt/ocf_mngt_core.c b/src/mngt/ocf_mngt_core.c index 32dd58d..ea2f479 100644 --- a/src/mngt/ocf_mngt_core.c +++ b/src/mngt/ocf_mngt_core.c @@ -414,7 +414,7 @@ static void ocf_mngt_cache_add_core_insert(ocf_pipeline_t pipeline, OCF_PL_FINISH_RET(pipeline, result); } - result = ocf_volume_open(volume, NULL); + result = ocf_volume_open(volume, cfg->volume_params); if (result) OCF_PL_FINISH_RET(pipeline, result); diff --git a/tests/functional/pyocf/types/core.py b/tests/functional/pyocf/types/core.py index 0ea11e4..f1fdf96 100644 --- a/tests/functional/pyocf/types/core.py +++ b/tests/functional/pyocf/types/core.py @@ -1,5 +1,6 @@ # # Copyright(c) 2019-2022 Intel Corporation +# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -44,6 +45,7 @@ class CoreConfig(Structure): ("_name", c_char * MAX_CORE_NAME_SIZE), ("_uuid", Uuid), ("_volume_type", c_uint8), + ("_volume_params", c_void_p), ("_try_add", c_bool), ("_seq_cutoff_threshold", c_uint32), ("_seq_cutoff_promotion_count", c_uint32),