Add core, try-add script missing core-id parameter fix

Signed-off-by: Piotr Debski <piotr.debski@intel.com>
This commit is contained in:
Piotr Debski
2022-07-12 11:12:41 +02:00
parent 124075783f
commit dd95c8be4d
2 changed files with 9 additions and 1 deletions

View File

@@ -1640,6 +1640,11 @@ int add_core(unsigned int cache_id, unsigned int core_id, const char *core_devic
const char *core_path; /* core path sent down to kernel */
const char *user_core_path; /* core path provided by user */
if (try_add && core_id == OCF_CORE_ID_INVALID) {
cas_printf(LOG_ERR, "Option '--core-id' is missing\n");
return FAILURE;
}
/* Check if core device provided is valid */
fd = open(core_device, 0);
if (fd < 0) {