Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug in CD-ROM device removal logic that could cause "IDE slave with no master" errors in VMware virtual machines. The fix changes the removal order from removing the first n CD-ROMs to removing the last n CD-ROMs, thereby preserving lower-numbered device slots which is essential for IDE controller compatibility.
Key Changes:
- Modified slice operation in
RemoveNCdromsto remove CD-ROMs from the end of the device list instead of the beginning - Added inline comment explaining the deterministic removal order
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4f4c342 to
30bee5d
Compare
When `RemoveNCdroms` is called, the function now removes the highest-numbered CD-ROM devices instead of the lowest-numbered ones. This prevents a "IDE slave with no master" error that occurs when lower-numbered IDE slots are empty while higher-numbered slots are occupied (e.g., having a device at IDE 0:1 with no device at IDE 0:0). Signed-off-by: Ryan Johnson <rya@tenthirtyam.org>
30bee5d to
f276754
Compare
|
I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
Updates the logic for removing CD-ROM devices from a virtual machine to ensure a deterministic order of removal. Instead of removing the first
nCD-ROMs, the code now removes the lastnCD-ROMs, which can help avoid unexpected changes in device ordering. This prevents a "IDE slave with no master" error that occurs when lower-numbered IDE slots are empty while higher-numbered slots are occupied (e.g., having a device at IDE 0:1 with no device at IDE 0:0).Resolved Issues
Closes #516
Rollback Plan
Revert commit.
Changes to Security Controls
None.