feat(vmm): add optional libvirt network filtering - #837
Open
kvinwang wants to merge 8 commits into
Open
Conversation
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.
Summary
cvm.network_filter.mode = "libvirt"backend for bridge NICs; the defaultnonemode preserves the existing unfiltered QEMU bridge-helper pathdstack-vmm; libvirt is used only for standalone nwfilter bindingsdstack-vmm netdbroker that creates deterministic TAPs, attaches them to the requested bridge, and creates/removes libvirt nwfilter bindings before/after QEMUSO_PEERCRED, bound protocol messages and fields, derive TAP names server-side, generate/escape binding XML internally, use fixed absolute host tools, and serialize operations across netd processes[netd], so it can use a small standalone root-owned configuration and does not initialize QEMU/VMM services--socket,--allow-uid, and--netd-socketThis implementation starts from
masterand does not depend on or reuse the implementation in #835/#836. Those PRs remain available only as historical reference.Configuration
When mode is
none, dstack does not connect to netd and continues to emit:When mode is
libvirt, netd finishes the binding before dstack submits QEMU, which receives:Verification
cargo test -p dstack-vmm— 60 passedcargo clippy -p dstack-vmm --all-targets -- -D warningscargo fmt --manifest-path vmm/Cargo.toml -- --checkgit diff --check origin/master...HEADqemu:///systemlibvirt:dstack-vmm netdclean-trafficand staticIPparametervirsh nwfilter-binding-dumpxml[netd]config and a non-root client authorized by UID