netlink: enumerate existing interfaces at startup #468
+21
−1
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.
The netlink plugin only receives RTM_NEWLINK events for interfaces that appear after the plugin starts. Interfaces that already exist at boot (e.g., virtio-net in QEMU) never generate events, so their conditions like net/eth0/exist were never set.
Moving enumeration to PLUGIN_INIT doesn't work because it runs before cond_init(), so the condition filesystem isn't ready yet.
Fix by registering an HOOK_SVC_PLUGIN callback that queries existing interfaces and routes. This hook runs during conf_init(), after the condition system is initialized.
i recently added
ifupdown-ngto my home server and decided this would be a reasonableconditionsset:<service/syslogd/ready,net/eth0/exist>- everything worked great 👍when i made my
qemuvm tests depend on the sameifupdown-ngconfiguration they failed becausenet/eth0/existnever came up. i did a little research and then askedclaudeto help me out on this... the patch seemed reasonable, makes sense enough to me, works on my home server, and now myqemuvm tests passdoes this seem reasonable to you @troglobit?