Refactor out NFS-related code from save_restore.c #74
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 pull request is a first attempt at cleaning up some of the code in save_restore.c. It seems much more logical that save_restore is aware of reading and writing files, not specifically how and when to mount or unmount an NFS share.
Note that this PR does contain a breaking change: previously it was possible to have the following two lines in any order in a startup script:
The way this behaved was that if you set the savefile path first, it stored it in memory and then would mount the host:port combination at that specified mountpoint (foo/bar in this case), as no mount point was specified.
If you reversed the order:
then running
set_savefile_path
would actually mount host:port at the mountpoint foo/bar. This resulted in (IMO) needlessly complicated and confusing code, which is much simplified by enforcing that a mountpoint is specified before attempting to mount; after this change this can be done either by runningset_savefile_path
first, or by specifying the mount point as the third argument tosave_restoreSet_NFSHost
.