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

Dan Kenigsberg danken at redhat.com
Fri May 1 03:04:42 PDT 2015


On Mon, Apr 20, 2015 at 08:43:21PM +0200, Lennart Poettering wrote:
> 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.

Could you explain why? Is it because we are not sure if "our" events
have not been queued when "settle" is called, or something more dramatic
that should be documented in udevadm(1)?

> 
> 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
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list