feat: virtio-net - part 1: add network backend selection#126
Merged
BinSquare merged 4 commits intosmol-machines:mainfrom Apr 14, 2026
Merged
feat: virtio-net - part 1: add network backend selection#126BinSquare merged 4 commits intosmol-machines:mainfrom
BinSquare merged 4 commits intosmol-machines:mainfrom
Conversation
phooq
commented
Apr 14, 2026
| } | ||
|
|
||
| /// User-facing explanation when an explicit virtio-net request must be rejected. | ||
| pub const fn unsupported_message(self) -> &'static str { |
Contributor
Author
There was a problem hiding this comment.
fallback logic is temporary. we are able to have feature parity between Tsi and virtio-net, as shown in the poc: #91 (comment)
Contributor
There was a problem hiding this comment.
Can we also get in a relevant end to end tests as part of this change?
Contributor
Author
There was a problem hiding this comment.
ofc. new commit on the way
Contributor
Author
There was a problem hiding this comment.
Done. add a new suite test_virtio_net.sh
CLI experience is like the following:
smolvm machine create myvirtio-net-vm --net --net-backend virtio --allow-cidr 1.1.1.1/32
Error: config operation failed: --net-backend: allow-cidr/allow-host policies are not supported by the current virtio-net implementation
Testing
==========================================
smolvm Virtio-Net Tests
==========================================
[TEST] Machine create: virtio rejected until implemented
Stopping machine 'default'...
Machine 'default' stopped
[PASS] Machine create: virtio rejected until implemented
[TEST] Machine run: virtio rejected until implemented
Stopping machine 'default'...
Machine 'default' stopped
[PASS] Machine run: virtio rejected until implemented
[TEST] Machine create: virtio + published ports rejected
Stopping machine 'default'...
Machine 'default' stopped
[PASS] Machine create: virtio + published ports rejected
[TEST] Machine create: virtio + policy rejected
Stopping machine 'default'...
Machine 'default' stopped
[PASS] Machine create: virtio + policy rejected
[TEST] Pack run: virtio rejected until implemented
[PASS] Pack run: virtio rejected until implemented
==========================================
Virtio-Net Tests Summary
==========================================
Tests run: 5
Tests passed: 5
Tests failed: 0
All tests passed!
366d655 to
97a53e9
Compare
BinSquare
reviewed
Apr 14, 2026
| } | ||
| } | ||
|
|
||
| run_test "Machine create: virtio rejected until implemented" test_machine_create_virtio_rejected_until_implemented || true |
Contributor
There was a problem hiding this comment.
small nit: we should let these fail since they're not implemented yet as a way to keep track of it.
but not a blocker
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.
add an new cli arg
--net-backendto allow choosing between virtio-net and tsi. default is tsiTesting