On Mon, Jun 08, 2015 at 09:32:53AM -0400, Gabriel L. Somlo wrote: > On Mon, Jun 08, 2015 at 02:33:45PM +0200, Gerd Hoffmann wrote: > > Hi, > > > > > I'm wonderingjust when exactly to start sorting items in fw_cfg ? > > > > I'd suggest to sort as entries are added, i.e. just insert the new entry > > at the correct place instead of tacking it to the end. So the list is > > always sorted. > > I was thinking that too, but since these are all arrays (not linked > lists), I'm a bit put off by the idea of having to shift everything > that's already in there by one position upon each "sorted insert". > Not to mention updating the "select" field of each FWCfgFile entry in > the directory (and maybe sorting/shifting the FWCfgFiles directory > itself) :( > > Combined with "only do this on machine versions 2.4 or later", maybe > just sorting everything during the machine_ready callback would be > less hairy ?
Unfortunately we have a bunch of code adding fw cfg entries after machine ready. > I'll be on vacation for one week, so meditating on this in the back > of my mind might help come up with something... :) > > Thanks, > --Gabriel