If a user executed the following command "fcoeadm -i ethX" when ethX is not
currently created as an fcoe device the following message will be returned:
# fcoeadm -i eth2
fcoeadm: No fc_host found for eth2
fcoeadm: Invalid command options!
Usage: fcoeadm
[-c|--create] <ethX>
[-d|--destroy] <ethX>
[-r|--reset] <ethX>
[-i|--interface] [<ethX>]
[-t|--target] [<ethX>]
[-l|--lun] [<target port_id> [<lun_id>]]
[-s|--stats] <ethX> [-n <interval>]
[-h|--help]
The user may be confused by the inclusion of the text "invalid command
options!".
If the output is "No fc_host found for eth2". It is sufficient and would
not confuse a user.
Signed-off-by: Steve Ma <[email protected]>
---
fcoeadm.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fcoeadm.c b/fcoeadm.c
index e38064d..170b0f8 100644
--- a/fcoeadm.c
+++ b/fcoeadm.c
@@ -293,8 +293,7 @@ static int
fcoeadm_validate_interface(char *ifname, char *fchost, int len)
{
if (!fcoeadm_find_fchost(ifname, fchost, len)) {
- fprintf(stderr, "%s: No fc_host found for %s\n",
- progname, ifname);
+ fprintf(stderr, "No fc_host found for %s\n", ifname);
return -EINVAL;
}
@@ -494,7 +493,7 @@ int main(int argc, char *argv[])
if (fcoeadm_validate_interface(
opt_info->ifname,
fchost, FCHOSTBUFLEN))
- goto error;
+ goto done;
}
opt_info->a_flag = 1;
rc = fcoeadm_display_adapter_info(opt_info);
@@ -524,7 +523,7 @@ int main(int argc, char *argv[])
if (fcoeadm_validate_interface(
opt_info->ifname,
fchost, FCHOSTBUFLEN))
- goto error;
+ goto done;
}
opt_info->t_flag = 1;
rc = fcoeadm_display_target_info(opt_info);
@@ -555,7 +554,7 @@ int main(int argc, char *argv[])
if (fcoeadm_validate_interface(
opt_info->ifname,
fchost, FCHOSTBUFLEN))
- goto error;
+ goto done;
}
opt_info->s_flag = 1;
if (argv[optind] && !strncmp(argv[optind], "-n", 2))
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel