machine_virtual: bind multicast to localhost #3717
Merged
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.
When using socket-based network devices, with the
mcast
option (butwithout an explicitly specified local address), qemu attempts to find a
suitable interface to use by scanning the available "up" interfaces for
ones that have the MULTICAST flag enabled (as per
ip link
).The loopback interface doesn't normally have this flag enabled, so if
it's the only one that's up, the search will fail, causing the following
message:
If we force qemu to use the loopback interface, however, it will
succeed — even without the multicast flag being set. Since we're not
actually interested in communicating between machines, force
127.0.0.1 as the local address.
This allows
image-customize
,vm-run
, and testing in general to workwithout the presence of any network connection, and without hacks such
as adding a dummy bridge or veth device.
Fixes cockpit-project/cockpit#12782