<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/src/nm-dbus-utils.h, branch th/fix-python-test</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>all: SPDX header conversion</title>
<updated>2019-09-10T09:19:56+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2019-09-10T09:19:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=24028a22467275671df71cc6a8054036b37d8f03'/>
<id>24028a22467275671df71cc6a8054036b37d8f03</id>
<content type='text'>
  $ find * -type f |xargs perl contrib/scripts/spdx.pl
  $ git rm contrib/scripts/spdx.pl
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  $ find * -type f |xargs perl contrib/scripts/spdx.pl
  $ git rm contrib/scripts/spdx.pl
</pre>
</div>
</content>
</entry>
<entry>
<title>all: drop emacs file variables from source files</title>
<updated>2019-06-11T08:04:00+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-06-02T12:32:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=c0e075c90263150bd00ea033dbbd2d8e6b05300e'/>
<id>c0e075c90263150bd00ea033dbbd2d8e6b05300e</id>
<content type='text'>
We no longer add these. If you use Emacs, configure it yourself.

Also, due to our "smart-tab" usage the editor anyway does a subpar
job handling our tabs. However, on the upside every user can choose
whatever tab-width he/she prefers. If "smart-tabs" are used properly
(like we do), every tab-width will work.

No manual changes, just ran commands:

    F=($(git grep -l -e '-\*-'))
    sed '1 { /\/\* *-\*-  *[mM]ode.*\*\/$/d }'     -i "${F[@]}"
    sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}"

Check remaining lines with:

    git grep -e '-\*-'

The ultimate purpose of this is to cleanup our files and eventually use
SPDX license identifiers. For that, first get rid of the boilerplate lines.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We no longer add these. If you use Emacs, configure it yourself.

Also, due to our "smart-tab" usage the editor anyway does a subpar
job handling our tabs. However, on the upside every user can choose
whatever tab-width he/she prefers. If "smart-tabs" are used properly
(like we do), every tab-width will work.

No manual changes, just ran commands:

    F=($(git grep -l -e '-\*-'))
    sed '1 { /\/\* *-\*-  *[mM]ode.*\*\/$/d }'     -i "${F[@]}"
    sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}"

Check remaining lines with:

    git grep -e '-\*-'

The ultimate purpose of this is to cleanup our files and eventually use
SPDX license identifiers. For that, first get rid of the boilerplate lines.
</pre>
</div>
</content>
</entry>
<entry>
<title>core/dbus: stop NMDBusManager and reject future method calls</title>
<updated>2018-04-24T08:25:26+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-04-21T11:25:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=3d2da8cd053034995dc580a1d65fb0b015039048'/>
<id>3d2da8cd053034995dc580a1d65fb0b015039048</id>
<content type='text'>
During shutdown, we will need to still iterate the main loop
to do a coordinated shutdown. Currently we do not, and we just
exit, leaving a lot of objects hanging.

If we are going to fix that, we need during shutdown tell
NMDBusManager to reject all future operations.

Note that property getters and "GetManagerObjects" call is not
blocked. It continues to work.

Certainly for some operations, we want to allow them to be called even
during shutdown. However, these have to opt-in.

This also fixes an uglyness, where nm_dbus_manager_start() would
get the set-property-handler and the @manager as user-data. However,
NMDBusManager will always outlife NMManager, hence, after NMManager
is destroyed, the user-data would be a dangling pointer. Currently
that is not an issue, because
  - we always leak NMManager
  - we don't run the mainloop during shutdown
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During shutdown, we will need to still iterate the main loop
to do a coordinated shutdown. Currently we do not, and we just
exit, leaving a lot of objects hanging.

If we are going to fix that, we need during shutdown tell
NMDBusManager to reject all future operations.

Note that property getters and "GetManagerObjects" call is not
blocked. It continues to work.

Certainly for some operations, we want to allow them to be called even
during shutdown. However, these have to opt-in.

This also fixes an uglyness, where nm_dbus_manager_start() would
get the set-property-handler and the @manager as user-data. However,
NMDBusManager will always outlife NMManager, hence, after NMManager
is destroyed, the user-data would be a dangling pointer. Currently
that is not an issue, because
  - we always leak NMManager
  - we don't run the mainloop during shutdown
</pre>
</div>
</content>
</entry>
<entry>
<title>core: add NMDBusTrackObjPath helper</title>
<updated>2018-04-13T07:09:46+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-04-03T14:37:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=86229a669bc3c51faf19f15c6a382c20f849b78e'/>
<id>86229a669bc3c51faf19f15c6a382c20f849b78e</id>
<content type='text'>
When one D-Bus object exposes (the path of) another D-Bus object,
we want that the path property gets cleared before the other
object gets unexported(). That essentially requires to register
to the "exported-changed" signal.

Add a helper struct NMDBusTrackObjPath to help with this.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When one D-Bus object exposes (the path of) another D-Bus object,
we want that the path property gets cleared before the other
object gets unexported(). That essentially requires to register
to the "exported-changed" signal.

Add a helper struct NMDBusTrackObjPath to help with this.
</pre>
</div>
</content>
</entry>
<entry>
<title>core: convert NMDBusObject's "path" property to signal "exported-changed"</title>
<updated>2018-04-13T07:09:46+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-03-29T17:27:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=cd71ec3084d972ab70aa6229fd4752317106d281'/>
<id>cd71ec3084d972ab70aa6229fd4752317106d281</id>
<content type='text'>
The GObject property "path" exists for the sole reasons so that
other components can connect to the "notify::path" signal.

However, notifications are blocked by g_object_freeze_notify(),
and especially for NMDBusObject we want to make use of that to
combine multiple PropertiesChanged events into one.

This blocking of the signal is not desired for the case where
we wait for "notify::path". Convert that to a signal, which
will not be blocked.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The GObject property "path" exists for the sole reasons so that
other components can connect to the "notify::path" signal.

However, notifications are blocked by g_object_freeze_notify(),
and especially for NMDBusObject we want to make use of that to
combine multiple PropertiesChanged events into one.

This blocking of the signal is not desired for the case where
we wait for "notify::path". Convert that to a signal, which
will not be blocked.
</pre>
</div>
</content>
</entry>
<entry>
<title>shared: add nm_dbus_utils_get_paths_for_clist() util</title>
<updated>2018-04-13T07:09:46+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-03-30T18:10:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=76df7a3088ba44817bef601465b891f364ef3aec'/>
<id>76df7a3088ba44817bef601465b891f364ef3aec</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>core: drop unused nm_dbus_utils_g_value_set_object_path_array() function</title>
<updated>2018-04-04T12:02:13+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-03-29T06:19:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=a399e2b8ffc10510023c0e4671f18d6554d899e0'/>
<id>a399e2b8ffc10510023c0e4671f18d6554d899e0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>core: add nm_dbus_utils_g_value_set_object_path_from_hash() helper</title>
<updated>2018-04-04T12:02:13+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-03-29T09:04:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=b0f02075deb02d91361bdd53c31469b3b2b98618'/>
<id>b0f02075deb02d91361bdd53c31469b3b2b98618</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>core/dbus: cache variants for D-Bus exported properties</title>
<updated>2018-03-26T17:35:26+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-03-23T19:06:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=640736ff65059bbe29ae7fa273015d849c78092a'/>
<id>640736ff65059bbe29ae7fa273015d849c78092a</id>
<content type='text'>
GVariant is immutable and can nicely be shared and cached.
Cache the property variants. This makes getting the properties
faster, at the expense of using some extra memory.

Tested with https://tratt.net/laurie/src/multitime/

  $ multitime -n 200 -s 0 bash -c 'echo -n .; exec busctl call org.freedesktop.NetworkManager /org/freedesktop org.freedesktop.DBus.ObjectManager GetManagedObjects &amp;&gt;/dev/null'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.013+/-0.0000      0.001       0.012       0.013       0.019
  # real(after)         0.013+/-0.0000      0.002       0.011       0.012       0.034

  $ multitime -n 100 -s 0 bash -c 'for i in {1..5}; do busctl call org.freedesktop.NetworkManager /org/freedesktop org.freedesktop.DBus.ObjectManager GetManagedObjects &amp;&gt;/dev/null &amp; done; wait; echo -n .'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.040+/-0.0000      0.002       0.037       0.040       0.049
  # real(after)         0.037+/-0.0000      0.002       0.034       0.036       0.045

  $ multitime -n 30 -s 0 bash -c 'for i in {1..100}; do busctl call org.freedesktop.NetworkManager /org/freedesktop org.freedesktop.DBus.ObjectManager GetManagedObjects &amp;&gt;/dev/null &amp; done; wait; echo -n .'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.704+/-0.0000      0.016       0.687       0.701       0.766
  # real(after)         0.639+/-0.0000      0.013       0.622       0.637       0.687

  $ multitime -n 200 -s 0 bash -c 'echo -n .; exec nmcli &amp;&gt;/dev/null'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.092+/-0.0000      0.005       0.081       0.092       0.119
  # real(after)         0.092+/-0.0000      0.005       0.080       0.091       0.123

  $ multitime -n 100 -s 0 bash -c 'for i in {1..5}; do nmcli &amp;&gt;/dev/null &amp; done; wait; echo -n .'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.436+/-0.0000      0.043       0.375       0.424       0.600
  # real(after)         0.413+/-0.0000      0.022       0.380       0.410       0.558

  $ multitime -n 20 -s 0 bash -c 'for i in {1..100}; do nmcli &amp;&gt;/dev/null &amp; done; wait; echo -n .'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        8.796+/-0.1070      0.291       8.073       8.818       9.247
  # real(after)         8.736+/-0.0893      0.243       8.017       8.780       9.101

The time savings are small, but that is because caching mostly speeds up
the GetManagedObjects calls, and that is only a small part of the entire
nmcli call from client side.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GVariant is immutable and can nicely be shared and cached.
Cache the property variants. This makes getting the properties
faster, at the expense of using some extra memory.

Tested with https://tratt.net/laurie/src/multitime/

  $ multitime -n 200 -s 0 bash -c 'echo -n .; exec busctl call org.freedesktop.NetworkManager /org/freedesktop org.freedesktop.DBus.ObjectManager GetManagedObjects &amp;&gt;/dev/null'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.013+/-0.0000      0.001       0.012       0.013       0.019
  # real(after)         0.013+/-0.0000      0.002       0.011       0.012       0.034

  $ multitime -n 100 -s 0 bash -c 'for i in {1..5}; do busctl call org.freedesktop.NetworkManager /org/freedesktop org.freedesktop.DBus.ObjectManager GetManagedObjects &amp;&gt;/dev/null &amp; done; wait; echo -n .'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.040+/-0.0000      0.002       0.037       0.040       0.049
  # real(after)         0.037+/-0.0000      0.002       0.034       0.036       0.045

  $ multitime -n 30 -s 0 bash -c 'for i in {1..100}; do busctl call org.freedesktop.NetworkManager /org/freedesktop org.freedesktop.DBus.ObjectManager GetManagedObjects &amp;&gt;/dev/null &amp; done; wait; echo -n .'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.704+/-0.0000      0.016       0.687       0.701       0.766
  # real(after)         0.639+/-0.0000      0.013       0.622       0.637       0.687

  $ multitime -n 200 -s 0 bash -c 'echo -n .; exec nmcli &amp;&gt;/dev/null'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.092+/-0.0000      0.005       0.081       0.092       0.119
  # real(after)         0.092+/-0.0000      0.005       0.080       0.091       0.123

  $ multitime -n 100 -s 0 bash -c 'for i in {1..5}; do nmcli &amp;&gt;/dev/null &amp; done; wait; echo -n .'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        0.436+/-0.0000      0.043       0.375       0.424       0.600
  # real(after)         0.413+/-0.0000      0.022       0.380       0.410       0.558

  $ multitime -n 20 -s 0 bash -c 'for i in {1..100}; do nmcli &amp;&gt;/dev/null &amp; done; wait; echo -n .'
  #                     Mean                Std.Dev.    Min         Median      Max
  # real(before)        8.796+/-0.1070      0.291       8.073       8.818       9.247
  # real(after)         8.736+/-0.0893      0.243       8.017       8.780       9.101

The time savings are small, but that is because caching mostly speeds up
the GetManagedObjects calls, and that is only a small part of the entire
nmcli call from client side.
</pre>
</div>
</content>
</entry>
<entry>
<title>core/dbus: rework creating numbered D-Bus export path by putting counter into class</title>
<updated>2018-03-13T10:29:18+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-03-13T09:14:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=57ab9fd60fc9ec3ab7bc3fcef40b1f003d614162'/>
<id>57ab9fd60fc9ec3ab7bc3fcef40b1f003d614162</id>
<content type='text'>
I dislike the static hash table to cache the integer counter for
numbered paths. Let's instead cache the counter at the class instance
itself -- since the class contains the information how the export
path should be exported.

However, we cannot use a plain integer field inside the class structure,
because the class is copied between derived classes. For example,
NMDeviceEthernet and NMDeviceBridge both get a copy of the NMDeviceClass
instance. Hence, the class doesn't contain the counter directly, but
a pointer to one counter that can be shared between sibling classes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I dislike the static hash table to cache the integer counter for
numbered paths. Let's instead cache the counter at the class instance
itself -- since the class contains the information how the export
path should be exported.

However, we cannot use a plain integer field inside the class structure,
because the class is copied between derived classes. For example,
NMDeviceEthernet and NMDeviceBridge both get a copy of the NMDeviceClass
instance. Hence, the class doesn't contain the counter directly, but
a pointer to one counter that can be shared between sibling classes.
</pre>
</div>
</content>
</entry>
</feed>
