|
Hey guys,
I was poking around in NLBConfig some more and
noticed that the TOP
command causes command_vals['TOP'] to be set, but in fact that value is never used - everyone uses the treetop variable. So it seems the TOP command does nothing and is broken. Probably no one was using it, or perhaps used it but always were in the TOP directory anyway, so didn't notice a problem. Would you like me to fix this, or remove the TOP
command, or do nothing?
I also noticed a typo in the pcibridge command -
there are references
to "picbridge". I also see there is a src/pcibridge/TI/pci1225 directory. So I'm wondering why no one noticed a problem. The TOP bug appears to have happened because there
were two global
variables, namely command_vals['TOP'] and treetop, storing (what should have been) the same data. In general, duplicating data like that is a bad idea because of the potential for the variables to get out of sync and cause bugs. Another problem is that there are many entries in
command_vals that
are being set but never used, for example command_vals['northbridge']. I don't think this is causing bugs, but it does make it harder to read, understand and maintain NLBConfig, because when you see command_vals['northbridge'] = ... you may be inclined to look around and try to figure out why the variable is being set. It looks like there are only about three entries in
command_vals that
are set and then actually used later on. I would like to eliminate command_vals entirely,
and replace it with
about three global variables (or maybe classes, such as I did with mkrule). Trust me, it will make the code easier to understand and maintain :-). If I make these changes, would Ron or Eric be willing to check it in? I'm also pulling in some of the documentation from
the Documentation
directory and adding it as comments to various commands, and generally documenting the code a lot more. Please let me know if you'd like these
changes.
Cheers,
- Jan |
- Re: TOP command bug, more NLBConfig changes Jan Kok
- Re: TOP command bug, more NLBConfig changes Ronald G Minnich
