HomeFreeBSD

vdev_id: Add error message when $CONFIG is missing

Description

vdev_id: Add error message when $CONFIG is missing

It was observed that vdev_id exists silently when
the $CONFIG file is missing.

This patch adds error message in case vdev_id is
called without default $CONFIG or '-c'. This makes
end user observe the exit message more easily.

Before Patch:
~~~~~~~~~~~~~
$ ./cmd/vdev_id/vdev_id
$

After Patch:
~~~~~~~~~~~~
$ ./cmd/vdev_id/vdev_id
Error: Config file "/etc/zfs/vdev_id.conf" not found
$

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Closes #11498

Details

Provenance
Arshad Hussain <arshad.super@gmail.com>Authored on Jan 23 2021, 11:52 PM
GitHub <noreply@github.com>Committed on Jan 23 2021, 11:52 PM
Parents
rG4a90d4d6fccf: Fix two minor lint errors (cppcheck)
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGe2870fb24aff: vdev_id: Add error message when $CONFIG is missing (authored by Arshad Hussain <arshad.super@gmail.com>).Jan 23 2021, 11:52 PM