Rewire VM SSH in preparation for clean-cut VSOCK surgery#4807
Draft
Rewire VM SSH in preparation for clean-cut VSOCK surgery#4807
Conversation
Rather than relying on the mount's d'tor.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4807 +/- ##
==========================================
- Coverage 87.54% 87.54% -0.00%
==========================================
Files 258 258
Lines 14152 14150 -2
==========================================
- Hits 12388 12386 -2
Misses 1764 1764 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Introduce SSHProcess as a pure virtual interface and rename the existing implementation to PlainSSHProcess. This enables mocking of SSH processes in tests, preparing the ground for migrating callers away from direct SSHSession construction.
Add `ssh_exec_process` as a peer to `ssh_exec` in VMs, returning an `SSHProcess` handle rather than collecting output.
Replace dedicated `SSHSessions` with the new `ssh_exec_process` in mounts.
Change ssh_session to unique_ptr, in preparation for mockable interface.
Introduce SSHSession as a pure virtual interface and rename the existing implementation to PlainSSHSession. This enables mocking of SSH sessions in tests, taking another step toward moving callers away from direct SSHSession construction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Rewire SSH to have consistent and minimal interface within VMs, providing for a clean replacement of the transport protocol underneath. This refactor cleans up the SSH infrastructure so that VSOCK can land cleanly.
Problems addressed (WIP):
ssh_hostname(timeout)mixes IP lookup with retry logic (QEMU loops infetch_ipviatry_action_for);SSHSession{vm->ssh_hostname(), vm->ssh_port(), vm->ssh_username(), key_provider}ssh_hostname()with 2-min default onVirtualMachineshouldn't exist at thatlevel
ssh_execalready exists on VirtualMachine but is underusedMULTI-2524
Testing
Unit tests
Manual testing steps:
Checklist