This PR is mainly focused on cleaner/more informative logging, keeping information grouped with the section/file it belongs with.
The PR also endeavours to make better use of constants and macros, and use a consistent convention around char array lengths. There's also some light whitespace cleanup and fixing of a few typos.
The largest functional change in the PR is the change from finalizeFileLog to finalizeDevices. This function now contains the call to readSCSIDeviceConfig in the case that two files are defined with the same ID, so that it is only called once, and the function now also outputs the filename that is being served for the ID to make absolutely clear on what IDs the drive image should be appearing.
This PR doesn't make any changes to anything that runs in the loop, so hopefully there will not be any performance impacts, although some of the discussion in #118 leads me to worry that even changes outside the loop could have performance impacts.
(I also see that PR #261 just came in, I'm happy to rebase if that PR is merged)
Here's an example of the new log output, including the case where two files with the same ID are seen, to show that the "devices table" indicates that the last ID detected is the one used:
This PR is mainly focused on cleaner/more informative logging, keeping information grouped with the section/file it belongs with.
The PR also endeavours to make better use of constants and macros, and use a consistent convention around char array lengths. There's also some light whitespace cleanup and fixing of a few typos.
The largest functional change in the PR is the change from
finalizeFileLog
tofinalizeDevices
. This function now contains the call toreadSCSIDeviceConfig
in the case that two files are defined with the same ID, so that it is only called once, and the function now also outputs the filename that is being served for the ID to make absolutely clear on what IDs the drive image should be appearing.This PR doesn't make any changes to anything that runs in the loop, so hopefully there will not be any performance impacts, although some of the discussion in #118 leads me to worry that even changes outside the loop could have performance impacts.
(I also see that PR #261 just came in, I'm happy to rebase if that PR is merged)
Here's an example of the new log output, including the case where two files with the same ID are seen, to show that the "devices table" indicates that the last ID detected is the one used: