Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • NetworkManager NetworkManager
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 165
    • Issues 165
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • NetworkManagerNetworkManager
  • NetworkManagerNetworkManager
  • Merge requests
  • !258

th/libnm-dbus-rework-1] various patches for libnm and NMRefString

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Thomas Haller requested to merge th/libnm-dbus-rework-1 into master Sep 03, 2019
  • Overview 7
  • Commits 6
  • Pipelines 6
  • Changes 10

This is the first of a series of upcoming patches that will aim to rework (improve :) ) libnm.

At this point,

  • it just adds two utilities that are so far unused (but will be used).

  • also, it drops unused code from NMSecretAgentOld that still assumed there could be private D-Bus sockets.


In particular, NMRefString is something I wanted for a long time.

In the past, I did nm-ref-string, but that was NACK-ed. Also, it followed a different approach back then:

  • it exposed strings as const char *, instead of having a NMRefString struct (like GRefString does)
  • it does not supported interning, but only reference counting.

There is also GRefString, which serves a similar purpose, but makes some design decisions differently.

While there are pros and cons for each options (including whether to have such a helper at all), I think this is the overall best solution. And I intend to use that.

The usecase will be when tracking D-Bus objects. Those objects have D-Bus interfaces (strings like org.freedesktop.NetworkManager.Device.Wired), properties (strings like "HwAddress"), and object paths (like "/org/freedesktop/NetworkManager/Settings/22"). These strings are "arbitrary", in the sense that we cannot g_intern_string() them, because the application would leak them without freeing them ever. We should deduplicate them and also be able to compare them with pointer equality. That's what NMRefString gives.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: th/libnm-dbus-rework-1