(sorry for the delay, I was out Friday and Monday)
On 10/04/2013 12:27 PM, Boaz Harrosh wrote:
On 10/03/2013 06:50 PM, Dan Mick wrote:
I was thinking only one value, and I know it can't include comma (the
way tgtadm sends options), but otherwise it's freeform. (Actually there
might be other illegal chars; I should find out and specify.)
I was thinking of using it like "-o value --longopt=value" etc., but, as
it's freeform, backends can do whatever they like.
Or we could provide some more mechanism, but I figured since I'm the one
who wants it, I might be the only one who ever does.
I have two values that I need now if you do --longopt=value then it will
need to be for me something like:
--longopt=name1:value1;name2:value2
Where ":" separates between the name and value. And ";" separates between
pairs.
(Again what I have now is all ontop of --backing-store)
My initial effort was not to provide any generic parsing at all, and let
the backends implement whatever's most convenient; if y'all think
generic parsing is useful, there's no reason not to legislate it,
I suppose. The iscsi parsing is pretty roll-your-own.
[BTW: "--bstype=VALUE" but "--backing-store VALUE" without the "=", so you
can go either way]
Yeah, tgtadm uses getopt_long which allows either '=' or ' '.
If you have the one value then do it like that. Just specify somewhere
what are the illegal chars like you said ",".
BTW: I do not think the coma parsing in tgt will interfere here because
it will be a different case I think. (Haven't look at that code for so
long)
tgtadm passes the options to tgtd after validation, and it passes them
as one big key1=val1,key2=val2,.. string (in the 'buf' following the
header), and provides no facility for quoting ','. So I think the
bsopts definition should steer clear of ',' separators.
Thanks
Boaz
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html