We'll update the "rbd-wnbd show" command to return -ENOENT
when the specified mapping doesn't exist, instead of returning
-EINVAL. At the moment, it's impossible to tell if the operation
failed because of an error or the mapping simply doesn't exist.
Worth mentioning that on Windows, we can use 32b for the exit code,
which is a bit more flexible.
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
auto reg_key = RegistryKey(
g_ceph_context, HKEY_LOCAL_MACHINE, strKey.c_str(), false);
if (!reg_key.hKey) {
- return -EINVAL;
+ if (reg_key.missingKey)
+ return -ENOENT;
+ else
+ return -EINVAL;
}
reg_key.get("devpath", cfg->devpath);