systemd: Be consistent and complete in excluding virtual NICs - #145
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR simplifies systemd-networkd match rules to consistently exclude all virtual NICs via Kind wildcards, updates network configuration retention semantics, and refactors the cloud-init OEM service logic for readability.
Changes:
- Replace explicit virtual-interface exclusion lists with a
Kind=!?*wildcard exclusion in.networkfiles. - Switch
KeepConfigurationfromdhcp-on-stoptodynamic-on-stopacross relevant network units. - Simplify
oem-cloudinit.serviceOEM selection logic usingcasestatements.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| systemd/system/oem-cloudinit.service | Refactors OEM detection/mapping logic in ExecCondition/ExecStart. |
| systemd/network/zz-default.network | Uses Kind wildcard exclusion for virtual NICs and updates KeepConfiguration. |
| systemd/network/yy-vmware.network | Aligns VMware network match/exclusion logic with the new Kind approach and updates KeepConfiguration. |
| systemd/network/yy-pxe.network | Aligns PXE network match/exclusion logic with the new Kind approach and updates KeepConfiguration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Only virtual NICs have a Kind, so just exclude all of them by wildcard instead of explicitly naming them. systemd.netdev(5) says there are currently 37 of them! These include the Drivers and Types we were previously excluding, apart from loopback. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
tormath1
approved these changes
Aug 27, 2026
2 tasks
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.
Only virtual NICs have a
Kind, so just exclude all of them by wildcard instead of explicitly naming them. systemd.netdev(5) says there are currently 37 of them! These include theDrivers andTypes we were previously excluding, apart fromloopback.Also replace the legacy
KeepConfiguration=dhcp-on-stopwithdynamic-on-stopand make oem-cloudinit.service a bit less ugly.Tested in CI and manually with QEMU and Proxmox.