From: Simon A. F. Lund Date: Tue, 5 Jul 2016 15:08:29 +0000 (+0200) Subject: plugin-lnvm: Fixed argument parsing in lnvm_create_tgt. X-Git-Tag: v0.9~27^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=02d0ff5add2462f008dd84e47d0a7c4704b6ed56;p=users%2Fsagi%2Fnvme-cli.git plugin-lnvm: Fixed argument parsing in lnvm_create_tgt. The options lun-begin and lun-end had "no_argument" causing parsing failure, changed to "required_argument". The options lun-begin and lun-end parsed to invalid destination (cfg.tgt_type), changed to cfg.lun_begin and cfg.lun_end respectfully. --- diff --git a/lnvm-nvme.c b/lnvm-nvme.c index 2f888322..85830475 100644 --- a/lnvm-nvme.c +++ b/lnvm-nvme.c @@ -128,8 +128,8 @@ static int lnvm_create_tgt(int argc, char **argv, struct command *cmd, struct pl char *devname; char *tgtname; char *tgttype; - int lun_begin; - int lun_end; + __u32 lun_begin; + __u32 lun_end; }; struct config cfg = { @@ -144,8 +144,8 @@ static int lnvm_create_tgt(int argc, char **argv, struct command *cmd, struct pl {"device-name", 'd', "DEVICE", CFG_STRING, &cfg.devname, required_argument, devname}, {"target-name", 'n', "TARGET", CFG_STRING, &cfg.tgtname, required_argument, tgtname}, {"target-type", 't', "TARGETTYPE", CFG_STRING, &cfg.tgttype, required_argument, tgttype}, - {"lun-begin", 'b', "NUM", CFG_POSITIVE, &cfg.tgttype, no_argument, lun_begin}, - {"lun-end", 'e', "NUM", CFG_POSITIVE, &cfg.tgttype, no_argument, lun_end}, + {"lun-begin", 'b', "NUM", CFG_POSITIVE, &cfg.lun_begin, required_argument, lun_begin}, + {"lun-end", 'e', "NUM", CFG_POSITIVE, &cfg.lun_end, required_argument, lun_end}, {0} };