DO-NOT-MERGE: virtualbox/cap: fix path comparison for extra disks in snapshots(#13352) #13739
+17
−1
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.
Disclaimer: This pull request is entirely generated by GitHub Copilot using the "Code with agent mode", I have no ability to understand and validate it at the moment and is only served as reference only.
When a VirtualBox VM has snapshots, the primary disk location may be under the Snapshots subdirectory, causing path comparison with other disks to fail. Update the comparison logic to also consider the parent directory of the Snapshots folder, allowing existing extra disks to be found and preventing attempts to recreate them that would result in VERR_ALREADY_EXISTS errors.
Fixes #13352
The following is the transcript that lead up to the patch(Apologies for the Chinese text, it isn't intentional):