[stgt] Machine readable output for tgtadm --lld [driver] --op show --mode target
Dr. Volker Jaenisch
volker.jaenisch at inqbus.de
Sun Jun 7 13:05:09 CEST 2009
Hi Chris!
Chris Webb schrieb:
>> 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.
>
I understand this.
> 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.
>
Is I stated before there should be the possibility to add some other
output views. If they are JSON or whatever format somebody likes.
The main work I do at the moment is not the reformating of the textual
output but doing some restructuring of the data model
to implement a bit more model-view-controler style.
If the data model is cleanly defined it is a simple task of writing one
C-subroutine to implement an status output of any flavour
somebody likes.
But I hoped to get a bit of support from the original developers since
they know best how to modify there data model to achieve this goal.
Please support me with the desired output for your case and I will
implement a corresponding output view for you.
Best Regards,
Volker
--
====================================================
inqbus it-consulting +49 ( 341 ) 5643800
Dr. Volker Jaenisch http://www.inqbus.de
Herloßsohnstr. 12 0 4 1 5 5 Leipzig
N O T - F Ä L L E +49 ( 170 ) 3113748
====================================================
--
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