Re: device removal signals does not work for me



Hi Jirka,

thank you very much for the description and the fix. is it possible to fix this in the 0.8 branch, too?

Cheers,

Tom

On 24/11/11 17:57, Jirka Klimes wrote:
On Wednesday 23 of November 2011 07:33:07 Thomas Bechtold wrote:
Hi Dan,

any other idea why the example code does not work?



I've look into the problem. It showed up that it is really libnm-glib problem.

DeviceAdded and DeviceRemoved signals are seen in dbus-monitor output. And
they are also delivered to libnm-glib.

However, what was the problem is that NMClient/NMDevice in libnm-glib use lazy
approach and get data from NM over D-Bus only after they are asked for them
(or get them via signals). This is nice in general. However, in case of device
removal, libnm-glib tries to get devices from NM only after receiving
DeviceRemoved signal. But at this point the device is not in NM any more, so
no info is available about it (apart object path received as DeviceRemoved
signal argument).

So, when device is added *before* NMClient runs, NMClient won't have any info
about that. When the device is added *while* NMClient is already running,
libnm-glib will request devices upon DeviceAadded signal and thus the data
will be available later upon DeviceRemoved signal.

I pushed fixes to libnm-glib to correct the behaviour. Now, the device data
are obtained from NM in constructor.
42060fdd897749c79fcc60ac16bb6fa67e4c8fd3
576acdd2bf4cfde11f9b8ea15ec87bb7271c5502

I hope the explanation is understandable.

Jirka

PS:
Dan, one question for you:
NM's NMDevice has ip4-address property, which is not in libnm-glib. So I have
to use a little hack (removing the propery from GetAll()'s reply), so that
NMObject doesn't print errors.
Do you think we should remove "ip4-address" from NM's NMDevice? In my opinion,
"ip4-config" is sufficient and "ip4-address" is redundant now.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]