<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/libnm/nm-manager.c, branch lr/python3</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: use the elvis operator wherever possible</title>
<updated>2018-05-10T12:36:58+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2018-04-24T09:20:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=e69d386975be997d3d840de9045e51521ac4474c'/>
<id>e69d386975be997d3d840de9045e51521ac4474c</id>
<content type='text'>
Coccinelle:

  @@
  expression a, b;
  @@
  -a ? a : b
  +a ?: b

Applied with:

  spatch --sp-file ternary.cocci --in-place --smpl-spacing --dir .

With some manual adjustments on spots that Cocci didn't catch for
reasons unknown.

Thanks to the marvelous effort of the GNU compiler developer we can now
spare a couple of bits that could be used for more important things,
like this commit message. Standards commitees yet have to catch up.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Coccinelle:

  @@
  expression a, b;
  @@
  -a ? a : b
  +a ?: b

Applied with:

  spatch --sp-file ternary.cocci --in-place --smpl-spacing --dir .

With some manual adjustments on spots that Cocci didn't catch for
reasons unknown.

Thanks to the marvelous effort of the GNU compiler developer we can now
spare a couple of bits that could be used for more important things,
like this commit message. Standards commitees yet have to catch up.
</pre>
</div>
</content>
</entry>
<entry>
<title>shared: drop duplicate c-list.h header</title>
<updated>2018-04-18T13:22:14+00:00</updated>
<author>
<name>Beniamino Galvani</name>
<email>bgalvani@redhat.com</email>
</author>
<published>2018-04-06T14:40:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=19876b4cfed86f79c43ba8d6e57f6383deb43e6f'/>
<id>19876b4cfed86f79c43ba8d6e57f6383deb43e6f</id>
<content type='text'>
Use the one from the project just imported.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the one from the project just imported.
</pre>
</div>
</content>
</entry>
<entry>
<title>libnm: rework checkpoint API</title>
<updated>2018-04-04T12:02:13+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-04-04T11:33:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=735dc41bd057301d65c3d22ca5c0689fa4cdebec'/>
<id>735dc41bd057301d65c3d22ca5c0689fa4cdebec</id>
<content type='text'>
The libnm API fir checkpoints was only introduced with 1.11. It
is not yet stable, so there is still time to adjust it. Note that
this changes API/ABI of the development branch.

Changes:

- we only add async variants of the checkpoint functions. I believe
  that synchronous D-Bus methods are fundamentally flawed, because
  they mess up the ordering of events.
  Rename the async functions by removing the "_async" suffix. This
  matches glib style, for which the async form is also not specially
  marked.

- for function that refere to a particular checkpoint (rollback and
  destroy), accept the D-Bus path as string, instead of an NMCheckpoint
  instance. This form is more flexible, because it allows to use
  the function without having a NMCheckpoint instance at hand. On the
  other hand, if one has a NMCheckpoint instance, he can trivially
  obtain the path to make the call.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The libnm API fir checkpoints was only introduced with 1.11. It
is not yet stable, so there is still time to adjust it. Note that
this changes API/ABI of the development branch.

Changes:

- we only add async variants of the checkpoint functions. I believe
  that synchronous D-Bus methods are fundamentally flawed, because
  they mess up the ordering of events.
  Rename the async functions by removing the "_async" suffix. This
  matches glib style, for which the async form is also not specially
  marked.

- for function that refere to a particular checkpoint (rollback and
  destroy), accept the D-Bus path as string, instead of an NMCheckpoint
  instance. This form is more flexible, because it allows to use
  the function without having a NMCheckpoint instance at hand. On the
  other hand, if one has a NMCheckpoint instance, he can trivially
  obtain the path to make the call.
</pre>
</div>
</content>
</entry>
<entry>
<title>checkpoint: allow resetting the rollback timeout via D-Bus</title>
<updated>2018-04-04T12:02:13+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-03-28T06:09:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=f67303221bdc8098cb3b6203ec777b294e412971'/>
<id>f67303221bdc8098cb3b6203ec777b294e412971</id>
<content type='text'>
This allows to adjust the timeout of an existing checkpoint.

The main usecase of checkpoints, is to have a fail-safe when
configuring the network remotely. By allowing to reset the timeout,
the user can perform a series of actions, and keep bumping the
timeout. That way, the entire series is still guarded by the same
checkpoint, but the user can start with short timeout, and
re-adjust the timeout as he goes along.

The libnm API only implements the async form (at least for now).
Sync methods are fundamentally wrong with D-Bus, and it's probably
not needed. Also, follow glib convenction, where the async form
doesn't have the _async name suffix. Also, accept a D-Bus path
as argument, not a NMCheckpoint instance. The libnm API should
not be more restricted than the underlying D-Bus API. It would
be cumbersome to require the user to lookup the NMCheckpoint
instance first, especially since libnm doesn't provide an efficient
or convenient lookup-by-path method. On the other hand, retrieving
the path from a NMCheckpoint instance is always possible.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows to adjust the timeout of an existing checkpoint.

The main usecase of checkpoints, is to have a fail-safe when
configuring the network remotely. By allowing to reset the timeout,
the user can perform a series of actions, and keep bumping the
timeout. That way, the entire series is still guarded by the same
checkpoint, but the user can start with short timeout, and
re-adjust the timeout as he goes along.

The libnm API only implements the async form (at least for now).
Sync methods are fundamentally wrong with D-Bus, and it's probably
not needed. Also, follow glib convenction, where the async form
doesn't have the _async name suffix. Also, accept a D-Bus path
as argument, not a NMCheckpoint instance. The libnm API should
not be more restricted than the underlying D-Bus API. It would
be cumbersome to require the user to lookup the NMCheckpoint
instance first, especially since libnm doesn't provide an efficient
or convenient lookup-by-path method. On the other hand, retrieving
the path from a NMCheckpoint instance is always possible.
</pre>
</div>
</content>
</entry>
<entry>
<title>libnm: fix crash creating checkpoint during find_checkpoint_info()</title>
<updated>2018-04-04T12:02:13+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-03-28T10:31:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=6f85d3e0b9bd80a74f4c20888103544f95be12a4'/>
<id>6f85d3e0b9bd80a74f4c20888103544f95be12a4</id>
<content type='text'>
Now that the D-Bus signals in server are reordered, creating
a checkpoint in libnm crashes:

  $ examples/python/gi/checkpoint.py create 4

    #0  0x00007ffff6d011ee in __strcmp_sse2_unaligned () at /lib64/libc.so.6
    #1  0x00007fffeb611c90 in find_checkpoint_info (manager=manager@entry=0x5555559e5110 [NMManager], path=0x7fffdc0092f0 "/org/freedesktop/NetworkManager/Checkpoint/6")
        at libnm/nm-manager.c:153
    #2  0x00007fffeb611d8f in checkpoint_added (manager=0x5555559e5110 [NMManager], checkpoint=checkpoint@entry=0x555555a122d0 [NMCheckpoint]) at libnm/nm-manager.c:1194
    #3  0x00007fffef7db929 in g_cclosure_marshal_VOID__OBJECTv (closure=0x5555559e4b30, return_value=&lt;optimized out&gt;, instance=&lt;optimized out&gt;, args=&lt;optimized out&gt;, marshal_data=&lt;optimized out&gt;, n_params=&lt;optimized out&gt;, param_types=0x5555559e2fc0) at gmarshal.c:2102
    #4  0x00007fffef7d8976 in _g_closure_invoke_va (closure=0x5555559e4b30, return_value=0x0, instance=0x5555559e5110, args=0x7fffffffc1c8, n_params=1, param_types=0x5555559e2fc0)
        at gclosure.c:867
    #5  0x00007fffef7f3ff4 in g_signal_emit_valist (instance=instance@entry=0x5555559e5110, signal_id=signal_id@entry=97, detail=0, var_args=var_args@entry=0x7fffffffc1c8) at gsignal.c:3300
    #6  0x00007fffef7f4b48 in g_signal_emit_by_name (instance=instance@entry=0x5555559e5110, detailed_signal=detailed_signal@entry=0x7fffffffc310 "checkpoint-added") at gsignal.c:3487
    #7  0x00007fffeb6156d1 in deferred_notify_cb (data=0x5555559e5110) at libnm/nm-object.c:219
    #8  0x00007fffeb615ae7 in object_property_maybe_complete (self=0x5555559e5110 [NMManager]) at libnm/nm-object.c:555
    #9  0x00007fffeb615e5d in object_created (obj=&lt;optimized out&gt;, path=&lt;optimized out&gt;, user_data=&lt;optimized out&gt;) at libnm/nm-object.c:576
    #10 0x00007fffeb61648b in handle_object_array_property (pi=&lt;optimized out&gt;, value=0x7fffdc075070, property_name=0x7fffeb67f117 "checkpoints", self=0x5555559e5110 [NMManager])
        at libnm/nm-object.c:671
    #11 0x00007fffeb61648b in handle_property_changed (self=self@entry=0x5555559e5110 [NMManager], dbus_name=&lt;optimized out&gt;, value=&lt;optimized out&gt;) at libnm/nm-object.c:740
    #12 0x00007fffeb6166e9 in properties_changed (proxy=&lt;optimized out&gt;, changed_properties=&lt;optimized out&gt;, invalidated_properties=&lt;optimized out&gt;, user_data=0x5555559e5110)
        at libnm/nm-object.c:772
    ...

That is, because NetworkManager now first emits signals that the checkpoint
object was created, before answering the D-Bus request. That makes more
sense, but leads to this crash.

The ugliness of how libnm handles object visibility is considerable.
libnm hides objects until they are fully initialized. So, when
the async create-checkpoint operation returns, the object might not
yet be ready to be exposed. We need to delay the result. It would be
better if the API would simply return the created path.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that the D-Bus signals in server are reordered, creating
a checkpoint in libnm crashes:

  $ examples/python/gi/checkpoint.py create 4

    #0  0x00007ffff6d011ee in __strcmp_sse2_unaligned () at /lib64/libc.so.6
    #1  0x00007fffeb611c90 in find_checkpoint_info (manager=manager@entry=0x5555559e5110 [NMManager], path=0x7fffdc0092f0 "/org/freedesktop/NetworkManager/Checkpoint/6")
        at libnm/nm-manager.c:153
    #2  0x00007fffeb611d8f in checkpoint_added (manager=0x5555559e5110 [NMManager], checkpoint=checkpoint@entry=0x555555a122d0 [NMCheckpoint]) at libnm/nm-manager.c:1194
    #3  0x00007fffef7db929 in g_cclosure_marshal_VOID__OBJECTv (closure=0x5555559e4b30, return_value=&lt;optimized out&gt;, instance=&lt;optimized out&gt;, args=&lt;optimized out&gt;, marshal_data=&lt;optimized out&gt;, n_params=&lt;optimized out&gt;, param_types=0x5555559e2fc0) at gmarshal.c:2102
    #4  0x00007fffef7d8976 in _g_closure_invoke_va (closure=0x5555559e4b30, return_value=0x0, instance=0x5555559e5110, args=0x7fffffffc1c8, n_params=1, param_types=0x5555559e2fc0)
        at gclosure.c:867
    #5  0x00007fffef7f3ff4 in g_signal_emit_valist (instance=instance@entry=0x5555559e5110, signal_id=signal_id@entry=97, detail=0, var_args=var_args@entry=0x7fffffffc1c8) at gsignal.c:3300
    #6  0x00007fffef7f4b48 in g_signal_emit_by_name (instance=instance@entry=0x5555559e5110, detailed_signal=detailed_signal@entry=0x7fffffffc310 "checkpoint-added") at gsignal.c:3487
    #7  0x00007fffeb6156d1 in deferred_notify_cb (data=0x5555559e5110) at libnm/nm-object.c:219
    #8  0x00007fffeb615ae7 in object_property_maybe_complete (self=0x5555559e5110 [NMManager]) at libnm/nm-object.c:555
    #9  0x00007fffeb615e5d in object_created (obj=&lt;optimized out&gt;, path=&lt;optimized out&gt;, user_data=&lt;optimized out&gt;) at libnm/nm-object.c:576
    #10 0x00007fffeb61648b in handle_object_array_property (pi=&lt;optimized out&gt;, value=0x7fffdc075070, property_name=0x7fffeb67f117 "checkpoints", self=0x5555559e5110 [NMManager])
        at libnm/nm-object.c:671
    #11 0x00007fffeb61648b in handle_property_changed (self=self@entry=0x5555559e5110 [NMManager], dbus_name=&lt;optimized out&gt;, value=&lt;optimized out&gt;) at libnm/nm-object.c:740
    #12 0x00007fffeb6166e9 in properties_changed (proxy=&lt;optimized out&gt;, changed_properties=&lt;optimized out&gt;, invalidated_properties=&lt;optimized out&gt;, user_data=0x5555559e5110)
        at libnm/nm-object.c:772
    ...

That is, because NetworkManager now first emits signals that the checkpoint
object was created, before answering the D-Bus request. That makes more
sense, but leads to this crash.

The ugliness of how libnm handles object visibility is considerable.
libnm hides objects until they are fully initialized. So, when
the async create-checkpoint operation returns, the object might not
yet be ready to be exposed. We need to delay the result. It would be
better if the API would simply return the created path.
</pre>
</div>
</content>
</entry>
<entry>
<title>libnm: minor cleanup of nm_manager_get_device_by_path()</title>
<updated>2018-04-04T12:02:13+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-03-28T14:59:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=4c67e0d5ece8cb20ba4b479685c3d295a5f682f0'/>
<id>4c67e0d5ece8cb20ba4b479685c3d295a5f682f0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add calls to g_simple_async_result_set_check_cancellable</title>
<updated>2018-03-08T13:52:45+00:00</updated>
<author>
<name>Benjamin Berg</name>
<email>bberg@redhat.com</email>
</author>
<published>2018-03-05T15:02:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=26c215e22dcfff9e61a58e9348991ed77c3f8861'/>
<id>26c215e22dcfff9e61a58e9348991ed77c3f8861</id>
<content type='text'>
If an operation is cancelled through the GCancellable, then the idiom is
that the operation is always cancelled, even if it has finished
successfully. To ensure this is the case, add calls to
g_simple_async_result_set_check_cancellable everywhere.

Without this, e.g. gnome-control-center will crash when switching away
from the power panel quickly, as the NMClient creation finishes
asynchronously and g-c-c assume that G_IO_ERROR_CANCELLED is returned to
ensure it doesn't access the now invalid user_data parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=794088
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If an operation is cancelled through the GCancellable, then the idiom is
that the operation is always cancelled, even if it has finished
successfully. To ensure this is the case, add calls to
g_simple_async_result_set_check_cancellable everywhere.

Without this, e.g. gnome-control-center will crash when switching away
from the power panel quickly, as the NMClient creation finishes
asynchronously and g-c-c assume that G_IO_ERROR_CANCELLED is returned to
ensure it doesn't access the now invalid user_data parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=794088
</pre>
</div>
</content>
</entry>
<entry>
<title>c-list: re-import latest version of c-list.h from upstream</title>
<updated>2017-11-28T10:26:39+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-11-28T10:22:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=b6efac9ec22563c8df747f883da653d85d188681'/>
<id>b6efac9ec22563c8df747f883da653d85d188681</id>
<content type='text'>
Most notably, it renames
  c_list_unlink_init() -&gt; c_list_unlink()
  c_list_unlink() -&gt; c_list_unlink_stale()

  $ sed -e 's/\&lt;c_list_unlink\&gt;/c_list_unlink_old/g' \
        -e 's/\&lt;c_list_unlink_init\&gt;/c_list_unlink/g' \
        -e 's/\&lt;c_list_unlink_old\&gt;/c_list_unlink_stale/g' \
        $(git grep -l c_list_unlink -- ':(exclude)shared/nm-utils/c-list.h') \
        -i
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most notably, it renames
  c_list_unlink_init() -&gt; c_list_unlink()
  c_list_unlink() -&gt; c_list_unlink_stale()

  $ sed -e 's/\&lt;c_list_unlink\&gt;/c_list_unlink_old/g' \
        -e 's/\&lt;c_list_unlink_init\&gt;/c_list_unlink/g' \
        -e 's/\&lt;c_list_unlink_old\&gt;/c_list_unlink_stale/g' \
        $(git grep -l c_list_unlink -- ':(exclude)shared/nm-utils/c-list.h') \
        -i
</pre>
</div>
</content>
</entry>
<entry>
<title>all: use nm_str_hash() instead of g_str_hash()</title>
<updated>2017-11-16T10:49:52+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-11-15T15:06:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=a6be2f4aa9070e7f423b7c9992dbae51f092071e'/>
<id>a6be2f4aa9070e7f423b7c9992dbae51f092071e</id>
<content type='text'>
We also do this for libnm and libnm-core, where it causes visible changes
in behavior. But if somebody would rely on the hashing implementation
for hash tables, it would be seriously flawed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We also do this for libnm and libnm-core, where it causes visible changes
in behavior. But if somebody would rely on the hashing implementation
for hash tables, it would be seriously flawed.
</pre>
</div>
</content>
</entry>
<entry>
<title>all: use nm_direct_hash() instead of g_direct_hash()</title>
<updated>2017-11-16T10:49:52+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-11-15T15:06:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=93adadbdcbbccfeafb8523b129f103bb5b23f7d5'/>
<id>93adadbdcbbccfeafb8523b129f103bb5b23f7d5</id>
<content type='text'>
We also do this for libnm, where it causes visible changes
in behavior. But if somebody would rely on the hashing implementation
for hash tables, it would be seriously flawed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We also do this for libnm, where it causes visible changes
in behavior. But if somebody would rely on the hashing implementation
for hash tables, it would be seriously flawed.
</pre>
</div>
</content>
</entry>
</feed>
