I suggested before that the config be split into different sections.
A) The JTAG interface
B) The Port Numbers (GDP and Telnet)
C) The Target Chip
The reason for this is that non of these is actually related in any way.
I think your idea could be used to auto configure the Target chip. This could be done by using the hex value returned to open a configuration file say call JTAG_017F09.cfg for the Xscale IXP432 chip.
The application could search for known USB JTAG Interface’s at start-up. If there is only one then a configuration file maybe is not needed.
Most people use the default port numbers so a configuration file would not be required there either.
This seems to mean that for detectable chips and interfaces a configuration file is not required.
I must get round to doing some hacking on OpenOCD some time. I had a look at the source before. I prefer to program in C++ for the PC, so I found the code a little frustrating.