Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: