Make device parameter obligatory in failover activate

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-11-30 15:42:09 +01:00
parent 8f53682954
commit 0f6a024025
3 changed files with 11 additions and 32 deletions

View File

@@ -3004,11 +3004,9 @@ int failover_activate(int cache_id, const char *cache_device)
{
struct kcas_failover_activate data = {.cache_id = cache_id};
if (cache_device) {
if (set_device_path(data.cache_path, sizeof(data.cache_path),
cache_device, MAX_STR_LEN) != SUCCESS) {
return FAILURE;
}
if (set_device_path(data.cache_path, sizeof(data.cache_path),
cache_device, MAX_STR_LEN) != SUCCESS) {
return FAILURE;
}
if (cas_ioctl(KCAS_IOCTL_FAILOVER_ACTIVATE, &data) != SUCCESS) {

View File

@@ -1497,7 +1497,7 @@ static cli_option failover_detach_options[] = {
static cli_option failover_activate_options[] = {
{'i', "cache-id", CACHE_ID_DESC, 1, "ID", CLI_OPTION_REQUIRED},
{'d', "cache-device", CACHE_DEVICE_DESC, 1, "DEVICE"},
{'d', "cache-device", CACHE_DEVICE_DESC, 1, "DEVICE", CLI_OPTION_REQUIRED},
{}
};