casadm: more informative logging on activate

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2022-03-24 10:32:44 +01:00
parent 3c2fd8059c
commit 5c8f9a0d8f

View File

@ -3033,9 +3033,17 @@ int standby_activate(int cache_id, const char *cache_device)
} }
if (cas_ioctl(KCAS_IOCTL_STANDBY_ACTIVATE, &cmd) != SUCCESS) { if (cas_ioctl(KCAS_IOCTL_STANDBY_ACTIVATE, &cmd) != SUCCESS) {
if (abs(cmd.ext_err_code) == OCF_ERR_NOT_OPEN_EXC) {
cas_printf(LOG_ERR, "Cannot open the device exclusively. Make sure "
"to detach cache before activation.\n");
} else {
print_err(cmd.ext_err_code ? : KCAS_ERR_SYSTEM); print_err(cmd.ext_err_code ? : KCAS_ERR_SYSTEM);
}
return FAILURE; return FAILURE;
} }
cas_printf(LOG_INFO, "Successfully activated cache instance %hu\n",
cache_id);
return SUCCESS; return SUCCESS;
} }