Re: [systemd-devel] [PATCH 2/2] udev: Allow detection of udevadm settle timeout

2015-05-02 Thread Nir Soffer
On Tue, Apr 21, 2015 at 12:41 AM, Tom Gundersen wrote: > On Mon, Apr 13, 2015 at 3:04 PM, Nir Soffer wrote: >> On Sat, Apr 11, 2015 at 6:58 PM, David Herrmann >> wrote: >>>> A program running this tool can detect a timeout (expected) or an error >>>> (

[systemd-devel] [PATCH v3 1/2] udev: settle should return immediately when timeout is 0

2015-04-18 Thread Nir Soffer
udevadm manual says: A value of 0 will check if the queue is empty and always return immediately. However, currently we ignore the deadline if the value is 0, and wait without any limit. Zero timeout behaved according to the documentation until commit ead7c62ab7 (udevadm: settle - kill a

[systemd-devel] [PATCH v3 2/2] udev: Skip ping if timeout is 0

2015-04-18 Thread Nir Soffer
When running udevadm settle --timeout=0, udev_ctrl_send_ping always times out, and settle returns 0 without checking the queue. Now we skip ping in this case, and return the queue state. --- src/udev/udevadm-settle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udev/ude

[systemd-devel] [PATCH] udev: Fix ping timeout when settle timeout is 0

2015-04-18 Thread Nir Soffer
When running udevadm settle --timeout=0, the ping always times out, and udevadm will return 0 without checking the queue state. Since zero timeout is considered as unlimited timeout, we use now unlimited ping timeout. --- src/udev/udevadm-settle.c | 4 +++- 1 file changed, 3 insertions(+), 1 dele

[systemd-devel] [PATCH v2] udev: Allow detection of udevadm settle timeout

2015-04-18 Thread Nir Soffer
When udevadm settle times out, it exits with exit code 1. This make it impossible for users to detect a timeout and handle real errors. Now we use exit code 3 on timeouts. --- src/udev/udevadm-settle.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/udev/udevadm-settl

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

2015-04-17 Thread Nir Soffer
On Tue, Apr 14, 2015 at 1:11 PM, Ido Barkan wrote: > We are implementing support for SR-IOV network cards. Afer the changing of > the number of VFs on the card and programmatically querying for all links > (we use libnl for this) we observe that *during the iteration* over the links > some of them

Re: [systemd-devel] [PATCH 2/2] udev: Allow detection of udevadm settle timeout

2015-04-13 Thread Nir Soffer
On Sat, Apr 11, 2015 at 6:58 PM, David Herrmann wrote: >> A program running this tool can detect a timeout (expected) or an error >> (unexpected), and can change the program flow based on this result. >> >> Without this, the only way to detect a timeout is to implement the timeout >> in the progra

[systemd-devel] [PATCH v2] udev: settle should return immediately when timeout is 0

2015-04-12 Thread Nir Soffer
udevadm manual says: A value of 0 will check if the queue is empty and always return immediately. However, currently we ignore the deadline if the value is 0, and wait without any limit. Zero timeout behaved according to the documentation until commit ead7c62ab7 (udevadm: settle - kill a

[systemd-devel] [PATCH v2] udev: settle should return immediately when timeout is 0

2015-04-12 Thread Nir Soffer
udevadm manual says: A value of 0 will check if the queue is empty and always return immediately. However, currently we ignore the deadline if the value is 0, and wait without any limit. Zero timeout behaved according to the documentation until commit ead7c62ab7 (udevadm: settle - kill a

[systemd-devel] [PATCH] udev: settle should return immediately when timeout is 0

2015-04-11 Thread Nir Soffer
udevadm manual says: A value of 0 will check if the queue is empty and always return immediately. However, currently we ignore the deadline if the value is 0, and wait without any limit. Zero timeout behaved according to the documentation until commit ead7c62ab7 (udevadm: settle - kill a

Re: [systemd-devel] [PATCH] udev: Restore udevadm settle timeout

2015-04-11 Thread Nir Soffer
On Sat, Apr 11, 2015 at 1:36 PM, David Herrmann wrote: > > @@ -139,6 +142,9 @@ static int adm_settle(struct udev *udev, int argc, char > > *argv[]) { > > break; > > } > > > > +if (now(CLOCK_MONOTONIC) >= deadline) > > +

[systemd-devel] [PATCH 2/2] udev: Allow detection of udevadm settle timeout

2015-04-08 Thread Nir Soffer
When udevadm settle times out, it exits with exit code 1. This make it impossible for users to detect a timeout and handle real errors. Now we use exit code 3 on timeouts. --- src/udev/udevadm-settle.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/udev/udevadm-settl

[systemd-devel] [PATCH] udev: Restore udevadm settle timeout

2015-04-07 Thread Nir Soffer
Commit 9ea28c55a2 (udev: remove seqnum API and all assumptions about seqnums) introduced a regresion, ignoring the timeout option when waiting until the event queue is empty. Previously, if the udev event queue was not empty when the timeout was expired, udevadm settle was returning with exit code