Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculates true parent's relative path in Differencing VHD locator #5153

Merged
merged 4 commits into from
Aug 9, 2024

Conversation

maxpat78
Copy link
Contributor

@maxpat78 maxpat78 commented Aug 4, 2024

This patch is tested both in Windows 11 and Linux (Ubuntu, WSL). It refines the Differencing VHD handler in following ways:

  • always tries to handle an absolute W2ku locator;
  • more log messages to debug;
  • 2nd locator offset is relative to 1st, a fixed position is no more assumed;
  • calculates and stores the true parent's relative path in W2ru locator (parent's path has to be relative to child's path, not current working directory).

As a consequence, VHD sets created in Windows can be shared with Linux users and vice-versa (due to correct relative locator).

NOTE FOR THE WILLING PROGRAMMER: a -relink switch could be added to VHDMAKE allowing to move a parent VHD and manually relink its childs.

Closes #5145

locator's relative path must be relative to child VHD image, not current directory!
@maxpat78
Copy link
Contributor Author

maxpat78 commented Aug 4, 2024

Test for Linux user:

  • prepare a subdir and a subdir/subsubdir testing dirs in working directory;
  • run following batch file in DosBox-X shell:
imgmake subdir/parent.vhd -t vhd -size 100 -force
vhdmake -f -l subdir/parent.vhd subdir/subsubdir/child.vhd 
imgmount d subdir/subsubdir/child.vhd
imgmount -u d

.gitignore Outdated
@@ -140,3 +140,7 @@ contrib/macos/dosbox-x.plist
/dosbox-x.conf
/src/dosbox-x.conf

src/dos/dos_programs.7z
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to ignore these files?
There are no such file in the current code tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you don't. In fact those files came by mistake from another code tree of mine, but they hadn't to.

fixes a couple corner cases, where files are in different disks or in the same directory
@maxpat78 maxpat78 changed the title Calculates true paent's relative path in Differencing VHD locator Calculates true parent's relative path in Differencing VHD locator Aug 8, 2024
@joncampbell123 joncampbell123 merged commit e2c991b into joncampbell123:master Aug 9, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linked VHDs in subfolders doesn't work
3 participants