[systemd-devel] udev interface naming for SR-IOV VFs

Lennart Poettering lennart at poettering.net
Mon Apr 20 11:43:21 PDT 2015


On Fri, 17.04.15 14:19, Nir Soffer (nirsof at gmail.com) wrote:

> - You may wait for unrelated events that happen to trigger in the same
>   time, waiting after the new interfaces are ready.
> 
> I think you need something like:
> 
>     while True:
>         try:
>             udevadm.settle(1)
>         except udevadm.Timeout:
>             pass
>         else:
>             if all devices are ready:
>                 break
>             time.sleep(1)

Please never use udevadm settle in new code.

Please instead subscribe to libudev events about network interfaces
and don't take rtnl messages into account until the device has been
reported via udev, too.

THis is for example what networkd does to make sure it doesn't start
making use of network interfaces that didn't get fully set up yet by
the udev rules.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list