Merge pull request #1156 from kmajzero/master

Fix mising casadm error message
This commit is contained in:
Robert Baldyga 2022-04-01 14:34:38 +02:00 committed by GitHub
commit 338031ef8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -636,6 +636,9 @@ int set_device_path(char *dest_path, size_t dest_len, const char *src_path, size
cas_printf(LOG_ERR, "Internal error copying device path\n");
}
cas_printf(LOG_ERR, "Please use correct by-id path to the device %s.\n",
src_path);
return FAILURE;
}
@ -993,8 +996,6 @@ int start_cache(uint16_t cache_id, unsigned int cache_init,
cmd.init_cache = cache_init;
if (set_device_path(cmd.cache_path_name, sizeof(cmd.cache_path_name),
cache_device, MAX_STR_LEN) != SUCCESS) {
cas_printf(LOG_ERR, "Please use correct by-id path to the device "
"%s.\n", cache_device);
close(fd);
return FAILURE;
}
@ -1696,11 +1697,8 @@ int add_core(unsigned int cache_id, unsigned int core_id, const char *core_devic
memset(&cmd, 0, sizeof(cmd));
if (set_device_path(cmd.core_path_name, sizeof(cmd.core_path_name),
core_device, MAX_STR_LEN) != SUCCESS) {
cas_printf(LOG_ERR, "Please use correct by-id path to the device "
"%s.\n", core_device);
core_device, MAX_STR_LEN) != SUCCESS)
return FAILURE;
}
user_core_path = core_device;
user_core_path_size = strnlen_s(core_device, MAX_STR_LEN);
@ -1901,8 +1899,6 @@ int core_pool_remove(const char *core_device)
if (set_device_path(cmd.core_path_name, sizeof(cmd.core_path_name),
core_device, MAX_STR_LEN) != SUCCESS) {
cas_printf(LOG_ERR, "Please use correct by-id path to the device "
"%s.\n", core_device);
close(fd);
return FAILURE;
}
@ -2873,11 +2869,8 @@ int check_cache_device(const char *device_path)
int result;
if (set_device_path(cmd_info.path_name, sizeof(cmd_info.path_name),
device_path, MAX_STR_LEN) != SUCCESS) {
cas_printf(LOG_ERR, "Please use correct by-id path to the device "
"%s.\n", device_path);
device_path, MAX_STR_LEN) != SUCCESS)
return FAILURE;
}
result = _check_cache_device(device_path, &cmd_info);