[stgt] Machine readable output for tgtadm --lld [driver] --op show --mode target

Chris Webb chris at arachsys.com
Sun Jun 7 12:52:28 CEST 2009


"Dr. Volker Jaenisch" <volker.jaenisch at inqbus.de> writes:

> JSON you may easily use from within C (And some dozens of other languages).
> Please have a look at http://json.org where you will find to 5 JSON  
> libraries for C.

It is possible to parse JSON from C, but it's not anywhere near as
convenient as a simple strsep() parser would be, and the situation from
shell scripts is pretty bleak. Consequently, it wouldn't be my data format
of choice for systems work, and given a choice between the current 'human
readable' output and JSON, we'll probably just continue parsing the existing
output as it is marginally less expensive code-wise and mean we don't pull
in another unnecessary dependency.

However, as I say we'd definitely see benefit from a simpler, more regular
text format output, so if you produce an JSON-output option with an option
syntax which extends naturally to other formats, e.g. --format=json,
--format=brief, and so on, I'd be happy to write a supplementary patch
adding a 'brief text' format on top.

Best wishes,

Chris.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list