After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771890 - [review] write and load some device-state to /var/run [th/device-state-bgo771890]
[review] write and load some device-state to /var/run [th/device-state-bgo771...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-09-23 17:33 UTC by Thomas Haller
Modified: 2016-09-26 11:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Haller 2016-09-23 17:33:30 UTC
The actual state is still unused.

This is in preparation for bug 746440 and will be used later.


Please review.
Comment 1 Beniamino Galvani 2016-09-26 08:28:02 UTC
> config: use logging macros

-       nm_log_dbg (LOGD_CORE, "don't persistate internal configuration (no file set, use --intern-config?)");
+       _LOGD ("don't persistate internal configuration (no file set, use --intern-config?)");

s/persistate/persist/


> config: store and load device runtime state to file

+       const int EXTRA = 30;
+       char buf[NM_STRLEN (NM_CONFIG_DEVICE_STATE_DIR"/") + EXTRA + 3] = NM_CONFIG_DEVICE_STATE_DIR"/";

nm-config.c: In function ‘nm_config_device_state_prune_unseen’:
nm-config.c:2010:2: error: variable-sized object may not be initialized
  char buf[NM_STRLEN (NM_CONFIG_DEVICE_STATE_DIR"/") + EXTRA + 3] = NM_CONFIG_DEVICE_STATE_DIR"/";


+       if (!g_key_file_save_to_file (kf, path, &local)) {
+               _LOGT ("device-state: failure to write #%d (%s): %s", ifindex, path, local->message);

A failure here will cause a wrong behavior when NM is restarted, so
maybe we need at least _LOGI ?


+       device_state_data = &((char *) device_state)[sizeof (NMConfigDeviceStateData)];

device_state_date = (char *) (device_state + 1); ?

The rest LGTM.
Comment 2 Thomas Haller 2016-09-26 08:52:29 UTC
thanks. Fixed all and repushed