[virt-tools-list] [libosinfo 7/8] rfc: Infer ISO language from label
Zeeshan Ali (Khattak)
zeeshanak at gnome.org
Wed Dec 5 14:23:01 UTC 2012
On Wed, Dec 5, 2012 at 4:11 PM, Daniel P. Berrange <berrange at redhat.com> wrote:
> On Tue, Dec 04, 2012 at 04:08:00PM +0200, Zeeshan Ali (Khattak) wrote:
>> On Tue, Dec 4, 2012 at 1:01 PM, Daniel P. Berrange <berrange at redhat.com> wrote:
>> > On Tue, Dec 04, 2012 at 11:47:06AM +0100, Christophe Fergeau wrote:
>> >> On Mon, Dec 03, 2012 at 06:30:18PM +0200, Zeeshan Ali (Khattak) wrote:
>> >> > I agree with you that it would be nice to avoid this mapping all
>> >> > together but if its not possible/feasible, these mappings should be in
>> >> > the XML like rest of OS specific stuff.
>> >> I could do that, but the C code would still have to match the regex with
>> >> data from the table, which is only useful to Windows anyway, so the C code
>> >> would still be somehow Windows specific.
>> > Looking at the problem more broadly, I believe we have a general need
>> > to have OS specific data maps for several installation aspects. In the
>> > OsinfoInstallConfig class we have setters for the keyboard layout,
>> > language,
>> AFAICT, we already have solution for those. It involves maps but in
>> the xml itself.
> The benefit of having t datamaps explicitly represented in the API
> is that it allows apps to determine which mappings are actually
> valid for a given OS. ie not all OS support all possible keymaps
>> > This ISO language extraction is just another example of the need for
>> > a general datamap capability IMHO, and while we only see it for Windows
>> > currently, I would not be suprised if other OS we encounter in the future
>> > need it too.
>> > I did actually start hacking up datamap support, but never finished it.
>> Not sure there is really a need to do mapping in the code for at least
>> the installers. Apart from app developers, we need to think about
>> non-C-hackers to be able to add data (including installer script
>> templates). If we put this in C, anyone wanting to add a new OS and/or
>> its installer will then be required to have to hack on libosinfo in C.
> Huh, no, that's not right. Adding a new OS in the XML will just require
> adding a new datamap in the XML too. Never touching C code. The existing
> GVirInstallSCript class will automatically identify the required datamap
> and apply the mapping to properties being passed in
Ah cool, then I misunderstood your patch/idea.
Zeeshan Ali (Khattak)
More information about the virt-tools-list